#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int gcd(int, int);
int /*<<< orphan*/ printf(char *, int);
int gcd_main(int argc, char **argv) {
  printf("gcd (461952, 116298)=%d\n", gcd(461952, 116298));
  printf("gcd (46, 11)=%d\n", gcd(46, 11));
  printf("gcd (4645, 5634)=%d\n", gcd(46, 128));
  printf("gcd (54, 24)=%d\n", gcd(54, 24));
  printf("gcd (385024, 2093944)=%d\n", gcd(385024, 2093944));
  return 0;
}


x86 assembly (clang, -O0):
<gcd_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x70c80,%edi
mov    $0x1c64a,%esi
call   1040 <gcd@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2e,%edi
mov    $0xb,%esi
call   1040 <gcd@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2e,%edi
mov    $0x80,%esi
call   1040 <gcd@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x36,%edi
mov    $0x18,%esi
call   1040 <gcd@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5e000,%edi
mov    $0x1ff378,%esi
call   1040 <gcd@plt>
mov    %eax,%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd_main>:
push   %rax
mov    $0x70c80,%edi
mov    $0x1c64a,%esi
call   1040 <gcd@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2e,%edi
mov    $0xb,%esi
call   1040 <gcd@plt>
lea    0xec5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2e,%edi
mov    $0x80,%esi
call   1040 <gcd@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x36,%edi
mov    $0x18,%esi
call   1040 <gcd@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x5e000,%edi
mov    $0x1ff378,%esi
call   1040 <gcd@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"gcd (461952, 116298)=%d\0A\00"
@.str.1 = [17 x i8] c"gcd (46, 11)=%d\0A\00"
@.str.2 = [21 x i8] c"gcd (4645, 5634)=%d\0A\00"
@.str.3 = [17 x i8] c"gcd (54, 24)=%d\0A\00"
@.str.4 = [26 x i8] c"gcd (385024, 2093944)=%d\0A\00"
define i32 @gcd_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @gcd(i32 461952, i32 116298)
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @gcd(i32 46, i32 11)
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @gcd(i32 46, i32 128)
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = call i32 @gcd(i32 54, i32 24)
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %11)
%13 = call i32 @gcd(i32 385024, i32 2093944)
%14 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"gcd (461952, 116298)=%d\0A\00"
@.str.1 = [17 x i8] c"gcd (46, 11)=%d\0A\00"
@.str.2 = [21 x i8] c"gcd (4645, 5634)=%d\0A\00"
@.str.3 = [17 x i8] c"gcd (54, 24)=%d\0A\00"
@.str.4 = [26 x i8] c"gcd (385024, 2093944)=%d\0A\00"
define i32 @gcd_main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @gcd(i32 461952, i32 116298)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @gcd(i32 46, i32 11)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @gcd(i32 46, i32 128)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = tail call i32 @gcd(i32 54, i32 24)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%11 = tail call i32 @gcd(i32 385024, i32 2093944)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %11)
ret i32 0
}