#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 && x >= 0) && y >= 0) {
    tmp = y;
    xtmp = x;
    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)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x15(%rbp)
je     115b <main+0x4b>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x15(%rbp)
jl     115b <main+0x4b>
cmpl   $0x0,-0xc(%rbp)
setge  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    116b <main+0x5b>
jmp    11c4 <main+0xb4>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    118f <main+0x7f>
movl   $0x0,-0xc(%rbp)
jmp    11b3 <main+0xa3>
jmp    1194 <main+0x84>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11ae <main+0x9e>
mov    -0x14(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1194 <main+0x84>
jmp    11b3 <main+0xa3>
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 %17
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %3
%16 = icmp sge i32 %15, 0
br label %17
17: ; preds = %14, %11, %8
%18 = phi i1 [ false, %11 ], [ false, %8 ], [ %16, %14 ]
br i1 %18, label %19, label %39
19: ; preds = %17
%20 = load i32, i32* %3
store i32 %20, i32* %4
%21 = load i32, i32* %2
store i32 %21, i32* %5
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = icmp eq i32 %22, %23
br i1 %24, label %25, label %26
25: ; preds = %19
store i32 0, i32* %3
br label %36
26: ; preds = %19
br label %27
27: ; preds = %31, %26
%28 = load i32, i32* %5
%29 = load i32, i32* %3
%30 = icmp sgt i32 %28, %29
br i1 %30, label %31, label %35
31: ; preds = %27
%32 = load i32, i32* %5
%33 = load i32, i32* %3
%34 = sub nsw i32 %32, %33
store i32 %34, i32* %5
br label %27
35: ; preds = %27
br label %36
36: ; preds = %35, %25
%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 = %17
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
}