xunge/DecIR huggingface dataset:
int main() {
  int a;
  if (a > 10)
    if (a > 11)
      a = 3;
  a = 5;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x8(%rbp)
jle    112b <main+0x2b>
cmpl   $0xb,-0x8(%rbp)
jle    1126 <main+0x26>
movl   $0x3,-0x8(%rbp)
jmp    112b <main+0x2b>
movl   $0x5,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 10
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 11
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 3, i32* %2
br label %9
9: ; preds = %8, %5
br label %10
10: ; preds = %9, %0
store i32 5, i32* %2
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int test_imm_4Dint8_mem(signed char *val) {
  return ((*val) & (-0x4D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Dint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffffb3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Dint8_mem>:
testb  $0xb3,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Dint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -77
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void *MAP_FAILED;
scalar_t__ errno;
void *mmap(void *, uintptr_t, int /*<<< orphan*/, int /*<<< orphan*/,
           int /*<<< orphan*/, int /*<<< orphan*/);
void *x_cgo_mmap(void *addr, uintptr_t length, int32_t prot, int32_t flags,
                 int32_t fd, uint32_t offset) {
  void *p;
  p = mmap(addr, length, prot, flags, fd, offset);
  if (p == MAP_FAILED) {
    p = (void *)(uintptr_t)errno;
  }
  return p;
}


x86 assembly (clang, -O0):
<x_cgo_mmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
call   1030 <mmap@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    0x2e80(%rip),%rcx
cmp    (%rcx),%rax
jne    116f <x_cgo_mmap+0x5f>
mov    0x2e78(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_cgo_mmap>:
push   %rax
call   1030 <mmap@plt>
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%rax
jne    112c <x_cgo_mmap+0x1c>
mov    0x2eb7(%rip),%rax
mov    (%rax),%rax
pop    %rcx
ret

LLVM IR (-O0):
@MAP_FAILED = global i8* null
@errno = global i64 0
define i8* @x_cgo_mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
store i8* %0, i8** %7
store i64 %1, i64* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%14 = load i8*, i8** %7
%15 = load i64, i64* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = call i8* @mmap(i8* %14, i64 %15, i32 %16, i32 %17, i32 %18, i32 %19)
store i8* %20, i8** %13
%21 = load i8*, i8** %13
%22 = load i8*, i8** @MAP_FAILED
%23 = icmp eq i8* %21, %22
br i1 %23, label %24, label %27
24: ; preds = %6
%25 = load i64, i64* @errno
%26 = inttoptr i64 %25 to i8*
store i8* %26, i8** %13
br label %27
27: ; preds = %24, %6
%28 = load i8*, i8** %13
ret i8* %28
}

LLVM IR (-O2):
@MAP_FAILED = global i8* null
@errno = global i64 0
define i8* @x_cgo_mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i8* @mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5)
%8 = load i8*, i8** @MAP_FAILED
%9 = icmp eq i8* %7, %8
%10 = load i64, i64* @errno
%11 = inttoptr i64 %10 to i8*
%12 = select i1 %9, i8* %11, i8* %7
ret i8* %12
}
float div(int x, int y) { return (float)x / y; }


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
cvtsi2ss %edi,%xmm0
cvtsi2ss %esi,%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @div(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to float
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to float
%9 = fdiv float %6, %8
ret float %9
}

LLVM IR (-O2):
define float @div(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to float
%4 = sitofp i32 %1 to float
%5 = fdiv float %3, %4
ret float %5
}
int isSortedInt(int *data, int n) {
  int i;
  for (i = 1; i < n; ++i) {
    if (data[i - 1] > data[i]) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<isSortedInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115e <isSortedInt+0x5e>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    114b <isSortedInt+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1165 <isSortedInt+0x65>
jmp    1150 <isSortedInt+0x50>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <isSortedInt+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSortedInt>:
mov    $0x1,%eax
cmp    $0x2,%esi
jl     1132 <isSortedInt+0x32>
mov    %esi,%r8d
mov    (%rdi),%edx
mov    $0x1,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,%ecx
mov    (%rdi,%rsi,4),%edx
cmp    %edx,%ecx
jg     1133 <isSortedInt+0x33>
add    $0x1,%rsi
cmp    %rsi,%r8
jne    1120 <isSortedInt+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isSortedInt(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 1, i32* %6
br label %7
7: ; preds = %26, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %29
11: ; preds = %7
%12 = load i32*, i32** %4
%13 = load i32, i32* %6
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %12, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = icmp sgt i32 %17, %22
br i1 %23, label %24, label %25
24: ; preds = %11
store i32 0, i32* %3
br label %30
25: ; preds = %11
br label %26
26: ; preds = %25
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %7
29: ; preds = %7
store i32 1, i32* %3
br label %30
30: ; preds = %29, %24
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @isSortedInt(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = load i32, i32* %0
br label %9
7: ; preds = %9
%8 = icmp eq i64 %15, %5
br i1 %8, label %16, label %9
9: ; preds = %4, %7
%10 = phi i32 [ %6, %4 ], [ %13, %7 ]
%11 = phi i64 [ 1, %4 ], [ %15, %7 ]
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = icmp sgt i32 %10, %13
%15 = add nuw nsw i64 %11, 1
br i1 %14, label %16, label %7
16: ; preds = %9, %7, %2
%17 = phi i32 [ 1, %2 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %17
}
/* Variables and functions */
float cubic_io(float, float, float);
float cubic_f_int_io(float step, float max_steps, float max_val) {
  return cubic_io(step, max_steps, max_val);
}


x86 assembly (clang, -O0):
<cubic_f_int_io>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <cubic_io@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubic_f_int_io>:
jmp    1030 <cubic_io@plt>

LLVM IR (-O0):
define float @cubic_f_int_io(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @cubic_io(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @cubic_f_int_io(float %0, float %1, float %2) {
%4 = tail call float @cubic_io(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ debug(int, char *);
void plugin_stop() { debug(1, "stopping plugin"); }


x86 assembly (clang, -O0):
<plugin_stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <debug@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_stop>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <debug@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"stopping plugin\00"
define void @plugin_stop() {
%1 = call i32 @debug(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"stopping plugin\00"
define void @plugin_stop() {
%1 = tail call i32 @debug(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ portctl(char, int, char *);
int unkey() {
  int pin = 0;
  char mask = 0x04;
  portctl(mask, pin, "unkey");
  return 0;
}


x86 assembly (clang, -O0):
<unkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x4,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    -0x4(%rbp),%esi
lea    0xed0(%rip),%rdx
movsbl %al,%edi
call   1030 <portctl@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unkey>:
push   %rax
lea    0xee8(%rip),%rdx
mov    $0x4,%edi
xor    %esi,%esi
call   1030 <portctl@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"unkey\00"
define i32 @unkey() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 4, i8* %2
%3 = load i8, i8* %2
%4 = load i32, i32* %1
%5 = call i32 @portctl(i8 signext %3, i32 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"unkey\00"
define i32 @unkey() {
%1 = tail call i32 @portctl(i8 signext 4, i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
__typeof__(strncpy(1, 1, "")) test_strncpy_172(void) {
  return strncpy(1, 1, "");
}


x86 assembly (clang, -O0):
<test_strncpy_172>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
lea    0xee0(%rip),%rdx
mov    %rsi,%rdi
call   1030 <strncpy@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strncpy_172>:
lea    0xee9(%rip),%rdx
mov    $0x1,%edi
mov    $0x1,%esi
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @test_strncpy_172() {
%1 = call i8* @strncpy(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i64 ptrtoint ([1 x i8]* @.str to i64))
ret i8* %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @test_strncpy_172() {
%1 = tail call i8* @strncpy(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i64 ptrtoint ([1 x i8]* @.str to i64))
ret i8* inttoptr (i64 1 to i8*)
}
int main() {
  int i = 23;
  unsigned char c = 3;
  return ~i + ~c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x17,-0x8(%rbp)
movb   $0x3,-0x9(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
store i32 23, i32* %2
store i8 3, i8* %3
%4 = load i32, i32* %2
%5 = xor i32 %4, -1
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = xor i32 %7, -1
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
ret i32 -28
}
/* Variables and functions */
int /*<<< orphan*/ test_ebuild_comment_entities();
void all_ebuild_tests() { test_ebuild_comment_entities(); }


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

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

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

LLVM IR (-O2):
define void @all_ebuild_tests() {
%1 = tail call i32 (...) @test_ebuild_comment_entities()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
float uint32_to_float(uint32_t value) {
  union {
    uint32_t val;
    float fv;
  } a;
  a.val = value;
  return a.fv;
}


x86 assembly (clang, -O0):
<uint32_to_float>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint32_to_float>:
movd   %edi,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @uint32_to_float(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = bitcast %union.anon* %3 to i32*
store i32 %4, i32* %5
%6 = bitcast %union.anon* %3 to float*
%7 = load float, float* %6
ret float %7
}

LLVM IR (-O2):
define float @uint32_to_float(i32 %0) {
%2 = bitcast i32 %0 to float
ret float %2
}
long TestingPathological(long index, long total) {
  if (index == 0)
    return 10;
  else if (index < total / 2)
    return 11;
  else if (index == total - 1)
    return 10;
  return 9;
}


x86 assembly (clang, -O0):
<TestingPathological>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1124 <TestingPathological+0x24>
movq   $0xa,-0x8(%rbp)
jmp    118b <TestingPathological+0x8b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jge    1157 <TestingPathological+0x57>
movq   $0xb,-0x8(%rbp)
jmp    118b <TestingPathological+0x8b>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jne    1179 <TestingPathological+0x79>
movq   $0xa,-0x8(%rbp)
jmp    118b <TestingPathological+0x8b>
jmp    117e <TestingPathological+0x7e>
jmp    1183 <TestingPathological+0x83>
movq   $0x9,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestingPathological>:
test   %rdi,%rdi
je     112d <TestingPathological+0x2d>
mov    %rsi,%rcx
shr    $0x3f,%rcx
add    %rsi,%rcx
sar    %rcx
mov    $0xb,%eax
cmp    %rdi,%rcx
jg     112c <TestingPathological+0x2c>
add    $0xffffffffffffffff,%rsi
xor    %eax,%eax
cmp    %rdi,%rsi
sete   %al
add    $0x9,%rax
ret
mov    $0xa,%eax
ret

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

LLVM IR (-O2):
define i64 @TestingPathological(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = sdiv i64 %1, 2
%6 = icmp sgt i64 %5, %0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = add nsw i64 %1, -1
%9 = icmp eq i64 %8, %0
%10 = select i1 %9, i64 10, i64 9
br label %11
11: ; preds = %7, %4, %2
%12 = phi i64 [ 10, %2 ], [ 11, %4 ], [ %10, %7 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_180() {
  Assert_real((isqrt(180) == 13),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              905, ("Integer square root of 180 should be 13"));
}


x86 assembly (clang, -O0):
<t_sqrt_180>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb4,%edi
call   1030 <isqrt@plt>
cmp    $0xd,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x389,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_180>:
push   %rax
mov    $0xb4,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xd,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x389,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 180 should be 13\00"
define void @t_sqrt_180() {
%1 = call i32 @isqrt(i32 180)
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 905, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 180 should be 13\00"
define void @t_sqrt_180() {
%1 = tail call i32 @isqrt(i32 180)
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 905, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
extern uint32_t cel_bkdr_hash(const char *str) {
  register uint32_t h = 0;
  uint32_t seed = 131;
  while (*str != '\0') {
    h = h * seed + (*str++);
  }
  return (h & 0x7FFFFFFF);
}


x86 assembly (clang, -O0):
<cel_bkdr_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x83,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <cel_bkdr_hash+0x49>
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <cel_bkdr_hash+0x16>
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cel_bkdr_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <cel_bkdr_hash+0x2c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
imul   $0x83,%eax,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <cel_bkdr_hash+0x10>
and    $0x7fffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @cel_bkdr_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul nsw i32 %7, 131
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = add nsw i32 %9, %8
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 2147483647
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void main(void) {
  int i = 0;
  char y;
  for (i = 0; i < 256; i++) {
    printf("%c ", y);
    y++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1159 <main+0x49>
lea    0xec6(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <main+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [4 x i8] c"%c \00"
define void @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i32 0, i32* %1
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 256
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i8, i8* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = load i8, i8* %2
%10 = add i8 %9, 1
store i8 %10, i8* %2
br label %11
11: ; preds = %6
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
unsigned getch(void) {
  unsigned c;
  for (;;) {
    if (*(volatile unsigned *)(0xBF800000 + (0x22010)) & 0x00000001) {
      c = (unsigned char)*(volatile unsigned *)(0xBF800000 + (0x22030));
      break;
    }
  }
  return c;
}


x86 assembly (clang, -O0):
<getch>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbf822010,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1129 <getch+0x29>
mov    $0xbf822030,%eax
mov    (%rax),%eax
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    112e <getch+0x2e>
jmp    1104 <getch+0x4>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch>:
mov    $0xbf822010,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testl  $0x1,(%rax)
je     1110 <getch+0x10>
mov    0x20(%rax),%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @getch() {
%1 = alloca i32
br label %2
2: ; preds = %10, %0
%3 = load volatile i32, i32* inttoptr (i64 3212976144 to i32*)
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load volatile i32, i32* inttoptr (i64 3212976176 to i32*)
%8 = trunc i32 %7 to i8
%9 = zext i8 %8 to i32
store i32 %9, i32* %1
br label %11
10: ; preds = %2
br label %2
11: ; preds = %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @getch() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 3212976144 to i32*)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 3212976176 to i32*)
%7 = and i32 %6, 255
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ THROW(int);
int /*<<< orphan*/ printf(char *, int);
int rand();
void foo() {
  int i = rand() % 2 + 2;
  printf("foo(): throw %d!\n", i);
  THROW(i);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x2,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <THROW@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
xor    %eax,%eax
call   1050 <rand@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebx
add    $0x2,%ebx
lea    0xeaf(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <THROW@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"foo(): throw %d!\0A\00"
define void @foo() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 2
%4 = add nsw i32 %3, 2
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @THROW(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"foo(): throw %d!\0A\00"
define void @foo() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 2
%3 = add nsw i32 %2, 2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @THROW(i32 %3)
ret void
}
int ignore(x, y) { return -1; }


x86 assembly (clang, -O0):
<ignore>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ignore(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @ignore(i32 %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DEBUG;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void *task(void *arg) {
  syslog(LOG_DEBUG, "Running Task!");
  return NULL;
}


x86 assembly (clang, -O0):
<task>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <syslog@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<task>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <syslog@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LOG_DEBUG = global i32 0
@.str = [14 x i8] c"Running Task!\00"
define i8* @task(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_DEBUG
%4 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@LOG_DEBUG = global i32 0
@.str = [14 x i8] c"Running Task!\00"
define noalias i8* @task(i8* nocapture readnone %0) {
%2 = load i32, i32* @LOG_DEBUG
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int sin(float);
float f0(float z) { return 2 * sin(z) * sin(z); }


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   %ecx,%eax
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f0>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1030 <sin@plt>
mov    %eax,%ebx
movss  0xc(%rsp),%xmm0
call   1030 <sin@plt>
imul   %ebx,%eax
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @f0(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @sin(float %3)
%5 = mul nsw i32 2, %4
%6 = load float, float* %2
%7 = call i32 @sin(float %6)
%8 = mul nsw i32 %5, %7
%9 = sitofp i32 %8 to float
ret float %9
}

LLVM IR (-O2):
define float @f0(float %0) {
%2 = tail call i32 @sin(float %0)
%3 = shl nsw i32 %2, 1
%4 = tail call i32 @sin(float %0)
%5 = mul nsw i32 %3, %4
%6 = sitofp i32 %5 to float
ret float %6
}
/* Type definitions */
typedef scalar_t__ int_least16_t;

/* Variables and functions */
bool SHAREMIND_SET_KEY_EQUALS_int_least16_t(int_least16_t const k1,
                                            int_least16_t const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_EQUALS_int_least16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_EQUALS_int_least16_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_EQUALS_int_least16_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_EQUALS_int_least16_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int __attribute__((no, noclone)) foo(int i) {
  if (i < 5)
    __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    112a <foo+0x1a>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x4,%edi
jle    1118 <foo+0x8>
xor    %eax,%eax
ret
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 5
br i1 %4, label %5, label %6
5: ; preds = %1
unreachable
6: ; preds = %1
ret i32 0
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp slt i32 %0, 5
br i1 %2, label %3, label %4
3: ; preds = %1
tail call void @abort()
unreachable
4: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ d;

/* Variables and functions */
int /*<<< orphan*/ oled_SendCommand(unsigned char *, int);
void SetDisplayOffset(char a) {
  unsigned char d[] = {0xD3, a & 0x3F};
  oled_SendCommand(d, sizeof(d));
}


x86 assembly (clang, -O0):
<SetDisplayOffset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0xd3,-0x3(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x3f,%eax
mov    %al,-0x2(%rbp)
lea    -0x3(%rbp),%rdi
mov    $0x2,%esi
call   1030 <oled_SendCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetDisplayOffset>:
push   %rax
movb   $0xd3,0x6(%rsp)
and    $0x3f,%dil
mov    %dil,0x7(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <oled_SendCommand@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @SetDisplayOffset(i8 signext %0) {
%2 = alloca i8
%3 = alloca [2 x i8]
store i8 %0, i8* %2
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 -45, i8* %4
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = and i32 %7, 63
%9 = trunc i32 %8 to i8
store i8 %9, i8* %5
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%11 = call i32 @oled_SendCommand(i8* %10, i32 2)
ret void
}

LLVM IR (-O2):
define void @SetDisplayOffset(i8 signext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 -45, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%5 = and i8 %0, 63
store i8 %5, i8* %4
%6 = call i32 @oled_SendCommand(i8* %3, i32 2)
ret void
}
/* Variables and functions */
int GET32(int);
void uart_flush(void) {
  while (1) {
    if ((GET32(0x20215054) & 0x100) == 0)
      break;
  }
}


x86 assembly (clang, -O0):
<uart_flush>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <uart_flush+0x9>
mov    $0x20215054,%edi
call   1030 <GET32@plt>
and    $0x100,%eax
cmp    $0x0,%eax
jne    1136 <uart_flush+0x26>
jmp    113b <uart_flush+0x2b>
jmp    1119 <uart_flush+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_flush>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x20215054,%edi
call   1030 <GET32@plt>
test   $0x100,%eax
jne    1120 <uart_flush+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @uart_flush() {
br label %1
1: ; preds = %0, %6
%2 = call i32 @GET32(i32 539054164)
%3 = and i32 %2, 256
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %7
6: ; preds = %1
br label %1
7: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @uart_flush() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @GET32(i32 539054164)
%3 = and i32 %2, 256
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
/* Type definitions */
struct pollfd {
  int dummy;
};
struct _session {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ expect_amqp_header(struct pollfd *, struct pollfd *,
                                      struct _session *);
int out2in_written_socks_reply(struct pollfd *in_fd, struct pollfd *out_fd,
                               struct _session *sess) {
  expect_amqp_header(in_fd, out_fd, sess);
  return 0;
}


x86 assembly (clang, -O0):
<out2in_written_socks_reply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <expect_amqp_header@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pollfd = type { i32 }
%struct._session = type { i32 }
define i32 @out2in_written_socks_reply(%struct.pollfd* %0, %struct.pollfd* %1, %struct._session* %2) {
%4 = alloca %struct.pollfd*
%5 = alloca %struct.pollfd*
%6 = alloca %struct._session*
store %struct.pollfd* %0, %struct.pollfd** %4
store %struct.pollfd* %1, %struct.pollfd** %5
store %struct._session* %2, %struct._session** %6
%7 = load %struct.pollfd*, %struct.pollfd** %4
%8 = load %struct.pollfd*, %struct.pollfd** %5
%9 = load %struct._session*, %struct._session** %6
%10 = call i32 @expect_amqp_header(%struct.pollfd* %7, %struct.pollfd* %8, %struct._session* %9)
ret i32 0
}

LLVM IR (-O2):
%struct.pollfd = type { i32 }
%struct._session = type { i32 }
define i32 @out2in_written_socks_reply(%struct.pollfd* %0, %struct.pollfd* %1, %struct._session* %2) {
%4 = tail call i32 @expect_amqp_header(%struct.pollfd* %0, %struct.pollfd* %1, %struct._session* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int be32(int /*<<< orphan*/ *);
uint64_t be64(uint8_t *p) {
  uint32_t a, b;
  a = be32(p);
  b = be32(p + 4);
  return ((uint64_t)a << 32) | b;
}


x86 assembly (clang, -O0):
<be64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <be32@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
call   1030 <be32@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be64>:
push   %rbx
mov    %rdi,%rbx
call   1030 <be32@plt>
add    $0x10,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <be32@plt>

LLVM IR (-O0):
define i32 @be64(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @be32(i32* %5)
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 4
%9 = call i32 @be32(i32* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = shl i32 %10, 32
%12 = load i32, i32* %4
%13 = or i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @be64(i32* %0) {
%2 = tail call i32 @be32(i32* %0)
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = tail call i32 @be32(i32* %3)
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void CursorXYVT52(int x, int y) { printf("\033Y%c%c", y + 31, x + 31); }


x86 assembly (clang, -O0):
<CursorXYVT52>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
add    $0x1f,%esi
mov    -0x4(%rbp),%edx
add    $0x1f,%edx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CursorXYVT52>:
add    $0x1f,%esi
lea    0x1f(%rdi),%edx
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1BY%c%c\00"
define void @CursorXYVT52(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 31
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 31
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1BY%c%c\00"
define void @CursorXYVT52(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 31
%4 = add nsw i32 %0, 31
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}
int test_imm_BAint64_midword_reg(long long val) {
  return ((val >> 16) & (0xBA << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_BAint64_midword_reg>:
test   $0xba0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BAint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 186
%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_BAint64_midword_reg(i64 %0) {
%2 = and i64 %0, 12189696
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
dentro_ret(int x0, int y0, int x1, int y1, int x, int y) {
  if (((x <= x1) && (x >= x0)) && ((y <= y1) && (y >= y0)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<dentro_ret>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1154 <dentro_ret+0x54>
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1154 <dentro_ret+0x54>
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1154 <dentro_ret+0x54>
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1154 <dentro_ret+0x54>
movl   $0x1,-0x4(%rbp)
jmp    115b <dentro_ret+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dentro_ret>:
cmp    %edx,%r8d
setle  %al
cmp    %edi,%r8d
setge  %dl
and    %al,%dl
cmp    %ecx,%r9d
setle  %al
cmp    %esi,%r9d
setge  %cl
and    %al,%cl
and    %dl,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @dentro_ret(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
%14 = load i32, i32* %12
%15 = load i32, i32* %10
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %30
17: ; preds = %6
%18 = load i32, i32* %12
%19 = load i32, i32* %8
%20 = icmp sge i32 %18, %19
br i1 %20, label %21, label %30
21: ; preds = %17
%22 = load i32, i32* %13
%23 = load i32, i32* %11
%24 = icmp sle i32 %22, %23
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i32, i32* %13
%27 = load i32, i32* %9
%28 = icmp sge i32 %26, %27
br i1 %28, label %29, label %30
29: ; preds = %25
store i32 1, i32* %7
br label %31
30: ; preds = %25, %21, %17, %6
store i32 0, i32* %7
br label %31
31: ; preds = %30, %29
%32 = load i32, i32* %7
ret i32 %32
}

LLVM IR (-O2):
define i32 @dentro_ret(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp sgt i32 %4, %2
%8 = icmp slt i32 %4, %0
%9 = or i1 %7, %8
%10 = icmp sgt i32 %5, %3
%11 = or i1 %9, %10
%12 = icmp slt i32 %5, %1
%13 = or i1 %12, %11
%14 = xor i1 %13, true
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long backing_pixel;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
void set_XWindowAttributes_backing_pixel(void *_p, unsigned long _v) {
  ((XWindowAttributes *)_p)->backing_pixel = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XWindowAttributes_backing_pixel>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XWindowAttributes_backing_pixel(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void usage(void) {
  printf("exmasr v%d.%d\n", 1, 0);
  printf("usage: exhaust [opts] warriors...\n");
  printf("opts: -r <rounds>, -c <cycles>, -F <pos>, -s <coresize>,\n"
         "			-p <maxprocs>, -d <minsep>, -bk\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"exmasr v%d.%d\0A\00"
@.str.1 = [35 x i8] c"usage: exhaust [opts] warriors...\0A\00"
@.str.2 = [93 x i8] c"opts: -r <rounds>, -c <cycles>, -F <pos>, -s <coresize>,\0A\09\09\09-p <maxprocs>, -d <minsep>, -bk\0A\00"
define void @usage() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 1, i32 0)
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"exmasr v%d.%d\0A\00"
@str = [34 x i8] c"usage: exhaust [opts] warriors...\00"
@str.3 = [92 x i8] c"opts: -r <rounds>, -c <cycles>, -F <pos>, -s <coresize>,\0A\09\09\09-p <maxprocs>, -d <minsep>, -bk\00"
define void @usage() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 1, i32 0)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([92 x i8], [92 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ dvr_pipemsg_send(unsigned int, int /*<<< orphan*/,
                                    int /*<<< orphan*/ *);
void dvr_response_cmd(unsigned int msgId) { dvr_pipemsg_send(msgId, 0, NULL); }


x86 assembly (clang, -O0):
<dvr_response_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <dvr_pipemsg_send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvr_response_cmd>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <dvr_pipemsg_send@plt>

LLVM IR (-O0):
define void @dvr_response_cmd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @dvr_pipemsg_send(i32 %3, i32 0, i32* null)
ret void
}

LLVM IR (-O2):
define void @dvr_response_cmd(i32 %0) {
%2 = tail call i32 @dvr_pipemsg_send(i32 %0, i32 0, i32* null)
ret void
}
int isvaliddigit(int c) {
  if (c < 50 || c > 57)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isvaliddigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jl     111b <isvaliddigit+0x1b>
cmpl   $0x39,-0x8(%rbp)
jle    1127 <isvaliddigit+0x27>
movl   $0x0,-0x4(%rbp)
jmp    112e <isvaliddigit+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isvaliddigit>:
add    $0xffffffce,%edi
xor    %eax,%eax
cmp    $0x8,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isvaliddigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 50
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 57
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 0, i32* %2
br label %11
10: ; preds = %6
store i32 1, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @isvaliddigit(i32 %0) {
%2 = add i32 %0, -50
%3 = icmp ult i32 %2, 8
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int rom_present(char *);
int t130b_available(void) {
  return (rom_present(L"roms/scsi/ncr5380/trantor_t130b_bios_v2.14.bin"));
}


x86 assembly (clang, -O0):
<t130b_available>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <rom_present@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t130b_available>:
lea    0xee9(%rip),%rdi
jmp    1030 <rom_present@plt>

LLVM IR (-O0):
@.str = [47 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 115, i32 99, i32 115, i32 105, i32 47, i32 110, i32 99, i32 114, i32 53, i32 51, i32 56, i32 48, i32 47, i32 116, i32 114, i32 97, i32 110, i32 116, i32 111, i32 114, i32 95, i32 116, i32 49, i32 51, i32 48, i32 98, i32 95, i32 98, i32 105, i32 111, i32 115, i32 95, i32 118, i32 50, i32 46, i32 49, i32 52, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @t130b_available() {
%1 = call i32 @rom_present(i8* bitcast ([47 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [47 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 115, i32 99, i32 115, i32 105, i32 47, i32 110, i32 99, i32 114, i32 53, i32 51, i32 56, i32 48, i32 47, i32 116, i32 114, i32 97, i32 110, i32 116, i32 111, i32 114, i32 95, i32 116, i32 49, i32 51, i32 48, i32 98, i32 95, i32 98, i32 105, i32 111, i32 115, i32 95, i32 118, i32 50, i32 46, i32 49, i32 52, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @t130b_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([47 x i32]* @.str to i8*))
ret i32 %1
}