xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int kill(pid_t pid, int sig) {
  _exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<kill>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define i32 @kill(i32 %0, i32 %1) {
%3 = tail call i32 @_exit(i32 -1)
unreachable
}
long double longdouble_ignoring_unsignedlongint(long double x,
                                                unsigned long int y) {
  return x;
}


x86 assembly (clang, -O0):
<longdouble_ignoring_unsignedlongint>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<longdouble_ignoring_unsignedlongint>:
fldt   0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @longdouble_ignoring_unsignedlongint(x86_fp80 %0, i64 %1) {
%3 = alloca x86_fp80
%4 = alloca i64
store x86_fp80 %0, x86_fp80* %3
store i64 %1, i64* %4
%5 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @longdouble_ignoring_unsignedlongint(x86_fp80 returned %0, i64 %1) {
ret x86_fp80 %0
}
int ti_fisher_start(double const *options) { return (int)options[0] - 1; }


x86 assembly (clang, -O0):
<ti_fisher_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si (%rax),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti_fisher_start>:
cvttsd2si (%rdi),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ti_fisher_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
%7 = sub nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @ti_fisher_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = add nsw i32 %3, -1
ret i32 %4
}
unsigned short int f61(unsigned short int x, int y) {
  return (x << (8 * sizeof(unsigned short) - y)) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f61>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
movslq -0x8(%rbp),%rdx
mov    $0x10,%ecx
sub    %rdx,%rcx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f61>:
mov    $0x10,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f61(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = sub i64 16, %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %6, %10
%12 = load i16, i16* %3
%13 = zext i16 %12 to i32
%14 = load i32, i32* %4
%15 = ashr i32 %13, %14
%16 = xor i32 %11, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @f61(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = sub i32 16, %1
%5 = shl i32 %3, %4
%6 = lshr i32 %3, %1
%7 = xor i32 %5, %6
%8 = trunc i32 %7 to i16
ret i16 %8
}
double sqrt(double value) {
  double guess = value;
  for (int iteration = 0; iteration < 10; iteration++)
    guess = ((value / guess) + guess) / 2.0f;
  return guess;
}


x86 assembly (clang, -O0):
<sqrt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1152 <sqrt+0x52>
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xec5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111a <sqrt+0x1a>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt>:
movapd %xmm0,%xmm2
divsd  %xmm0,%xmm2
addsd  %xmm0,%xmm2
movsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm2
movapd %xmm0,%xmm3
divsd  %xmm2,%xmm3
addsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm3
movapd %xmm0,%xmm2
divsd  %xmm3,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm0,%xmm3
divsd  %xmm2,%xmm3
addsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm3
movapd %xmm0,%xmm2
divsd  %xmm3,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm0,%xmm3
divsd  %xmm2,%xmm3
addsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm3
movapd %xmm0,%xmm2
divsd  %xmm3,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm0,%xmm3
divsd  %xmm2,%xmm3
addsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm3
movapd %xmm0,%xmm2
divsd  %xmm3,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sqrt(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store double %0, double* %2
%5 = load double, double* %2
store double %5, double* %3
store i32 0, i32* %4
br label %6
6: ; preds = %16, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load double, double* %2
%11 = load double, double* %3
%12 = fdiv double %10, %11
%13 = load double, double* %3
%14 = fadd double %12, %13
%15 = fdiv double %14, 2.000000e+00
store double %15, double* %3
br label %16
16: ; preds = %9
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %6
19: ; preds = %6
%20 = load double, double* %3
ret double %20
}

LLVM IR (-O2):
define double @sqrt(double %0) {
%2 = fdiv double %0, %0
%3 = fadd double %2, %0
%4 = fmul double %3, 5.000000e-01
%5 = fdiv double %0, %4
%6 = fadd double %4, %5
%7 = fmul double %6, 5.000000e-01
%8 = fdiv double %0, %7
%9 = fadd double %7, %8
%10 = fmul double %9, 5.000000e-01
%11 = fdiv double %0, %10
%12 = fadd double %10, %11
%13 = fmul double %12, 5.000000e-01
%14 = fdiv double %0, %13
%15 = fadd double %13, %14
%16 = fmul double %15, 5.000000e-01
%17 = fdiv double %0, %16
%18 = fadd double %16, %17
%19 = fmul double %18, 5.000000e-01
%20 = fdiv double %0, %19
%21 = fadd double %19, %20
%22 = fmul double %21, 5.000000e-01
%23 = fdiv double %0, %22
%24 = fadd double %22, %23
%25 = fmul double %24, 5.000000e-01
%26 = fdiv double %0, %25
%27 = fadd double %25, %26
%28 = fmul double %27, 5.000000e-01
%29 = fdiv double %0, %28
%30 = fadd double %28, %29
%31 = fmul double %30, 5.000000e-01
ret double %31
}
/* Type definitions */
typedef int const uint64_t;

/* Variables and functions */
uint64_t ceil(const uint64_t x, const uint64_t y) {
  if (x % y == 0) {
    return x;
  }
  return x + (y - (x % y));
}


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1125 <ceil+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113f <ceil+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil>:
mov    %edi,%eax
cltd
idiv   %esi
sub    %edx,%esi
test   %edx,%edx
cmove  %edx,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @ceil(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = srem i32 %6, %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* %4
store i32 %11, i32* %3
br label %20
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = srem i32 %15, %16
%18 = sub nsw i32 %14, %17
%19 = add nsw i32 %13, %18
store i32 %19, i32* %3
br label %20
20: ; preds = %12, %10
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @ceil(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = sub nsw i32 %1, %3
%6 = select i1 %4, i32 0, i32 %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_file;

/* Variables and functions */
int memSectorSize(sqlite3_file *pFile) { return 1024; }


x86 assembly (clang, -O0):
<memSectorSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x400,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memSectorSize>:
mov    $0x400,%eax
ret

LLVM IR (-O0):
define i32 @memSectorSize(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret i32 1024
}

LLVM IR (-O2):
define i32 @memSectorSize(i32* nocapture readnone %0) {
ret i32 1024
}
void reset_board(void) {}


x86 assembly (clang, -O0):
<reset_board>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_board>:
ret

LLVM IR (-O0):
define void @reset_board() {
ret void
}

LLVM IR (-O2):
define void @reset_board() {
ret void
}
/* Type definitions */
struct coro {
  int dummy;
};

/* Variables and functions */
char *coro_memdup(struct coro *, char const *, scalar_t__);
scalar_t__ strlen(char const *);
char *coro_strdup(struct coro *coro, const char *str) {
  return coro_memdup(coro, str, strlen(str) + 1);
}


x86 assembly (clang, -O0):
<coro_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1040 <coro_memdup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coro_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <coro_memdup@plt>

LLVM IR (-O0):
%struct.coro = type { i32 }
define i8* @coro_strdup(%struct.coro* %0, i8* %1) {
%3 = alloca %struct.coro*
%4 = alloca i8*
store %struct.coro* %0, %struct.coro** %3
store i8* %1, i8** %4
%5 = load %struct.coro*, %struct.coro** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i8* @coro_memdup(%struct.coro* %5, i8* %6, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
%struct.coro = type { i32 }
define i8* @coro_strdup(%struct.coro* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @coro_memdup(%struct.coro* %0, i8* %1, i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
long fpathconf(int, int);
int open(char const *, int /*<<< orphan*/);
long pathconf(const char *path, int name) {
  int fd;
  long val;
  if ((fd = open(path, O_RDONLY)) < 0)
    return (-1L);
  val = fpathconf(fd, name);
  close(fd);
  return (val);
}


x86 assembly (clang, -O0):
<pathconf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    116a <pathconf+0x3a>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1189 <pathconf+0x59>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <fpathconf@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%edi
call   1030 <close@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconf>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
test   %eax,%eax
js     1161 <pathconf+0x31>
mov    %eax,%ebp
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <fpathconf@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1030 <close@plt>
mov    %rbx,%rax
jmp    1168 <pathconf+0x38>
mov    $0xffffffffffffffff,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define i64 @pathconf(i8* %0, i32 %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
%8 = load i8*, i8** %4
%9 = load i32, i32* @O_RDONLY
%10 = call i32 @open(i8* %8, i32 %9)
store i32 %10, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i64 -1, i64* %3
br label %20
13: ; preds = %2
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = call i64 @fpathconf(i32 %14, i32 %15)
store i64 %16, i64* %7
%17 = load i32, i32* %6
%18 = call i32 @close(i32 %17)
%19 = load i64, i64* %7
store i64 %19, i64* %3
br label %20
20: ; preds = %13, %12
%21 = load i64, i64* %3
ret i64 %21
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i64 @pathconf(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* %0, i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i64 @fpathconf(i32 %4, i32 %1)
%8 = tail call i32 @close(i32 %4)
br label %9
9: ; preds = %2, %6
%10 = phi i64 [ %7, %6 ], [ -1, %2 ]
ret i64 %10
}
/* Variables and functions */
int useStaticFromStatic();
extern int useStaticInlineFromExtern() { return useStaticFromStatic(); }


x86 assembly (clang, -O0):
<useStaticInlineFromExtern>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <useStaticFromStatic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<useStaticInlineFromExtern>:
xor    %eax,%eax
jmp    1030 <useStaticFromStatic@plt>

LLVM IR (-O0):
define i32 @useStaticInlineFromExtern() {
%1 = call i32 (...) @useStaticFromStatic()
ret i32 %1
}

LLVM IR (-O2):
define i32 @useStaticInlineFromExtern() {
%1 = tail call i32 (...) @useStaticFromStatic()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printme();
int init_module(void) {
  printme();
  return 0;
}


x86 assembly (clang, -O0):
<init_module>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <printme@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @init_module() {
%1 = call i32 (...) @printme()
ret i32 0
}

LLVM IR (-O2):
define i32 @init_module() {
%1 = tail call i32 (...) @printme()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
scalar_t__ cmp7(void const *, void const *);
scalar_t__ cmp8(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool cmp15(const void *a, const void *b) {
  return cmp7(a, b) && cmp8((uint8_t *)a + 7, (uint8_t *)b + 7);
}


x86 assembly (clang, -O0):
<cmp15>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <cmp7@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     116e <cmp15+0x4e>
mov    -0x8(%rbp),%rdi
add    $0x1c,%rdi
mov    -0x10(%rbp),%rsi
add    $0x1c,%rsi
call   1040 <cmp8@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp15>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <cmp7@plt>
test   %rax,%rax
je     1154 <cmp15+0x34>
add    $0x1c,%rbx
add    $0x1c,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <cmp8@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    1156 <cmp15+0x36>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @cmp15(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @cmp7(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to i32*
%12 = getelementptr inbounds i32, i32* %11, i64 7
%13 = load i8*, i8** %4
%14 = bitcast i8* %13 to i32*
%15 = getelementptr inbounds i32, i32* %14, i64 7
%16 = call i64 @cmp8(i32* %12, i32* %15)
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %9, %2
%19 = phi i1 [ false, %2 ], [ %17, %9 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @cmp15(i8* %0, i8* %1) {
%3 = tail call i64 @cmp7(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 28
%7 = bitcast i8* %6 to i32*
%8 = getelementptr inbounds i8, i8* %1, i64 28
%9 = bitcast i8* %8 to i32*
%10 = tail call i64 @cmp8(i32* %7, i32* %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %5, %2
%14 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %14
}
/* Variables and functions */
uintptr_t lrt_trans_idbase(void) { return (uintptr_t)(0xFFD00000); }


x86 assembly (clang, -O0):
<lrt_trans_idbase>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffd00000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrt_trans_idbase>:
mov    $0xffd00000,%eax
ret

LLVM IR (-O0):
define i64 @lrt_trans_idbase() {
ret i64 4291821568
}

LLVM IR (-O2):
define i64 @lrt_trans_idbase() {
ret i64 4291821568
}
/* Variables and functions */
int /*<<< orphan*/ endclosedline();
void endclosedline_() { endclosedline(); }


x86 assembly (clang, -O0):
<endclosedline_>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <endclosedline@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<endclosedline_>:
xor    %eax,%eax
jmp    1030 <endclosedline@plt>

LLVM IR (-O0):
define void @endclosedline_() {
%1 = call i32 (...) @endclosedline()
ret void
}

LLVM IR (-O2):
define void @endclosedline_() {
%1 = tail call i32 (...) @endclosedline()
ret void
}
void free2d(double **p, int row) {
  int i;
  for (i = 0; i < row; i++)
    free(p[i]);
  free(p);
}


x86 assembly (clang, -O0):
<free2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free2d+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free2d+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free2d>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free2d+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free2d+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free2d(double** %0, i32 %1) {
%3 = alloca double**
%4 = alloca i32
%5 = alloca i32
store double** %0, double*** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load double**, double*** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double*, double** %11, i64 %13
%15 = load double*, double** %14
%16 = bitcast double* %15 to i8*
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = load double**, double*** %3
%22 = bitcast double** %21 to i8*
ret void
}

LLVM IR (-O2):
define void @free2d(double** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = bitcast double** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast double** %0 to i8*
tail call void @free(i8* %14)
ret void
}
int test_imm_97int64_highword_reg(long long val) {
  return ((val >> 32) & (0x97 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_97int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x97,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_97int64_highword_reg>:
movabs $0x9700000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_97int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 151
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_97int64_highword_reg(i64 %0) {
%2 = and i64 %0, 648540061696
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
unsigned long lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
unsigned long filelength(int f) {
  unsigned long sz = lseek(f, 0, SEEK_END);
  lseek(f, 0, SEEK_SET);
  return sz;
}


x86 assembly (clang, -O0):
<filelength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filelength>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ecb(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %rax,%r14
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @filelength(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @SEEK_END
%6 = call i64 @lseek(i32 %4, i32 0, i32 %5)
store i64 %6, i64* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @SEEK_SET
%9 = call i64 @lseek(i32 %7, i32 0, i32 %8)
%10 = load i64, i64* %3
ret i64 %10
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @filelength(i32 %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i64 @lseek(i32 %0, i32 0, i32 %2)
%4 = load i32, i32* @SEEK_SET
%5 = tail call i64 @lseek(i32 %0, i32 0, i32 %4)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ juman_log_err(char *, int);
void my_exit(int exit_code) {
  juman_log_err("exit(%d)\n", exit_code);
  exit(exit_code);
}


x86 assembly (clang, -O0):
<my_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <juman_log_err@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<my_exit>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <juman_log_err@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"exit(%d)\0A\00"
define void @my_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @juman_log_err(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"exit(%d)\0A\00"
define void @my_exit(i32 %0) {
%2 = tail call i32 @juman_log_err(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ CompileCondition();
int /*<<< orphan*/ ResetIf();
int /*<<< orphan*/ WriteInstruction(char *);
void CR_CanGoDown(void) {
  WriteInstruction("call cangd");
  WriteInstruction("jp nz,      ");
  CompileCondition();
  ResetIf();
}


x86 assembly (clang, -O0):
<CR_CanGoDown>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <WriteInstruction@plt>
lea    0xec4(%rip),%rdi
call   1040 <WriteInstruction@plt>
mov    $0x0,%al
call   1050 <CompileCondition@plt>
mov    $0x0,%al
call   1030 <ResetIf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CR_CanGoDown>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <WriteInstruction@plt>
lea    0xec7(%rip),%rdi
call   1040 <WriteInstruction@plt>
xor    %eax,%eax
call   1050 <CompileCondition@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ResetIf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"call cangd\00"
@.str.1 = [13 x i8] c"jp nz, \00"
define void @CR_CanGoDown() {
%1 = call i32 @WriteInstruction(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @WriteInstruction(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @CompileCondition()
%4 = call i32 (...) @ResetIf()
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"call cangd\00"
@.str.1 = [13 x i8] c"jp nz, \00"
define void @CR_CanGoDown() {
%1 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @CompileCondition()
%4 = tail call i32 (...) @ResetIf()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_hword(unsigned short);
print_word(unsigned int u) {
  print_hword((unsigned short)(u >> 16));
  print_hword((unsigned short)(u & 0xffff));
}


x86 assembly (clang, -O0):
<print_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x10,%eax
movzwl %ax,%edi
call   1030 <print_hword@plt>
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
movzwl %ax,%edi
call   1030 <print_hword@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_word>:
push   %rbx
mov    %edi,%ebx
shr    $0x10,%edi
call   1030 <print_hword@plt>
movzwl %bx,%edi
pop    %rbx
jmp    1030 <print_hword@plt>

LLVM IR (-O0):
define i32 @print_word(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = lshr i32 %4, 16
%6 = trunc i32 %5 to i16
%7 = call i32 @print_hword(i16 zeroext %6)
%8 = load i32, i32* %3
%9 = and i32 %8, 65535
%10 = trunc i32 %9 to i16
%11 = call i32 @print_hword(i16 zeroext %10)
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @print_word(i32 %0) {
%2 = lshr i32 %0, 16
%3 = trunc i32 %2 to i16
%4 = tail call i32 @print_hword(i16 zeroext %3)
%5 = trunc i32 %0 to i16
%6 = tail call i32 @print_hword(i16 zeroext %5)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_setreuid;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int _setreuid(uid_t ruid, uid_t euid) {
  return syscall(SYS_setreuid, ruid, euid);
}


x86 assembly (clang, -O0):
<_setreuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_setreuid>:
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_setreuid = global i32 0
define i32 @_setreuid(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @SYS_setreuid
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @syscall(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@SYS_setreuid = global i32 0
define i32 @_setreuid(i32 %0, i32 %1) {
%3 = load i32, i32* @SYS_setreuid
%4 = tail call i32 @syscall(i32 %3, i32 %0, i32 %1)
ret i32 %4
}
__attribute__((noreturn)) void exception_default_handler(void) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<exception_default_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <exception_default_handler+0x9>
jmp    1109 <exception_default_handler+0x9>

x86 assembly (clang, -O2):
<exception_default_handler>:
jmp    1100 <exception_default_handler>

LLVM IR (-O0):
define void @exception_default_handler() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @exception_default_handler() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ str_rev(char *);
int main() {
  char str[100];
  printf("enter the string \n");
  scanf("%s", str);
  str_rev(str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xec4(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <str_rev@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xec7(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <str_rev@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"enter the string \0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = call i32 @str_rev(i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [18 x i8] c"enter the string \00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @str_rev(i8* %2)
ret i32 0
}
/* Variables and functions */
int GetInt();
int /*<<< orphan*/ printf(char *);
int getPositiveInt(void) {
  int n;
  do {
    printf("Please give me a positive int: ");
    n = GetInt();
  } while (n < 1);
  return n;
}


x86 assembly (clang, -O0):
<getPositiveInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <GetInt@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jl     1128 <getPositiveInt+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPositiveInt>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <GetInt@plt>
test   %eax,%eax
jle    1130 <getPositiveInt+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Please give me a positive int: \00"
define i32 @getPositiveInt() {
%1 = alloca i32
br label %2
2: ; preds = %5, %0
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @GetInt()
store i32 %4, i32* %1
br label %5
5: ; preds = %2
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 1
br i1 %7, label %2, label %8
8: ; preds = %5
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [32 x i8] c"Please give me a positive int: \00"
define i32 @getPositiveInt() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @GetInt()
%4 = icmp slt i32 %3, 1
br i1 %4, label %1, label %5
5: ; preds = %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
void error(int err) {
  if (err != 0)
    fprintf(stderr, "%s\n", strerror(err));
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     115b <error+0x3b>
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x8(%rbp),%edi
mov    %rax,%rdx
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
test   %edi,%edi
je     1145 <error+0x25>
push   %rbx
mov    0x2eb4(%rip),%rax
mov    (%rax),%ebx
call   1040 <strerror@plt>
lea    0xec6(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <fprintf@plt>
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i32, i32* %2
%8 = call i8* @strerror(i32 %7)
%9 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @error(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i8* @strerror(i32 %0)
%6 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %7
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
int f();
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d\n", f()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 (...) @f()
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void init_serial() { *(unsigned int *)0x16000008 = 0x10; }


x86 assembly (clang, -O0):
<init_serial>:
push   %rbp
mov    %rsp,%rbp
mov    $0x16000008,%eax
movl   $0x10,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_serial>:
movl   $0x10,0x16000008
ret

LLVM IR (-O0):
define void @init_serial() {
store i32 16, i32* inttoptr (i64 369098760 to i32*)
ret void
}

LLVM IR (-O2):
define void @init_serial() {
store i32 16, i32* inttoptr (i64 369098760 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glp_assert_(char *, char *, int);
void _glp_dlclose(void *h) {
  ((void)((h != h) ||
          (glp_assert_("h != h",
                       "/scratch/repos/new/home/jordi_armengol_estape/"
                       "c-scraper/outputs/2022-01-22/02-19-57/repos/hgourvest/"
                       "node-glpk/refs/heads/master/src/glpk/env/dlsup.c",
                       161),
           1)));
  return;
}


x86 assembly (clang, -O0):
<_glp_dlclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%al
cmp    -0x8(%rbp),%rcx
mov    %al,-0x9(%rbp)
jne    114c <_glp_dlclose+0x3c>
lea    0xeca(%rip),%rdi
lea    0xeca(%rip),%rsi
mov    $0xa1,%edx
call   1030 <glp_assert_@plt>
mov    $0x1,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_glp_dlclose>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
mov    $0xa1,%edx
jmp    1030 <glp_assert_@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"h != h\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hgourvest/node-glpk/refs/heads/master/src/glpk/env/dlsup.c\00"
define void @_glp_dlclose(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %3, %4
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @glp_assert_(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 161)
br label %8
8: ; preds = %6, %1
%9 = phi i1 [ true, %1 ], [ true, %6 ]
%10 = zext i1 %9 to i32
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"h != h\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hgourvest/node-glpk/refs/heads/master/src/glpk/env/dlsup.c\00"
define void @_glp_dlclose(i8* nocapture readnone %0) {
%2 = tail call i32 @glp_assert_(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 161)
ret void
}
void SymbolTests(void) {}


x86 assembly (clang, -O0):
<SymbolTests>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SymbolTests>:
ret

LLVM IR (-O0):
define void @SymbolTests() {
ret void
}

LLVM IR (-O2):
define void @SymbolTests() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void overwriteSYSCALL() {
  uint32_t *address = (uint32_t *)0xC00;
  int nopSledLength = 1;
  while (nopSledLength > 0) {
    *address = 0x15000002;
    address += 4;
    --nopSledLength;
  }
  *address = 0x24000000;
}


x86 assembly (clang, -O0):
<overwriteSYSCALL>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc00,%eax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1142 <overwriteSYSCALL+0x42>
mov    -0x8(%rbp),%rax
movl   $0x15000002,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <overwriteSYSCALL+0x14>
mov    -0x8(%rbp),%rax
movl   $0x24000000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<overwriteSYSCALL>:
movl   $0x15000002,0xc00
movl   $0x24000000,0xc10
ret

LLVM IR (-O0):
define void @overwriteSYSCALL() {
%1 = alloca i32*
%2 = alloca i32
store i32* inttoptr (i64 3072 to i32*), i32** %1
store i32 1, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32*, i32** %1
store i32 352321538, i32* %7
%8 = load i32*, i32** %1
%9 = getelementptr inbounds i32, i32* %8, i64 4
store i32* %9, i32** %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, -1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
%13 = load i32*, i32** %1
store i32 603979776, i32* %13
ret void
}

LLVM IR (-O2):
define void @overwriteSYSCALL() {
store i32 352321538, i32* inttoptr (i64 3072 to i32*)
store i32 603979776, i32* inttoptr (i64 3088 to i32*)
ret void
}
int is_number(char ch) { return ch >= '0' && ch <= '9'; }


x86 assembly (clang, -O0):
<is_number>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_number+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_number>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_number(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_number(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ bool_t;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *mallocNCopyMcfio(char *, int);
int /*<<< orphan*/ mcfioC_DefineUserBlock(int, char *, int /*<<< orphan*/,
                                          int *);
void mcfio_defineuserblock_(int *blkId, char *name, bool_t xdr_filter,
                            int *current_size, int length) {
  char *aString;
  aString = mallocNCopyMcfio(name, length);
  mcfioC_DefineUserBlock(*blkId, aString, xdr_filter, current_size);
  free(aString);
}


x86 assembly (clang, -O0):
<mcfio_defineuserblock_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1050 <mallocNCopyMcfio@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1040 <mcfioC_DefineUserBlock@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcfio_defineuserblock_>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r15d
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %r8d,%esi
call   1050 <mallocNCopyMcfio@plt>
mov    %rax,%rbp
mov    (%rbx),%edi
mov    %rax,%rsi
mov    %r15d,%edx
mov    %r14,%rcx
call   1040 <mcfioC_DefineUserBlock@plt>
mov    %rbp,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @mcfio_defineuserblock_(i32* %0, i8* %1, i32 %2, i32* %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i8*
store i32* %0, i32** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store i32 %4, i32* %10
%12 = load i8*, i8** %7
%13 = load i32, i32* %10
%14 = call i8* @mallocNCopyMcfio(i8* %12, i32 %13)
store i8* %14, i8** %11
%15 = load i32*, i32** %6
%16 = load i32, i32* %15
%17 = load i8*, i8** %11
%18 = load i32, i32* %8
%19 = load i32*, i32** %9
%20 = call i32 @mcfioC_DefineUserBlock(i32 %16, i8* %17, i32 %18, i32* %19)
%21 = load i8*, i8** %11
%22 = call i32 @free(i8* %21)
ret void
}

LLVM IR (-O2):
define void @mcfio_defineuserblock_(i32* nocapture %0, i8* %1, i32 %2, i32* %3, i32 %4) {
%6 = tail call i8* @mallocNCopyMcfio(i8* %1, i32 %4)
%7 = load i32, i32* %0
%8 = tail call i32 @mcfioC_DefineUserBlock(i32 %7, i8* %6, i32 %2, i32* %3)
%9 = tail call i32 @free(i8* %6)
ret void
}
/* Variables and functions */
scalar_t__ isspace(unsigned char);
char *strtriml(char *str) {
  while (isspace((unsigned char)*str))
    str++;
  return str;
}


x86 assembly (clang, -O0):
<strtriml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <strtriml+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <strtriml+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtriml>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <strtriml+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strtriml(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @isspace(i8 zeroext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @strtriml(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 zeroext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ Com_Printf(char *, char const *);
void Irc_Print(const char *msg) { Com_Printf("%s", msg); }


x86 assembly (clang, -O0):
<Irc_Print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <Com_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Irc_Print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <Com_Printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @Irc_Print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @Com_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @Irc_Print(i8* %0) {
%2 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ x_root;
};
typedef TYPE_1__ XLeaveWindowEvent;

/* Variables and functions */
int get_XLeaveWindowEvent_x_root(void *_p) {
  return (int)((XLeaveWindowEvent *)_p)->x_root;
}


x86 assembly (clang, -O0):
<get_XLeaveWindowEvent_x_root>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_XLeaveWindowEvent_x_root>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XLeaveWindowEvent_x_root(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XLeaveWindowEvent_x_root(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stmg_no_wrap();
int /*<<< orphan*/ stmg_wrap();
int main(void) {
  stmg_no_wrap();
  printf("\n");
  stmg_wrap();
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <stmg_no_wrap@plt>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <stmg_wrap@plt>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <stmg_no_wrap@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <stmg_wrap@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @stmg_no_wrap()
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @stmg_wrap()
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @stmg_no_wrap()
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 (...) @stmg_wrap()
%4 = tail call i32 @putchar(i32 10)
ret i32 0
}
void gtk_tree_model_get_valist() {}


x86 assembly (clang, -O0):
<gtk_tree_model_get_valist>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtk_tree_model_get_valist>:
ret

LLVM IR (-O0):
define void @gtk_tree_model_get_valist() {
ret void
}

LLVM IR (-O2):
define void @gtk_tree_model_get_valist() {
ret void
}