#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 atoi(char *);
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char **argv) {
  double a;
  double b;
  double c;
  double r1;
  double r2;
  int tmp;
  int tmp___0;
  {
    tmp = atoi(*(argv + 1));
    a = (double)tmp;
    tmp___0 = atoi(*(argv + 2));
    b = (double)tmp___0;
    {
      if (a == (double)0) {
        {
          printf("%g\n", b);
          {
            return (0);
            if (a > b) {
              a -= b;
            } else {
              b -= a;
            }
          }
        }
      }
      if (a > b) {
        a -= b;
      } else {
        b -= a;
      }
    }
    while (1) {
      if (!(b != (double)0)) {
        {
          {
            break;
            b -= a;
          }
          printf("%g\n", b);
        }
      }
      if (a > b) {
        a -= b;
      } else {
        b -= a;
      }
    }
    printf("%g\n", a);
    return (0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x3c(%rbp)
cvtsi2sdl -0x3c(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x40(%rbp)
cvtsi2sdl -0x40(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    119f <main+0x7f>
jp     119f <main+0x7f>
movsd  -0x20(%rbp),%xmm0
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1254 <main+0x134>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    11c7 <main+0xa7>
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11da <main+0xba>
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11df <main+0xbf>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11fc <main+0xdc>
jp     11fc <main+0xdc>
jmp    123c <main+0x11c>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1224 <main+0x104>
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1237 <main+0x117>
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11df <main+0xbf>
movsd  -0x18(%rbp),%xmm0
lea    0xdb8(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1040 <atoi@plt>
cvtsi2sd %eax,%xmm2
test   %ebp,%ebp
je     11ad <main+0x8d>
cvtsi2sd %ebp,%xmm0
ucomisd %xmm2,%xmm0
movapd %xmm2,%xmm3
cmpltsd %xmm0,%xmm3
andnpd %xmm0,%xmm3
movapd %xmm2,%xmm1
subsd  %xmm3,%xmm1
xorpd  %xmm3,%xmm3
ja     1169 <main+0x49>
xorpd  %xmm2,%xmm2
subsd  %xmm2,%xmm0
ucomisd %xmm3,%xmm1
jne    1175 <main+0x55>
jnp    11b1 <main+0x91>
xorpd  %xmm2,%xmm2
jmp    119d <main+0x7d>
nopl   0x0(%rax,%rax,1)
movapd %xmm1,%xmm4
cmpltsd %xmm0,%xmm4
andnpd %xmm0,%xmm4
subsd  %xmm4,%xmm1
subsd  %xmm3,%xmm0
ucomisd %xmm2,%xmm1
jne    119d <main+0x7d>
jnp    11b1 <main+0x91>
ucomisd %xmm1,%xmm0
movapd %xmm1,%xmm3
ja     1180 <main+0x60>
xorpd  %xmm3,%xmm3
jmp    1180 <main+0x60>
movapd %xmm2,%xmm0
lea    0xe48(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%g\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @atoi(i8* %15)
store i32 %16, i32* %11
%17 = load i32, i32* %11
%18 = sitofp i32 %17 to double
store double %18, double* %6
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 2
%21 = load i8*, i8** %20
%22 = call i32 @atoi(i8* %21)
store i32 %22, i32* %12
%23 = load i32, i32* %12
%24 = sitofp i32 %23 to double
store double %24, double* %7
%25 = load double, double* %6
%26 = fcmp oeq double %25, 0.000000e+00
br i1 %26, label %27, label %30
27: ; preds = %2
%28 = load double, double* %7
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %28)
store i32 0, i32* %3
br label %63
30: ; preds = %2
%31 = load double, double* %6
%32 = load double, double* %7
%33 = fcmp ogt double %31, %32
br i1 %33, label %34, label %38
34: ; preds = %30
%35 = load double, double* %7
%36 = load double, double* %6
%37 = fsub double %36, %35
store double %37, double* %6
br label %42
38: ; preds = %30
%39 = load double, double* %6
%40 = load double, double* %7
%41 = fsub double %40, %39
store double %41, double* %7
br label %42
42: ; preds = %38, %34
br label %43
43: ; preds = %42, %59
%44 = load double, double* %7
%45 = fcmp une double %44, 0.000000e+00
br i1 %45, label %47, label %46
46: ; preds = %43
br label %60
47: ; preds = %43
%48 = load double, double* %6
%49 = load double, double* %7
%50 = fcmp ogt double %48, %49
br i1 %50, label %51, label %55
51: ; preds = %47
%52 = load double, double* %7
%53 = load double, double* %6
%54 = fsub double %53, %52
store double %54, double* %6
br label %59
55: ; preds = %47
%56 = load double, double* %6
%57 = load double, double* %7
%58 = fsub double %57, %56
store double %58, double* %7
br label %59
59: ; preds = %55, %51
br label %43
60: ; preds = %46
%61 = load double, double* %6
%62 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %61)
store i32 0, i32* %3
br label %63
63: ; preds = %60, %27
%64 = load i32, i32* %3
ret i32 %64
}

LLVM IR (-O2):
@.str = [4 x i8] c"%g\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = sitofp i32 %5 to double
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = sitofp i32 %9 to double
%11 = icmp eq i32 %5, 0
br i1 %11, label %28, label %12
12: ; preds = %2
%13 = fcmp ogt double %6, %10
%14 = select i1 %13, double 0.000000e+00, double %6
%15 = fsub double %10, %14
%16 = select i1 %13, double %10, double 0.000000e+00
%17 = fsub double %6, %16
%18 = fcmp une double %15, 0.000000e+00
br i1 %18, label %19, label %28
19: ; preds = %12, %19
%20 = phi double [ %26, %19 ], [ %17, %12 ]
%21 = phi double [ %24, %19 ], [ %15, %12 ]
%22 = fcmp ogt double %20, %21
%23 = select i1 %22, double 0.000000e+00, double %20
%24 = fsub double %21, %23
%25 = select i1 %22, double %21, double 0.000000e+00
%26 = fsub double %20, %25
%27 = fcmp une double %24, 0.000000e+00
br i1 %27, label %19, label %28
28: ; preds = %19, %12, %2
%29 = phi double [ %10, %2 ], [ %17, %12 ], [ %26, %19 ]
%30 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %29)
ret i32 0
}