#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*/ __VERIFIER_assume(int);
unsigned int __VERIFIER_nondet_uint();
int /*<<< orphan*/ assert(int);
void check_gcd(unsigned a_in, unsigned b_in, unsigned gcd) {
  unsigned guessed_gcd = __VERIFIER_nondet_uint();
  __VERIFIER_assume(guessed_gcd > 1);
  __VERIFIER_assume(a_in % guessed_gcd == 0);
  __VERIFIER_assume(b_in % guessed_gcd == 0);
  assert(a_in % gcd == 0);
  assert(b_in % gcd == 0);
  assert(gcd >= guessed_gcd);
}


x86 assembly (clang, -O0):
<check_gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1050 <__VERIFIER_nondet_uint@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assume@plt>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x10(%rbp)
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assume@plt>
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0x10(%rbp)
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assume@plt>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_gcd>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %esi,%r14d
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <__VERIFIER_nondet_uint@plt>
mov    %eax,%ebp
xor    %edi,%edi
cmp    $0x2,%eax
setae  %dil
call   1040 <__VERIFIER_assume@plt>
mov    %ebx,%eax
xor    %edx,%edx
div    %ebp
xor    %edi,%edi
test   %edx,%edx
sete   %dil
call   1040 <__VERIFIER_assume@plt>
mov    %r14d,%eax
xor    %edx,%edx
div    %ebp
xor    %edi,%edi
test   %edx,%edx
sete   %dil
call   1040 <__VERIFIER_assume@plt>
mov    %ebx,%eax
xor    %edx,%edx
div    %r15d
xor    %edi,%edi
test   %edx,%edx
sete   %dil
call   1030 <assert@plt>
mov    %r14d,%eax
xor    %edx,%edx
div    %r15d
xor    %edi,%edi
test   %edx,%edx
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmp    %r15d,%ebp
setbe  %dil
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @check_gcd(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i32 (...) @__VERIFIER_nondet_uint()
store i32 %8, i32* %7
%9 = load i32, i32* %7
%10 = icmp ugt i32 %9, 1
%11 = zext i1 %10 to i32
%12 = call i32 @__VERIFIER_assume(i32 %11)
%13 = load i32, i32* %4
%14 = load i32, i32* %7
%15 = urem i32 %13, %14
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
%18 = call i32 @__VERIFIER_assume(i32 %17)
%19 = load i32, i32* %5
%20 = load i32, i32* %7
%21 = urem i32 %19, %20
%22 = icmp eq i32 %21, 0
%23 = zext i1 %22 to i32
%24 = call i32 @__VERIFIER_assume(i32 %23)
%25 = load i32, i32* %4
%26 = load i32, i32* %6
%27 = urem i32 %25, %26
%28 = icmp eq i32 %27, 0
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = load i32, i32* %5
%32 = load i32, i32* %6
%33 = urem i32 %31, %32
%34 = icmp eq i32 %33, 0
%35 = zext i1 %34 to i32
%36 = call i32 @assert(i32 %35)
%37 = load i32, i32* %6
%38 = load i32, i32* %7
%39 = icmp uge i32 %37, %38
%40 = zext i1 %39 to i32
%41 = call i32 @assert(i32 %40)
ret void
}

LLVM IR (-O2):
define void @check_gcd(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @__VERIFIER_nondet_uint()
%5 = icmp ugt i32 %4, 1
%6 = zext i1 %5 to i32
%7 = tail call i32 @__VERIFIER_assume(i32 %6)
%8 = urem i32 %0, %4
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = tail call i32 @__VERIFIER_assume(i32 %10)
%12 = urem i32 %1, %4
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
%15 = tail call i32 @__VERIFIER_assume(i32 %14)
%16 = urem i32 %0, %2
%17 = icmp eq i32 %16, 0
%18 = zext i1 %17 to i32
%19 = tail call i32 @assert(i32 %18)
%20 = urem i32 %1, %2
%21 = icmp eq i32 %20, 0
%22 = zext i1 %21 to i32
%23 = tail call i32 @assert(i32 %22)
%24 = icmp ule i32 %4, %2
%25 = zext i1 %24 to i32
%26 = tail call i32 @assert(i32 %25)
ret void
}