#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 __VERIFIER_nondet_int();
int main() {
  int x;
  int y;
  int tmp;
  int xtmp;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (y != 0) {
    tmp = y;
    xtmp = x;
    if (x <= 0 || y <= 0) {
      y = 0;
    } else {
      if (x == y) {
        y = 0;
      } else {
        while (xtmp > y) {
          xtmp = xtmp - y;
        }
      }
    }
    y = xtmp;
    x = tmp;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     11bb <main+0xab>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    115d <main+0x4d>
cmpl   $0x0,-0xc(%rbp)
jg     1169 <main+0x59>
movl   $0x0,-0xc(%rbp)
jmp    11aa <main+0x9a>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1181 <main+0x71>
movl   $0x0,-0xc(%rbp)
jmp    11a5 <main+0x95>
jmp    1186 <main+0x76>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11a0 <main+0x90>
mov    -0x14(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1186 <main+0x76>
jmp    11a5 <main+0x95>
jmp    11aa <main+0x9a>
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %2
%7 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %7, i32* %3
br label %8
8: ; preds = %36, %0
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %39
11: ; preds = %8
%12 = load i32, i32* %3
store i32 %12, i32* %4
%13 = load i32, i32* %2
store i32 %13, i32* %5
%14 = load i32, i32* %2
%15 = icmp sle i32 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %11
%17 = load i32, i32* %3
%18 = icmp sle i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %16, %11
store i32 0, i32* %3
br label %36
20: ; preds = %16
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = icmp eq i32 %21, %22
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 0, i32* %3
br label %35
25: ; preds = %20
br label %26
26: ; preds = %30, %25
%27 = load i32, i32* %5
%28 = load i32, i32* %3
%29 = icmp sgt i32 %27, %28
br i1 %29, label %30, label %34
30: ; preds = %26
%31 = load i32, i32* %5
%32 = load i32, i32* %3
%33 = sub nsw i32 %31, %32
store i32 %33, i32* %5
br label %26
34: ; preds = %26
br label %35
35: ; preds = %34, %24
br label %36
36: ; preds = %35, %19
%37 = load i32, i32* %5
store i32 %37, i32* %3
%38 = load i32, i32* %4
store i32 %38, i32* %2
br label %8
39: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}