#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 */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ gcd(int /*<<< orphan*/, int /*<<< orphan*/);
int strtoull(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  uint64_t a = (uint64_t)(argc > 1 ? strtoull(argv[1], NULL, 0) : 100000000);
  uint64_t b = (uint64_t)(argc > 2 ? strtoull(argv[2], NULL, 0) : 5);
  uint64_t r;
  r = gcd(a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    115b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <strtoull@plt>
mov    %eax,-0x20(%rbp)
jmp    1168 <main+0x48>
mov    $0x5f5e100,%eax
mov    %eax,-0x20(%rbp)
jmp    1168 <main+0x48>
mov    -0x20(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    1193 <main+0x73>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <strtoull@plt>
mov    %eax,-0x24(%rbp)
jmp    11a0 <main+0x80>
mov    $0x5,%eax
mov    %eax,-0x24(%rbp)
jmp    11a0 <main+0x80>
mov    -0x24(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <gcd@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x5,%r14d
mov    $0x5f5e100,%ebp
cmp    $0x2,%edi
jl     1160 <main+0x40>
mov    %rsi,%r15
mov    %edi,%ebx
mov    0x8(%rsi),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <strtoull@plt>
mov    %eax,%ebp
cmp    $0x2,%ebx
je     1160 <main+0x40>
mov    0x10(%r15),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <strtoull@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    %r14d,%esi
call   1040 <gcd@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @strtoull(i8* %14, i32* null, i32 0)
br label %17
16: ; preds = %2
br label %17
17: ; preds = %16, %11
%18 = phi i32 [ %15, %11 ], [ 100000000, %16 ]
store i32 %18, i32* %6
%19 = load i32, i32* %4
%20 = icmp sgt i32 %19, 2
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 2
%24 = load i8*, i8** %23
%25 = call i32 @strtoull(i8* %24, i32* null, i32 0)
br label %27
26: ; preds = %17
br label %27
27: ; preds = %26, %21
%28 = phi i32 [ %25, %21 ], [ 5, %26 ]
store i32 %28, i32* %7
%29 = load i32, i32* %6
%30 = load i32, i32* %7
%31 = call i32 @gcd(i32 %29, i32 %30)
store i32 %31, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strtoull(i8* nocapture %6, i32* null, i32 0)
%8 = icmp eq i32 %0, 2
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @strtoull(i8* nocapture %11, i32* null, i32 0)
br label %13
13: ; preds = %2, %4, %9
%14 = phi i32 [ %7, %9 ], [ %7, %4 ], [ 100000000, %2 ]
%15 = phi i32 [ %12, %9 ], [ 5, %4 ], [ 5, %2 ]
%16 = tail call i32 @gcd(i32 %14, i32 %15)
ret i32 0
}