#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 /*<<< orphan*/ printf(char *, unsigned int);
void main() {
  unsigned int x = 121, y = 11;
  while (x != y) {
    if (x > y) {
      x -= y;
      printf("%08x ", x);
    } else {
      y -= x;
      printf("%08x ", y);
    }
  }
  printf("%08x ", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x79,-0x4(%rbp)
movl   $0xb,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     117c <main+0x6c>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    115d <main+0x4d>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
jmp    1177 <main+0x67>
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%esi
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x79,%ebx
mov    $0xb,%esi
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%eax
mov    %esi,%ebx
sub    %eax,%ebx
mov    %ebx,%ebp
cmovb  %esi,%ebp
neg    %ebx
sub    %eax,%esi
cmovb  %ebx,%esi
cmovae %eax,%ebx
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %ebp,%esi
cmp    %ebp,%ebx
jne    1130 <main+0x20>
lea    0xea6(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%08x \00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 121, i32* %1
store i32 11, i32* %2
br label %3
3: ; preds = %23, %0
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %24
7: ; preds = %3
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = icmp ugt i32 %8, %9
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i32, i32* %2
%13 = load i32, i32* %1
%14 = sub i32 %13, %12
store i32 %14, i32* %1
%15 = load i32, i32* %1
%16 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %23
17: ; preds = %7
%18 = load i32, i32* %1
%19 = load i32, i32* %2
%20 = sub i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %17, %11
br label %3
24: ; preds = %3
%25 = load i32, i32* %1
%26 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %25)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%08x \00"
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 11, %0 ], [ %9, %1 ]
%3 = phi i32 [ 121, %0 ], [ %8, %1 ]
%4 = icmp ugt i32 %3, %2
%5 = sub i32 %2, %3
%6 = sub i32 %3, %2
%7 = select i1 %4, i32 %6, i32 %5
%8 = select i1 %4, i32 %6, i32 %3
%9 = select i1 %4, i32 %2, i32 %5
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7)
%11 = icmp eq i32 %8, %9
br i1 %11, label %12, label %1
12: ; preds = %1
%13 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}