#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, int);
int main() {
  int a = 10, b = 15;
  printf("GCD(%d, %d) = %dn", a, b, gcd(a, b));
  a = 35, b = 10;
  printf("GCD(%d, %d) = %dn", a, b, gcd(a, b));
  a = 31, b = 2;
  printf("GCD(%d, %d) = %dn", a, b, gcd(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0xf,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <gcd@plt>
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    %eax,%ecx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
movl   $0x23,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <gcd@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    %eax,%ecx
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1f,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <gcd@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
mov    $0xf,%esi
call   1040 <gcd@plt>
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0xf,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
mov    $0x23,%edi
mov    $0xa,%esi
call   1040 <gcd@plt>
mov    %rbx,%rdi
mov    $0x23,%esi
mov    $0xa,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
mov    $0x1f,%edi
mov    $0x2,%esi
call   1040 <gcd@plt>
mov    %rbx,%rdi
mov    $0x1f,%esi
mov    $0x2,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"GCD(%d, %d) = %dn\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 15, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @gcd(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %8)
store i32 35, i32* %2
store i32 10, i32* %3
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 @gcd(i32 %12, i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %14)
store i32 31, i32* %2
store i32 2, i32* %3
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = call i32 @gcd(i32 %18, i32 %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17, i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"GCD(%d, %d) = %dn\00"
define i32 @main() {
%1 = tail call i32 @gcd(i32 10, i32 15)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 10, i32 15, i32 %1)
%3 = tail call i32 @gcd(i32 35, i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 35, i32 10, i32 %3)
%5 = tail call i32 @gcd(i32 31, i32 2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 31, i32 2, i32 %5)
ret i32 0
}