SlideShare a Scribd company logo
1 of 15
Download to read offline
Please answer in MIPS assembly language only. Write the following nested function calls:
int Func(int a, int b, int c, int d){return Max(a+b, c-d);} int Max( int m, int n){if(m > n) {return
m;} else {return n;}} Also, write a main program that calls the Func function on the following
data and prints out the result. a = 0, b = 2, c = 8, and d = 3. Write a recursive function that
computes the smallest integer in a given array of integers. Use the following algorithm:
int Min( int[]A, int low, int high){if (low== high) {return A[low];} int mid = (low+high)/2; int
min1 = Min(A, low, mid); int min2 = Min(A, mid +1, high); if(min1>min2) {return min2;}
else {return min1;}} Also, write a main program that calls the Min function on the following
data and prints out the result. A = {5, 2, -9, 10, -23, 43, 2, 1, 3, 5, 10}, low = 0, and high = 10.
Solution
Following is the code that uses nested calls and also computes the smallest integer in a given
array of integers.
.file 1 ""
.section .mdebug.abi32
.previous
.gnu_attribute 4, 1
.abicalls
.rdata
.align 2
$LC0:
.ascii "Enter size of the array: 000"
.align 2
$LC1:
.ascii "%d000"
.align 2
$LC2:
.ascii "Enter %d elements in array: 000"
.align 2
$LC3:
.ascii "Minimum element in array = %d012000"
.align 2
$LC4:
.ascii "Maximum element in array = %d012000"
.text
.align 2
.globl main
$LFB0 = .
.set nomips16
.ent main
.type main, @function
main:
.frame $fp,448,$31 # vars= 416, regs= 2/0, args= 16, gp= 8
.mask 0xc0000000,-4
.fmask 0x00000000,0
.set noreorder
.cpload $25
.set nomacro
addiu $sp,$sp,-448
$LCFI0:
sw $31,444($sp)
$LCFI1:
sw $fp,440($sp)
movz $31,$31,$0
$LCFI2:
move $fp,$sp
$LCFI3:
.cprestore 16
lw $2,%got($LC0)($28)
nop
addiu $4,$2,%lo($LC0)
lw $2,%call16(printf)($28)
nop
move $25,$2
jalr $25
nop
lw $28,16($fp)
addiu $2,$fp,36
lw $3,%got($LC1)($28)
nop
addiu $4,$3,%lo($LC1)
move $5,$2
lw $2,%call16(scanf)($28)
nop
move $25,$2
jalr $25
nop
lw $28,16($fp)
lw $2,36($fp)
lw $3,%got($LC2)($28)
nop
addiu $4,$3,%lo($LC2)
move $5,$2
lw $2,%call16(printf)($28)
nop
move $25,$2
jalr $25
nop
lw $28,16($fp)
sw $0,24($fp)
b $L2
nop
$L3:
lw $2,24($fp)
addiu $3,$fp,40
sll $2,$2,2
addu $2,$3,$2
lw $3,%got($LC1)($28)
nop
addiu $4,$3,%lo($LC1)
move $5,$2
lw $2,%call16(scanf)($28)
nop
move $25,$2
jalr $25
nop
lw $28,16($fp)
lw $2,24($fp)
nop
addiu $2,$2,1
sw $2,24($fp)
$L2:
lw $2,36($fp)
lw $3,24($fp)
nop
slt $2,$3,$2
andi $2,$2,0x00ff
bne $2,$0,$L3
nop
lw $2,36($fp)
addiu $3,$fp,40
move $4,$3
move $5,$0
move $6,$2
lw $2,%got(_Z7maximumPiii)($28)
nop
move $25,$2
jalr $25
nop
lw $28,16($fp)
sw $2,32($fp)
lw $2,36($fp)
addiu $3,$fp,40
move $4,$3
move $5,$0
move $6,$2
lw $2,%got(_Z7minimumPiii)($28)
nop
move $25,$2
jalr $25
nop
lw $28,16($fp)
sw $2,28($fp)
lw $2,%got($LC3)($28)
nop
addiu $4,$2,%lo($LC3)
lw $5,28($fp)
lw $2,%call16(printf)($28)
nop
move $25,$2
jalr $25
nop
lw $28,16($fp)
nop
lw $2,%got($LC4)($28)
nop
addiu $4,$2,%lo($LC4)
lw $5,32($fp)
lw $2,%call16(printf)($28)
nop
move $25,$2
jalr $25
nop
lw $28,16($fp)
move $2,$0
move $sp,$fp
lw $31,444($sp)
lw $fp,440($sp)
addiu $sp,$sp,448
j $31
nop
.set macro
.set reorder
.end main
$LFE0:
.size main, .-main
.align 2
.globl _Z7maximumPiii
$LFB1 = .
.set nomips16
.ent _Z7maximumPiii
.type _Z7maximumPiii, @function
_Z7maximumPiii:
.frame $fp,40,$31 # vars= 8, regs= 2/0, args= 16, gp= 8
.mask 0xc0000000,-4
.fmask 0x00000000,0
.set noreorder
.cpload $25
.set nomacro
addiu $sp,$sp,-40
$LCFI4:
sw $31,36($sp)
$LCFI5:
sw $fp,32($sp)
movz $31,$31,$0
$LCFI6:
move $fp,$sp
$LCFI7:
.cprestore 16
sw $4,40($fp)
sw $5,44($fp)
sw $6,48($fp)
lw $2,48($fp)
nop
addiu $3,$2,-2
lw $2,44($fp)
nop
slt $2,$2,$3
bne $2,$0,$L6
nop
lw $2,44($fp)
nop
sll $2,$2,2
lw $3,40($fp)
nop
addu $2,$3,$2
lw $3,0($2)
lw $2,44($fp)
nop
addiu $2,$2,1
sll $2,$2,2
lw $4,40($fp)
nop
addu $2,$4,$2
lw $2,0($2)
nop
slt $2,$2,$3
beq $2,$0,$L7
nop
lw $2,44($fp)
nop
sll $2,$2,2
lw $3,40($fp)
nop
addu $2,$3,$2
lw $2,0($2)
b $L8
nop
$L7:
lw $2,44($fp)
nop
addiu $2,$2,1
sll $2,$2,2
lw $3,40($fp)
nop
addu $2,$3,$2
lw $2,0($2)
b $L8
nop
$L6:
lw $2,44($fp)
nop
addiu $2,$2,1
lw $4,40($fp)
move $5,$2
lw $6,48($fp)
lw $2,%got(_Z7maximumPiii)($28)
nop
move $25,$2
jalr $25
nop
lw $28,16($fp)
sw $2,24($fp)
lw $2,44($fp)
nop
sll $2,$2,2
lw $3,40($fp)
nop
addu $2,$3,$2
lw $3,0($2)
lw $2,24($fp)
nop
slt $2,$2,$3
beq $2,$0,$L9
nop
lw $2,44($fp)
nop
sll $2,$2,2
lw $3,40($fp)
nop
addu $2,$3,$2
lw $2,0($2)
b $L8
nop
$L9:
lw $2,24($fp)
$L8:
move $sp,$fp
lw $31,36($sp)
lw $fp,32($sp)
addiu $sp,$sp,40
j $31
nop
.set macro
.set reorder
.end _Z7maximumPiii
$LFE1:
.size _Z7maximumPiii, .-_Z7maximumPiii
.align 2
.globl _Z7minimumPiii
$LFB2 = .
.set nomips16
.ent _Z7minimumPiii
.type _Z7minimumPiii, @function
_Z7minimumPiii:
.frame $fp,40,$31 # vars= 8, regs= 2/0, args= 16, gp= 8
.mask 0xc0000000,-4
.fmask 0x00000000,0
.set noreorder
.cpload $25
.set nomacro
addiu $sp,$sp,-40
$LCFI8:
sw $31,36($sp)
$LCFI9:
sw $fp,32($sp)
movz $31,$31,$0
$LCFI10:
move $fp,$sp
$LCFI11:
.cprestore 16
sw $4,40($fp)
sw $5,44($fp)
sw $6,48($fp)
lw $2,48($fp)
nop
addiu $3,$2,-2
lw $2,44($fp)
nop
slt $2,$2,$3
bne $2,$0,$L12
nop
lw $2,44($fp)
nop
sll $2,$2,2
lw $3,40($fp)
nop
addu $2,$3,$2
lw $3,0($2)
lw $2,44($fp)
nop
addiu $2,$2,1
sll $2,$2,2
lw $4,40($fp)
nop
addu $2,$4,$2
lw $2,0($2)
nop
slt $2,$3,$2
beq $2,$0,$L13
nop
lw $2,44($fp)
nop
sll $2,$2,2
lw $3,40($fp)
nop
addu $2,$3,$2
lw $2,0($2)
b $L14
nop
$L13:
lw $2,44($fp)
nop
addiu $2,$2,1
sll $2,$2,2
lw $3,40($fp)
nop
addu $2,$3,$2
lw $2,0($2)
b $L14
nop
$L12:
lw $2,44($fp)
nop
addiu $2,$2,1
lw $4,40($fp)
move $5,$2
lw $6,48($fp)
lw $2,%got(_Z7minimumPiii)($28)
nop
move $25,$2
jalr $25
nop
lw $28,16($fp)
sw $2,24($fp)
lw $2,44($fp)
nop
sll $2,$2,2
lw $3,40($fp)
nop
addu $2,$3,$2
lw $3,0($2)
lw $2,24($fp)
nop
slt $2,$3,$2
beq $2,$0,$L15
nop
lw $2,44($fp)
nop
sll $2,$2,2
lw $3,40($fp)
nop
addu $2,$3,$2
lw $2,0($2)
b $L14
nop
$L15:
lw $2,24($fp)
$L14:
move $sp,$fp
lw $31,36($sp)
lw $fp,32($sp)
addiu $sp,$sp,40
j $31
nop
.set macro
.set reorder
.end _Z7minimumPiii
$LFE2:
.size _Z7minimumPiii, .-_Z7minimumPiii
.section .eh_frame,"aw",@progbits
$Lframe1:
.4byte $LECIE1-$LSCIE1
$LSCIE1:
.4byte 0x0
.byte 0x1
.globl __gxx_personality_v0
.ascii "zP000"
.uleb128 0x1
.sleb128 -4
.byte 0x1f
.uleb128 0x5
.byte 0x0
.4byte __gxx_personality_v0
.byte 0xc
.uleb128 0x1d
.uleb128 0x0
.align 2
$LECIE1:
$LSFDE1:
.4byte $LEFDE1-$LASFDE1
$LASFDE1:
.4byte $LASFDE1-$Lframe1
.4byte $LFB0
.4byte $LFE0-$LFB0
.uleb128 0x0
.byte 0x4
.4byte $LCFI0-$LFB0
.byte 0xe
.uleb128 0x1c0
.byte 0x4
.4byte $LCFI2-$LCFI0
.byte 0x11
.uleb128 0x1e
.sleb128 2
.byte 0x11
.uleb128 0x1f
.sleb128 1
.byte 0x4
.4byte $LCFI3-$LCFI2
.byte 0xd
.uleb128 0x1e
.align 2
$LEFDE1:
$LSFDE3:
.4byte $LEFDE3-$LASFDE3
$LASFDE3:
.4byte $LASFDE3-$Lframe1
.4byte $LFB1
.4byte $LFE1-$LFB1
.uleb128 0x0
.byte 0x4
.4byte $LCFI4-$LFB1
.byte 0xe
.uleb128 0x28
.byte 0x4
.4byte $LCFI6-$LCFI4
.byte 0x11
.uleb128 0x1e
.sleb128 2
.byte 0x11
.uleb128 0x1f
.sleb128 1
.byte 0x4
.4byte $LCFI7-$LCFI6
.byte 0xd
.uleb128 0x1e
.align 2
$LEFDE3:
$LSFDE5:
.4byte $LEFDE5-$LASFDE5
$LASFDE5:
.4byte $LASFDE5-$Lframe1
.4byte $LFB2
.4byte $LFE2-$LFB2
.uleb128 0x0
.byte 0x4
.4byte $LCFI8-$LFB2
.byte 0xe
.uleb128 0x28
.byte 0x4
.4byte $LCFI10-$LCFI8
.byte 0x11
.uleb128 0x1e
.sleb128 2
.byte 0x11
.uleb128 0x1f
.sleb128 1
.byte 0x4
.4byte $LCFI11-$LCFI10
.byte 0xd
.uleb128 0x1e
.align 2
$LEFDE5:
.ident "GCC: (Debian 4.4.5-8) 4.4.5"

More Related Content

More from bharatchawla141

What is the function in homworts Where can one find homwortsS.pdf
What is the function  in homworts  Where can one find homwortsS.pdfWhat is the function  in homworts  Where can one find homwortsS.pdf
What is the function in homworts Where can one find homwortsS.pdf
bharatchawla141
 
Powell and three companions attended a rock concert performed by Joh.pdf
Powell and three companions attended a rock concert performed by Joh.pdfPowell and three companions attended a rock concert performed by Joh.pdf
Powell and three companions attended a rock concert performed by Joh.pdf
bharatchawla141
 
Oxygen and ozone form the equilibrium below. The partial pressure of.pdf
Oxygen and ozone form the equilibrium below. The partial pressure of.pdfOxygen and ozone form the equilibrium below. The partial pressure of.pdf
Oxygen and ozone form the equilibrium below. The partial pressure of.pdf
bharatchawla141
 
LymeDisease1.–What is the disease called -- explain what the name .pdf
LymeDisease1.–What is the disease called -- explain what the name .pdfLymeDisease1.–What is the disease called -- explain what the name .pdf
LymeDisease1.–What is the disease called -- explain what the name .pdf
bharatchawla141
 

More from bharatchawla141 (20)

Write an MPI program that implements a shell-sort like parallel algo.pdf
Write an MPI program that implements a shell-sort like parallel algo.pdfWrite an MPI program that implements a shell-sort like parallel algo.pdf
Write an MPI program that implements a shell-sort like parallel algo.pdf
 
Which of the following are roles of proteins Pick ALL that apply..pdf
Which of the following are roles of proteins Pick ALL that apply..pdfWhich of the following are roles of proteins Pick ALL that apply..pdf
Which of the following are roles of proteins Pick ALL that apply..pdf
 
When are a persons fellowship, autonomy, and competence face threa.pdf
When are a persons fellowship, autonomy, and competence face threa.pdfWhen are a persons fellowship, autonomy, and competence face threa.pdf
When are a persons fellowship, autonomy, and competence face threa.pdf
 
What is the function in homworts Where can one find homwortsS.pdf
What is the function  in homworts  Where can one find homwortsS.pdfWhat is the function  in homworts  Where can one find homwortsS.pdf
What is the function in homworts Where can one find homwortsS.pdf
 
This is the assignmentOBJECTIVESAfter finishing this lab, stude.pdf
This is the assignmentOBJECTIVESAfter finishing this lab, stude.pdfThis is the assignmentOBJECTIVESAfter finishing this lab, stude.pdf
This is the assignmentOBJECTIVESAfter finishing this lab, stude.pdf
 
Two paragraph opinion about the film editing of the movie LIFE OF .pdf
Two paragraph opinion about the film editing of the movie LIFE OF .pdfTwo paragraph opinion about the film editing of the movie LIFE OF .pdf
Two paragraph opinion about the film editing of the movie LIFE OF .pdf
 
True or False The aDDM fixes the SV reference problem by assuming t.pdf
True or False The aDDM fixes the SV reference problem by assuming t.pdfTrue or False The aDDM fixes the SV reference problem by assuming t.pdf
True or False The aDDM fixes the SV reference problem by assuming t.pdf
 
The number of visits to public libraries increased from 1.4 billion i.pdf
The number of visits to public libraries increased from 1.4 billion i.pdfThe number of visits to public libraries increased from 1.4 billion i.pdf
The number of visits to public libraries increased from 1.4 billion i.pdf
 
The first table contains data of the Student entry. Attributes are Si.pdf
The first table contains data of the Student entry. Attributes are Si.pdfThe first table contains data of the Student entry. Attributes are Si.pdf
The first table contains data of the Student entry. Attributes are Si.pdf
 
Save for Later 12) Viruses, adware and spyware are referred to collec.pdf
Save for Later 12) Viruses, adware and spyware are referred to collec.pdfSave for Later 12) Viruses, adware and spyware are referred to collec.pdf
Save for Later 12) Viruses, adware and spyware are referred to collec.pdf
 
Sustainability Sustainability is an important consideration for any.pdf
Sustainability Sustainability is an important consideration for any.pdfSustainability Sustainability is an important consideration for any.pdf
Sustainability Sustainability is an important consideration for any.pdf
 
Research health data stewardship and in your post show why it is imp.pdf
Research health data stewardship and in your post show why it is imp.pdfResearch health data stewardship and in your post show why it is imp.pdf
Research health data stewardship and in your post show why it is imp.pdf
 
Read carefully. Im not sure if the point class is correct but postin.pdf
Read carefully. Im not sure if the point class is correct but postin.pdfRead carefully. Im not sure if the point class is correct but postin.pdf
Read carefully. Im not sure if the point class is correct but postin.pdf
 
Powell and three companions attended a rock concert performed by Joh.pdf
Powell and three companions attended a rock concert performed by Joh.pdfPowell and three companions attended a rock concert performed by Joh.pdf
Powell and three companions attended a rock concert performed by Joh.pdf
 
Oxygen and ozone form the equilibrium below. The partial pressure of.pdf
Oxygen and ozone form the equilibrium below. The partial pressure of.pdfOxygen and ozone form the equilibrium below. The partial pressure of.pdf
Oxygen and ozone form the equilibrium below. The partial pressure of.pdf
 
Part A Spacecraft instruments measure the radiation from an asteroid,.pdf
Part A Spacecraft instruments measure the radiation from an asteroid,.pdfPart A Spacecraft instruments measure the radiation from an asteroid,.pdf
Part A Spacecraft instruments measure the radiation from an asteroid,.pdf
 
LymeDisease1.–What is the disease called -- explain what the name .pdf
LymeDisease1.–What is the disease called -- explain what the name .pdfLymeDisease1.–What is the disease called -- explain what the name .pdf
LymeDisease1.–What is the disease called -- explain what the name .pdf
 
Many people do not realize that the Health Insurance Portability and.pdf
Many people do not realize that the Health Insurance Portability and.pdfMany people do not realize that the Health Insurance Portability and.pdf
Many people do not realize that the Health Insurance Portability and.pdf
 
In this unit, you have been asked to read and evaluate Multiple Inte.pdf
In this unit, you have been asked to read and evaluate Multiple Inte.pdfIn this unit, you have been asked to read and evaluate Multiple Inte.pdf
In this unit, you have been asked to read and evaluate Multiple Inte.pdf
 
In 2013, the Health Insurance Portability and Accountability Act (HI.pdf
In 2013, the Health Insurance Portability and Accountability Act (HI.pdfIn 2013, the Health Insurance Portability and Accountability Act (HI.pdf
In 2013, the Health Insurance Portability and Accountability Act (HI.pdf
 

Please answer in MIPS assembly language only. Write the following ne.pdf

  • 1. Please answer in MIPS assembly language only. Write the following nested function calls: int Func(int a, int b, int c, int d){return Max(a+b, c-d);} int Max( int m, int n){if(m > n) {return m;} else {return n;}} Also, write a main program that calls the Func function on the following data and prints out the result. a = 0, b = 2, c = 8, and d = 3. Write a recursive function that computes the smallest integer in a given array of integers. Use the following algorithm: int Min( int[]A, int low, int high){if (low== high) {return A[low];} int mid = (low+high)/2; int min1 = Min(A, low, mid); int min2 = Min(A, mid +1, high); if(min1>min2) {return min2;} else {return min1;}} Also, write a main program that calls the Min function on the following data and prints out the result. A = {5, 2, -9, 10, -23, 43, 2, 1, 3, 5, 10}, low = 0, and high = 10. Solution Following is the code that uses nested calls and also computes the smallest integer in a given array of integers. .file 1 "" .section .mdebug.abi32 .previous .gnu_attribute 4, 1 .abicalls .rdata .align 2 $LC0: .ascii "Enter size of the array: 000" .align 2 $LC1: .ascii "%d000" .align 2 $LC2: .ascii "Enter %d elements in array: 000" .align 2 $LC3: .ascii "Minimum element in array = %d012000" .align 2 $LC4: .ascii "Maximum element in array = %d012000"
  • 2. .text .align 2 .globl main $LFB0 = . .set nomips16 .ent main .type main, @function main: .frame $fp,448,$31 # vars= 416, regs= 2/0, args= 16, gp= 8 .mask 0xc0000000,-4 .fmask 0x00000000,0 .set noreorder .cpload $25 .set nomacro addiu $sp,$sp,-448 $LCFI0: sw $31,444($sp) $LCFI1: sw $fp,440($sp) movz $31,$31,$0 $LCFI2: move $fp,$sp $LCFI3: .cprestore 16 lw $2,%got($LC0)($28) nop addiu $4,$2,%lo($LC0) lw $2,%call16(printf)($28) nop move $25,$2 jalr $25 nop lw $28,16($fp) addiu $2,$fp,36 lw $3,%got($LC1)($28)
  • 3. nop addiu $4,$3,%lo($LC1) move $5,$2 lw $2,%call16(scanf)($28) nop move $25,$2 jalr $25 nop lw $28,16($fp) lw $2,36($fp) lw $3,%got($LC2)($28) nop addiu $4,$3,%lo($LC2) move $5,$2 lw $2,%call16(printf)($28) nop move $25,$2 jalr $25 nop lw $28,16($fp) sw $0,24($fp) b $L2 nop $L3: lw $2,24($fp) addiu $3,$fp,40 sll $2,$2,2 addu $2,$3,$2 lw $3,%got($LC1)($28) nop addiu $4,$3,%lo($LC1) move $5,$2 lw $2,%call16(scanf)($28) nop move $25,$2 jalr $25
  • 4. nop lw $28,16($fp) lw $2,24($fp) nop addiu $2,$2,1 sw $2,24($fp) $L2: lw $2,36($fp) lw $3,24($fp) nop slt $2,$3,$2 andi $2,$2,0x00ff bne $2,$0,$L3 nop lw $2,36($fp) addiu $3,$fp,40 move $4,$3 move $5,$0 move $6,$2 lw $2,%got(_Z7maximumPiii)($28) nop move $25,$2 jalr $25 nop lw $28,16($fp) sw $2,32($fp) lw $2,36($fp) addiu $3,$fp,40 move $4,$3 move $5,$0 move $6,$2 lw $2,%got(_Z7minimumPiii)($28) nop move $25,$2 jalr $25 nop
  • 5. lw $28,16($fp) sw $2,28($fp) lw $2,%got($LC3)($28) nop addiu $4,$2,%lo($LC3) lw $5,28($fp) lw $2,%call16(printf)($28) nop move $25,$2 jalr $25 nop lw $28,16($fp) nop lw $2,%got($LC4)($28) nop addiu $4,$2,%lo($LC4) lw $5,32($fp) lw $2,%call16(printf)($28) nop move $25,$2 jalr $25 nop lw $28,16($fp) move $2,$0 move $sp,$fp lw $31,444($sp) lw $fp,440($sp) addiu $sp,$sp,448 j $31 nop .set macro .set reorder .end main $LFE0: .size main, .-main .align 2
  • 6. .globl _Z7maximumPiii $LFB1 = . .set nomips16 .ent _Z7maximumPiii .type _Z7maximumPiii, @function _Z7maximumPiii: .frame $fp,40,$31 # vars= 8, regs= 2/0, args= 16, gp= 8 .mask 0xc0000000,-4 .fmask 0x00000000,0 .set noreorder .cpload $25 .set nomacro addiu $sp,$sp,-40 $LCFI4: sw $31,36($sp) $LCFI5: sw $fp,32($sp) movz $31,$31,$0 $LCFI6: move $fp,$sp $LCFI7: .cprestore 16 sw $4,40($fp) sw $5,44($fp) sw $6,48($fp) lw $2,48($fp) nop addiu $3,$2,-2 lw $2,44($fp) nop slt $2,$2,$3 bne $2,$0,$L6 nop lw $2,44($fp) nop
  • 7. sll $2,$2,2 lw $3,40($fp) nop addu $2,$3,$2 lw $3,0($2) lw $2,44($fp) nop addiu $2,$2,1 sll $2,$2,2 lw $4,40($fp) nop addu $2,$4,$2 lw $2,0($2) nop slt $2,$2,$3 beq $2,$0,$L7 nop lw $2,44($fp) nop sll $2,$2,2 lw $3,40($fp) nop addu $2,$3,$2 lw $2,0($2) b $L8 nop $L7: lw $2,44($fp) nop addiu $2,$2,1 sll $2,$2,2 lw $3,40($fp) nop addu $2,$3,$2 lw $2,0($2) b $L8
  • 8. nop $L6: lw $2,44($fp) nop addiu $2,$2,1 lw $4,40($fp) move $5,$2 lw $6,48($fp) lw $2,%got(_Z7maximumPiii)($28) nop move $25,$2 jalr $25 nop lw $28,16($fp) sw $2,24($fp) lw $2,44($fp) nop sll $2,$2,2 lw $3,40($fp) nop addu $2,$3,$2 lw $3,0($2) lw $2,24($fp) nop slt $2,$2,$3 beq $2,$0,$L9 nop lw $2,44($fp) nop sll $2,$2,2 lw $3,40($fp) nop addu $2,$3,$2 lw $2,0($2) b $L8 nop
  • 9. $L9: lw $2,24($fp) $L8: move $sp,$fp lw $31,36($sp) lw $fp,32($sp) addiu $sp,$sp,40 j $31 nop .set macro .set reorder .end _Z7maximumPiii $LFE1: .size _Z7maximumPiii, .-_Z7maximumPiii .align 2 .globl _Z7minimumPiii $LFB2 = . .set nomips16 .ent _Z7minimumPiii .type _Z7minimumPiii, @function _Z7minimumPiii: .frame $fp,40,$31 # vars= 8, regs= 2/0, args= 16, gp= 8 .mask 0xc0000000,-4 .fmask 0x00000000,0 .set noreorder .cpload $25 .set nomacro addiu $sp,$sp,-40 $LCFI8: sw $31,36($sp) $LCFI9: sw $fp,32($sp) movz $31,$31,$0 $LCFI10: move $fp,$sp
  • 10. $LCFI11: .cprestore 16 sw $4,40($fp) sw $5,44($fp) sw $6,48($fp) lw $2,48($fp) nop addiu $3,$2,-2 lw $2,44($fp) nop slt $2,$2,$3 bne $2,$0,$L12 nop lw $2,44($fp) nop sll $2,$2,2 lw $3,40($fp) nop addu $2,$3,$2 lw $3,0($2) lw $2,44($fp) nop addiu $2,$2,1 sll $2,$2,2 lw $4,40($fp) nop addu $2,$4,$2 lw $2,0($2) nop slt $2,$3,$2 beq $2,$0,$L13 nop lw $2,44($fp) nop sll $2,$2,2 lw $3,40($fp)
  • 11. nop addu $2,$3,$2 lw $2,0($2) b $L14 nop $L13: lw $2,44($fp) nop addiu $2,$2,1 sll $2,$2,2 lw $3,40($fp) nop addu $2,$3,$2 lw $2,0($2) b $L14 nop $L12: lw $2,44($fp) nop addiu $2,$2,1 lw $4,40($fp) move $5,$2 lw $6,48($fp) lw $2,%got(_Z7minimumPiii)($28) nop move $25,$2 jalr $25 nop lw $28,16($fp) sw $2,24($fp) lw $2,44($fp) nop sll $2,$2,2 lw $3,40($fp) nop addu $2,$3,$2
  • 12. lw $3,0($2) lw $2,24($fp) nop slt $2,$3,$2 beq $2,$0,$L15 nop lw $2,44($fp) nop sll $2,$2,2 lw $3,40($fp) nop addu $2,$3,$2 lw $2,0($2) b $L14 nop $L15: lw $2,24($fp) $L14: move $sp,$fp lw $31,36($sp) lw $fp,32($sp) addiu $sp,$sp,40 j $31 nop .set macro .set reorder .end _Z7minimumPiii $LFE2: .size _Z7minimumPiii, .-_Z7minimumPiii .section .eh_frame,"aw",@progbits $Lframe1: .4byte $LECIE1-$LSCIE1 $LSCIE1: .4byte 0x0 .byte 0x1 .globl __gxx_personality_v0
  • 13. .ascii "zP000" .uleb128 0x1 .sleb128 -4 .byte 0x1f .uleb128 0x5 .byte 0x0 .4byte __gxx_personality_v0 .byte 0xc .uleb128 0x1d .uleb128 0x0 .align 2 $LECIE1: $LSFDE1: .4byte $LEFDE1-$LASFDE1 $LASFDE1: .4byte $LASFDE1-$Lframe1 .4byte $LFB0 .4byte $LFE0-$LFB0 .uleb128 0x0 .byte 0x4 .4byte $LCFI0-$LFB0 .byte 0xe .uleb128 0x1c0 .byte 0x4 .4byte $LCFI2-$LCFI0 .byte 0x11 .uleb128 0x1e .sleb128 2 .byte 0x11 .uleb128 0x1f .sleb128 1 .byte 0x4 .4byte $LCFI3-$LCFI2 .byte 0xd .uleb128 0x1e .align 2
  • 14. $LEFDE1: $LSFDE3: .4byte $LEFDE3-$LASFDE3 $LASFDE3: .4byte $LASFDE3-$Lframe1 .4byte $LFB1 .4byte $LFE1-$LFB1 .uleb128 0x0 .byte 0x4 .4byte $LCFI4-$LFB1 .byte 0xe .uleb128 0x28 .byte 0x4 .4byte $LCFI6-$LCFI4 .byte 0x11 .uleb128 0x1e .sleb128 2 .byte 0x11 .uleb128 0x1f .sleb128 1 .byte 0x4 .4byte $LCFI7-$LCFI6 .byte 0xd .uleb128 0x1e .align 2 $LEFDE3: $LSFDE5: .4byte $LEFDE5-$LASFDE5 $LASFDE5: .4byte $LASFDE5-$Lframe1 .4byte $LFB2 .4byte $LFE2-$LFB2 .uleb128 0x0 .byte 0x4 .4byte $LCFI8-$LFB2 .byte 0xe
  • 15. .uleb128 0x28 .byte 0x4 .4byte $LCFI10-$LCFI8 .byte 0x11 .uleb128 0x1e .sleb128 2 .byte 0x11 .uleb128 0x1f .sleb128 1 .byte 0x4 .4byte $LCFI11-$LCFI10 .byte 0xd .uleb128 0x1e .align 2 $LEFDE5: .ident "GCC: (Debian 4.4.5-8) 4.4.5"