#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*/ _glp_lib_xassert(char *, char *, int);
int _glp_lib_gcd(int x, int y) {
  int r;
  ((void)((x > 0 && y > 0) ||
          (_glp_lib_xassert(
               "x > 0 && y > 0",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/macmanes-lab/BinPacker/refs/"
               "heads/master/glpk-4.40/src/glplib11.c",
               282),
           1)));
  while (y > 0)
    r = x % y, x = y, y = r;
  return x;
}


x86 assembly (clang, -O0):
<_glp_lib_gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1137 <_glp_lib_gcd+0x27>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jg     1154 <_glp_lib_gcd+0x44>
lea    0xec2(%rip),%rdi
lea    0xeca(%rip),%rsi
mov    $0x11a,%edx
call   1030 <_glp_lib_xassert@plt>
mov    $0x1,%al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
cmpl   $0x0,-0x8(%rbp)
jle    117c <_glp_lib_gcd+0x6c>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1157 <_glp_lib_gcd+0x47>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_glp_lib_gcd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
test   %edi,%edi
jle    1125 <_glp_lib_gcd+0x15>
test   %ebp,%ebp
jle    1125 <_glp_lib_gcd+0x15>
test   %ebp,%ebp
jg     1150 <_glp_lib_gcd+0x40>
jmp    1161 <_glp_lib_gcd+0x51>
lea    0xed4(%rip),%rdi
lea    0xedc(%rip),%rsi
mov    $0x11a,%edx
call   1030 <_glp_lib_xassert@plt>
test   %ebp,%ebp
jle    1161 <_glp_lib_gcd+0x51>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%ecx
mov    %ebx,%eax
cltd
idiv   %ebp
mov    %ebp,%ebx
mov    %edx,%ebp
test   %edx,%edx
jg     1150 <_glp_lib_gcd+0x40>
jmp    1163 <_glp_lib_gcd+0x53>
mov    %ebx,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"x > 0 && y > 0\00"
@.str.1 = [156 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/macmanes-lab/BinPacker/refs/heads/master/glpk-4.40/src/glplib11.c\00"
define i32 @_glp_lib_gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8, %2
%12 = call i32 @_glp_lib_xassert(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str.1, i64 0, i64 0), i32 282)
br label %13
13: ; preds = %11, %8
%14 = phi i1 [ true, %8 ], [ true, %11 ]
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %19, %13
%17 = load i32, i32* %4
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %25
19: ; preds = %16
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = srem i32 %20, %21
store i32 %22, i32* %5
%23 = load i32, i32* %4
store i32 %23, i32* %3
%24 = load i32, i32* %5
store i32 %24, i32* %4
br label %16
25: ; preds = %16
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
@.str = [15 x i8] c"x > 0 && y > 0\00"
@.str.1 = [156 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/macmanes-lab/BinPacker/refs/heads/master/glpk-4.40/src/glplib11.c\00"
define i32 @_glp_lib_gcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
%4 = icmp sgt i32 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @_glp_lib_xassert(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str.1, i64 0, i64 0), i32 282)
br label %8
8: ; preds = %2, %6
br i1 %4, label %9, label %14
9: ; preds = %8, %9
%10 = phi i32 [ %11, %9 ], [ %0, %8 ]
%11 = phi i32 [ %12, %9 ], [ %1, %8 ]
%12 = srem i32 %10, %11
%13 = icmp sgt i32 %12, 0
br i1 %13, label %9, label %14
14: ; preds = %9, %8
%15 = phi i32 [ %0, %8 ], [ %11, %9 ]
ret i32 %15
}