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

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ foo(int *, int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int main() {
  int BM_tab[0400];
  memset(BM_tab, 0, sizeof(BM_tab));
  foo(BM_tab, 6);
  if (BM_tab[0] != 6)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
lea    -0x410(%rbp),%rdi
mov    $0x6,%esi
call   1050 <foo@plt>
cmpl   $0x6,-0x410(%rbp)
je     117a <main+0x4a>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1050 <foo@plt>
cmpl   $0x6,(%rsp)
jne    1168 <main+0x38>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [256 x i32], [256 x i32]* %2, i64 0, i64 0
%4 = call i32 @memset(i32* %3, i32 0, i32 1024)
%5 = getelementptr inbounds [256 x i32], [256 x i32]* %2, i64 0, i64 0
%6 = call i32 @foo(i32* %5, i32 6)
%7 = getelementptr inbounds [256 x i32], [256 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 6
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [256 x i32]
%2 = bitcast [256 x i32]* %1 to i8*
%3 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 0
%4 = call i32 @memset(i32* %3, i32 0, i32 1024)
%5 = call i32 @foo(i32* %3, i32 6)
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 6
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
ret i32 0
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t cmpxchg_64(uint64_t *p, uint64_t old, uint64_t new) {
  uint64_t prev;
  asm volatile("lock; cmpxchgq %1,%2"
               : "=a"(prev)
               : "r"(new), "m"(*p), "0"(old)
               : "memory");
  return prev;
}


x86 assembly (clang, -O0):
<cmpxchg_64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rax
lock cmpxchg %rcx,(%rdx)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpxchg_64>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
ret

LLVM IR (-O0):
define i8* @cmpxchg_64(i8** %0, i8* %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = load i8**, i8*** %4
%10 = load i8*, i8** %5
%11 = call i8* asm sideeffect "lock; cmpxchgq $1,$2", "={ax},r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %8, i8** elementtype(i8*) %9, i8* %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
ret i8* %12
}

LLVM IR (-O2):
define i8* @cmpxchg_64(i8** %0, i8* %1, i8* %2) {
%4 = tail call i8* asm sideeffect "lock; cmpxchgq $1,$2", "={ax},r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %2, i8** elementtype(i8*) %0, i8* %1)
ret i8* %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void adts_set_channels(uint8_t *p_adts, uint8_t i_channels) {
  p_adts[2] &= ~0x03;
  p_adts[2] |= (i_channels & 0x7) >> 2;
  p_adts[3] &= ~0xc0;
  p_adts[3] |= (i_channels & 0x7) << 6;
}


x86 assembly (clang, -O0):
<adts_set_channels>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
and    $0xfffffffc,%ecx
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
sar    $0x2,%ecx
mov    -0x8(%rbp),%rax
or     0x8(%rax),%ecx
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
and    $0xffffff3f,%ecx
mov    %ecx,0xc(%rax)
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
shl    $0x6,%ecx
mov    -0x8(%rbp),%rax
or     0xc(%rax),%ecx
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<adts_set_channels>:
mov    0x8(%rdi),%eax
and    $0xfffffffc,%eax
and    $0x7,%esi
mov    %esi,%ecx
shr    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,0x8(%rdi)
mov    $0xffffff3f,%eax
and    0xc(%rdi),%eax
shl    $0x6,%esi
or     %eax,%esi
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @adts_set_channels(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 = getelementptr inbounds i32, i32* %5, i64 2
%7 = load i32, i32* %6
%8 = and i32 %7, -4
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = and i32 %9, 7
%11 = ashr i32 %10, 2
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 3
%18 = load i32, i32* %17
%19 = and i32 %18, -193
store i32 %19, i32* %17
%20 = load i32, i32* %4
%21 = and i32 %20, 7
%22 = shl i32 %21, 6
%23 = load i32*, i32** %3
%24 = getelementptr inbounds i32, i32* %23, i64 3
%25 = load i32, i32* %24
%26 = or i32 %25, %22
store i32 %26, i32* %24
ret void
}

LLVM IR (-O2):
define void @adts_set_channels(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 2
%4 = load i32, i32* %3
%5 = and i32 %4, -4
%6 = and i32 %1, 7
%7 = lshr i32 %6, 2
%8 = or i32 %5, %7
store i32 %8, i32* %3
%9 = getelementptr inbounds i32, i32* %0, i64 3
%10 = load i32, i32* %9
%11 = and i32 %10, -193
%12 = shl nuw nsw i32 %6, 6
%13 = or i32 %11, %12
store i32 %13, i32* %9
ret void
}
void cgprelude(void) {}


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

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

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

LLVM IR (-O2):
define void @cgprelude() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void huBaseFreeRaw(void *p) { free(p); }


x86 assembly (clang, -O0):
<huBaseFreeRaw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<huBaseFreeRaw>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @huBaseFreeRaw(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int fstat(int, struct stat *);
int sysFstat(int nFd, struct stat *pBuf) { return fstat(nFd, pBuf); }


x86 assembly (clang, -O0):
<sysFstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <fstat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysFstat>:
jmp    1030 <fstat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @sysFstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i32 @fstat(i32 %5, %struct.stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @sysFstat(i32 %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @fstat(i32 %0, %struct.stat* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
double sancus_frff(long double v, long double a, long double b) {
  assert((v >= a) && (v <= b));
  return (double)v;
}


x86 assembly (clang, -O0):
<sancus_frff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x30(%rbp)
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
mov    %al,-0x39(%rbp)
jb     1156 <sancus_frff+0x46>
jmp    1146 <sancus_frff+0x36>
fldt   -0x10(%rbp)
fldt   -0x30(%rbp)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
mov    %al,-0x39(%rbp)
mov    -0x39(%rbp),%al
movzbl %al,%edi
and    $0x1,%edi
call   1030 <assert@plt>
fldt   -0x10(%rbp)
fstpl  -0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_frff>:
sub    $0x18,%rsp
fldt   0x40(%rsp)
fldt   0x30(%rsp)
fldt   0x20(%rsp)
fld    %st(0)
fstpt  0xc(%rsp)
fucomi %st(1),%st
fstp   %st(1)
setae  %al
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
fldt   0xc(%rsp)
fstpl  (%rsp)
movsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @sancus_frff(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
store x86_fp80 %2, x86_fp80* %6
%7 = load x86_fp80, x86_fp80* %4
%8 = load x86_fp80, x86_fp80* %5
%9 = fcmp oge x86_fp80 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load x86_fp80, x86_fp80* %4
%12 = load x86_fp80, x86_fp80* %6
%13 = fcmp ole x86_fp80 %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ false, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load x86_fp80, x86_fp80* %4
%19 = fptrunc x86_fp80 %18 to double
ret double %19
}

LLVM IR (-O2):
define double @sancus_frff(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = fcmp oge x86_fp80 %0, %1
%5 = fcmp ole x86_fp80 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = fptrunc x86_fp80 %0 to double
ret double %9
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int _gettimeofday(struct timeval *tv, struct timezone *tz) {
  tv->tv_sec = 0;
  tv->tv_usec = 0;
  return 0;
}


x86 assembly (clang, -O0):
<_gettimeofday>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gettimeofday>:
xorps  %xmm0,%xmm0
movups %xmm0,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define i32 @_gettimeofday(%struct.timeval* %0, %struct.timezone* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timezone*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timezone* %1, %struct.timezone** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
store i64 0, i64* %6
%7 = load %struct.timeval*, %struct.timeval** %3
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
store i64 0, i64* %8
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define i32 @_gettimeofday(%struct.timeval* nocapture writeonly %0, %struct.timezone* nocapture readnone %1) {
%3 = bitcast %struct.timeval* %0 to i8*
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int abs(int);
void abs_positive() {
  Assert_real((abs(30000) == 30000),
              "/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/abs.c",
              32, ("Should be == 30000"));
}


x86 assembly (clang, -O0):
<abs_positive>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7530,%edi
call   1030 <abs@plt>
cmp    $0x7530,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebe(%rip),%rsi
mov    $0x20,%edx
lea    0xf52(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_positive>:
lea    0xee9(%rip),%rsi
lea    0xf82(%rip),%rcx
mov    $0x1,%edi
mov    $0x20,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [160 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/abs.c\00"
@.str.1 = [19 x i8] c"Should be == 30000\00"
define void @abs_positive() {
%1 = call i32 @abs(i32 30000)
%2 = icmp eq i32 %1, 30000
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 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/abs.c\00"
@.str.1 = [19 x i8] c"Should be == 30000\00"
define void @abs_positive() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int findElem(int a[], int size, int elem) {
  for (int i = 0; i < size; i++)
    if (a[i] == elem)
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<findElem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <findElem+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <findElem+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <findElem+0x5a>
jmp    1145 <findElem+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <findElem+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findElem>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <findElem+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <findElem+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <findElem+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @findElem(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ FatalErrnoError(int, int, char *);
int setgroups(size_t, int /*<<< orphan*/ const *);
void Esetgroups(size_t size, const gid_t *list) {
  FatalErrnoError(setgroups(size, list) == -1, 1, "setgroups()");
}


x86 assembly (clang, -O0):
<Esetgroups>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <setgroups@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x1,%esi
lea    0xeac(%rip),%rdx
call   1040 <FatalErrnoError@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Esetgroups>:
push   %rax
call   1030 <setgroups@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
lea    0xeca(%rip),%rdx
mov    $0x1,%esi
pop    %rax
jmp    1040 <FatalErrnoError@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"setgroups()\00"
define void @Esetgroups(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i64, i64* %3
%6 = load i32*, i32** %4
%7 = call i32 @setgroups(i64 %5, i32* %6)
%8 = icmp eq i32 %7, -1
%9 = zext i1 %8 to i32
%10 = call i32 @FatalErrnoError(i32 %9, i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"setgroups()\00"
define void @Esetgroups(i64 %0, i32* %1) {
%3 = tail call i32 @setgroups(i64 %0, i32* %1)
%4 = icmp eq i32 %3, -1
%5 = zext i1 %4 to i32
%6 = tail call i32 @FatalErrnoError(i32 %5, i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void preinit_2(void) { printf("preinit array 2\n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"preinit array 2\00"
define void @preinit_2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
uintptr_t alignLow(uintptr_t ptr, size_t align) { return ptr - ptr % align; }


x86 assembly (clang, -O0):
<alignLow>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    -0x18(%rbp),%rax
sub    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alignLow>:
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1116 <alignLow+0x16>
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
jmp    111c <alignLow+0x1c>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
sub    %rdx,%rdi
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @alignLow(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* %3
%7 = load i64, i64* %4
%8 = urem i64 %6, %7
%9 = sub i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @alignLow(i64 %0, i64 %1) {
%3 = urem i64 %0, %1
%4 = sub i64 %0, %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ primMST(int **);
int main() {
  int graph[5][5] = {
      {0, 2, 0, 6, 0}, {2, 0, 3, 8, 5}, {0, 3, 0, 0, 7},
      {6, 8, 0, 0, 9}, {0, 5, 7, 9, 0},
  };
  primMST(graph);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x64,%edx
call   1040 <memcpy@plt>
lea    -0x70(%rbp),%rdi
call   1030 <primMST@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
mov    0xf46(%rip),%eax
mov    %eax,0x60(%rsp)
movaps 0xf2b(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf0f(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xef3(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed7(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe9f(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <primMST@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
@__const.main.graph = [5 x [5 x i32]] [[5 x i32] [i32 0, i32 2, i32 0, i32 6, i32 0], [5 x i32] [i32 2, i32 0, i32 3, i32 8, i32 5], [5 x i32] [i32 0, i32 3, i32 0, i32 0, i32 7], [5 x i32] [i32 6, i32 8, i32 0, i32 0, i32 9], [5 x i32] [i32 0, i32 5, i32 7, i32 9, i32 0]]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x [5 x i32]]
store i32 0, i32* %1
%3 = bitcast [5 x [5 x i32]]* %2 to i8*
%4 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 0
%5 = bitcast [5 x i32]* %4 to i32**
%6 = call i32 @primMST(i32** %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.graph = [5 x [5 x i32]] [[5 x i32] [i32 0, i32 2, i32 0, i32 6, i32 0], [5 x i32] [i32 2, i32 0, i32 3, i32 8, i32 5], [5 x i32] [i32 0, i32 3, i32 0, i32 0, i32 7], [5 x i32] [i32 6, i32 8, i32 0, i32 0, i32 9], [5 x i32] [i32 0, i32 5, i32 7, i32 9, i32 0]]
define i32 @main() {
%1 = alloca [5 x [5 x i32]]
%2 = bitcast [5 x [5 x i32]]* %1 to i8*
%3 = bitcast [5 x [5 x i32]]* %1 to i32**
%4 = call i32 @primMST(i32** %3)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t reverseBits_fun_uint64_t(uint64_t x) {
  uint64_t r = x;
  int i = 63;
  while (x >>= 1) {
    r = (r << 1) | (x & 1);
    --i;
  }
  return r << i;
}


x86 assembly (clang, -O0):
<reverseBits_fun_uint64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x3f,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1145 <reverseBits_fun_uint64_t+0x45>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <reverseBits_fun_uint64_t+0x14>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseBits_fun_uint64_t>:
mov    $0x3f,%ecx
cmp    $0x2,%edi
jae    110e <reverseBits_fun_uint64_t+0xe>
mov    %edi,%eax
jmp    1134 <reverseBits_fun_uint64_t+0x34>
mov    $0x3f,%ecx
mov    %edi,%eax
mov    %edi,%edx
nopw   0x0(%rax,%rax,1)
sar    %edx
mov    %edx,%esi
and    $0x1,%esi
lea    (%rsi,%rax,2),%eax
add    $0xffffffff,%ecx
cmp    $0x3,%edi
mov    %edx,%edi
ja     1120 <reverseBits_fun_uint64_t+0x20>
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @reverseBits_fun_uint64_t(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %11, %3 ], [ 63, %1 ]
%6 = phi i32 [ %10, %3 ], [ %0, %1 ]
%7 = ashr i32 %4, 1
%8 = shl i32 %6, 1
%9 = and i32 %7, 1
%10 = or i32 %8, %9
%11 = add nsw i32 %5, -1
%12 = icmp ult i32 %4, 4
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i32 [ %0, %1 ], [ %10, %3 ]
%15 = phi i32 [ 63, %1 ], [ %11, %3 ]
%16 = shl i32 %14, %15
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void quitter(int sig, siginfo_t *si, void *unused) {
  printf("Quitting from signal %d\n", sig);
  exit(0);
}


x86 assembly (clang, -O0):
<quitter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quitter>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Quitting from signal %d\0A\00"
define void @quitter(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"Quitting from signal %d\0A\00"
define void @quitter(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = tail call i32 @exit(i32 0)
unreachable
}
void pathcon_nm6_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @pathcon_nm6_decref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void print(char *word) {
  if (*word) {
    print(word + 1);
    printf("%c", *word);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1159 <print+0x39>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1040 <print@plt>
mov    -0x8(%rbp),%rax
lea    0xeaf(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbx
cmpb   $0x0,(%rdi)
je     1142 <print+0x22>
mov    %rdi,%rbx
add    $0x1,%rdi
call   1040 <print@plt>
movsbl (%rbx),%esi
lea    0xec4(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1, %5
ret void
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 1
tail call void @print(i8* %6)
%7 = load i8, i8* %0
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %7)
br label %4
}
void *lst_create() {}


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

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

LLVM IR (-O0):
define i8* @lst_create() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @lst_create() {
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ getuid();
__attribute__((__weak__, __always___)) uid_t softboundmpx_getuid(void) {
  return getuid();
}


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

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

LLVM IR (-O0):
define weak i32 @softboundmpx_getuid() {
%1 = call i32 (...) @getuid()
ret i32 %1
}

LLVM IR (-O2):
define weak i32 @softboundmpx_getuid() {
%1 = tail call i32 (...) @getuid()
ret i32 %1
}
/* Variables and functions */
long double __qsin(long double);
long double intr_wrap_060(long double p1) { return __qsin(p1); }


x86 assembly (clang, -O0):
<intr_wrap_060>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__qsin@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_060>:
jmp    1030 <__qsin@plt>

LLVM IR (-O0):
define x86_fp80 @intr_wrap_060(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @__qsin(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @intr_wrap_060(x86_fp80 %0) {
%2 = tail call x86_fp80 @__qsin(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ cBreak();
void wBreak() {
  cBreak();
  cBreak();
}


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

x86 assembly (clang, -O2):
<wBreak>:
push   %rax
xor    %eax,%eax
call   1030 <cBreak@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <cBreak@plt>

LLVM IR (-O0):
define void @wBreak() {
%1 = call i32 (...) @cBreak()
%2 = call i32 (...) @cBreak()
ret void
}

LLVM IR (-O2):
define void @wBreak() {
%1 = tail call i32 (...) @cBreak()
%2 = tail call i32 (...) @cBreak()
ret void
}
/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ kill(int);
void endOfProcess() {
  int pid = (int)getpid();
  if (pid != 1) {
    kill(pid);
    while (1)
      ;
  }
}


x86 assembly (clang, -O0):
<endOfProcess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     1149 <endOfProcess+0x29>
mov    -0x4(%rbp),%edi
call   1040 <kill@plt>
jmp    1144 <endOfProcess+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endOfProcess>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
cmp    $0x1,%eax
jne    112f <endOfProcess+0xf>
pop    %rax
ret
mov    %eax,%edi
call   1040 <kill@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1140 <endOfProcess+0x20>

LLVM IR (-O0):
define void @endOfProcess() {
%1 = alloca i32
%2 = call i64 (...) @getpid()
%3 = trunc i64 %2 to i32
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* %1
%8 = call i32 @kill(i32 %7)
br label %9
9: ; preds = %6, %9
br label %9
10: ; preds = %0
ret void
}

LLVM IR (-O2):
define void @endOfProcess() {
%1 = tail call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
%3 = icmp eq i32 %2, 1
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = tail call i32 @kill(i32 %2)
br label %6
6: ; preds = %6, %4
br label %6
7: ; preds = %0
ret void
}
void port_suspend(void) { asm volatile("cli" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @port_suspend() {
tail call void asm sideeffect "cli", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int eg_indirect_table_get(unsigned int, int, unsigned int, int, unsigned int *);
int eg_sc_table_get(unsigned int dev_id, unsigned int index,
                    unsigned int *pentry) {
  if ((index < 0) || (index > 31)) {
    return -1;
  }
  return eg_indirect_table_get(dev_id, 2, index, 4, pentry);
}


x86 assembly (clang, -O0):
<eg_sc_table_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jb     1136 <eg_sc_table_get+0x26>
cmpl   $0x1f,-0xc(%rbp)
jbe    1142 <eg_sc_table_get+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <eg_sc_table_get+0x4e>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    $0x2,%esi
mov    $0x4,%ecx
call   1030 <eg_indirect_table_get@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eg_sc_table_get>:
cmp    $0x1f,%esi
jbe    111b <eg_sc_table_get+0xb>
mov    $0xffffffff,%eax
ret
mov    %rdx,%r8
mov    %esi,%edx
mov    $0x2,%esi
mov    $0x4,%ecx
jmp    1030 <eg_indirect_table_get@plt>

LLVM IR (-O0):
define i32 @eg_sc_table_get(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%8 = load i32, i32* %6
%9 = icmp ult i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp ugt i32 %11, 31
br i1 %12, label %13, label %14
13: ; preds = %10, %3
store i32 -1, i32* %4
br label %19
14: ; preds = %10
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = load i32*, i32** %7
%18 = call i32 @eg_indirect_table_get(i32 %15, i32 2, i32 %16, i32 4, i32* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %14, %13
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @eg_sc_table_get(i32 %0, i32 %1, i32* %2) {
%4 = icmp ugt i32 %1, 31
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @eg_indirect_table_get(i32 %0, i32 2, i32 %1, i32 4, i32* %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ -1, %3 ]
ret i32 %8
}
RX0I1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((p0[x0]) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<RX0I1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x21,%eax
jg     113f <RX0I1+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <RX0I1+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0I1>:
movslq %edx,%rcx
xor    %eax,%eax
cmpb   $0x22,(%r8,%rcx,1)
setb   %al
ret

LLVM IR (-O0):
define i32 @RX0I1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8*, i8** %12
%17 = load i32, i32* %10
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = icmp sle i32 %21, 33
br i1 %22, label %23, label %24
23: ; preds = %6
store i32 1, i32* %7
br label %25
24: ; preds = %6
store i32 0, i32* %7
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @RX0I1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = load i8, i8* %8
%10 = icmp ult i8 %9, 34
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
void *memcpy(void *, void const *, size_t);
void *memdup(const void *data, size_t length) {
  void *copy = malloc(length);
  if (!copy)
    abort();
  return memcpy(copy, data, length);
}


x86 assembly (clang, -O0):
<memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115f <memdup+0x2f>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rdi
mov    %rdi,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115c <memdup+0x2c>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @memdup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = load i64, i64* %4
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @memdup(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %3, i8* align 1 %0, i64 %1, i1 false)
ret i8* %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void SysCtlPeripheralPowerOn(uint32_t ui32Peripheral) {
  ;
  (*((volatile uint32_t
          *)(((uint32_t)(0x400fe900 + ((ui32Peripheral & 0xff00) >> 8)) &
              0xF0000000) |
             0x02000000 |
             (((uint32_t)(0x400fe900 + ((ui32Peripheral & 0xff00) >> 8)) &
               0x000FFFFF)
              << 5) |
             ((ui32Peripheral & 0xff) << 2)))) = 1;
}


x86 assembly (clang, -O0):
<SysCtlPeripheralPowerOn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
add    $0x400fe900,%eax
and    $0xf0000000,%eax
or     $0x2000000,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
add    $0x400fe900,%ecx
and    $0xfffff,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    %eax,%eax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlPeripheralPowerOn>:
movzbl %dil,%eax
shr    $0x3,%edi
and    $0x1fe0,%edi
shl    $0x2,%eax
or     %edi,%eax
movl   $0x1,0x43fd2000(%rax)
ret

LLVM IR (-O0):
define void @SysCtlPeripheralPowerOn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65280
%5 = ashr i32 %4, 8
%6 = add nsw i32 1074784512, %5
%7 = and i32 %6, -268435456
%8 = or i32 %7, 33554432
%9 = load i32, i32* %2
%10 = and i32 %9, 65280
%11 = ashr i32 %10, 8
%12 = add nsw i32 1074784512, %11
%13 = and i32 %12, 1048575
%14 = shl i32 %13, 5
%15 = or i32 %8, %14
%16 = load i32, i32* %2
%17 = and i32 %16, 255
%18 = shl i32 %17, 2
%19 = or i32 %15, %18
%20 = zext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
store volatile i32 1, i32* %21
ret void
}

LLVM IR (-O2):
define void @SysCtlPeripheralPowerOn(i32 %0) {
%2 = lshr i32 %0, 3
%3 = and i32 %2, 8160
%4 = shl i32 %0, 2
%5 = and i32 %4, 1020
%6 = or i32 %5, %3
%7 = or i32 %6, 1140662272
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 1, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main() {
  putc(350, stdout);
  putc('\n', stdout);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
mov    $0x5e,%edi
call   1030 <putc@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%esi
mov    $0x5e,%edi
call   1030 <putc@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = call i32 @putc(i8 signext 94, i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @putc(i8 signext 10, i32 %3)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @putc(i8 signext 94, i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @putc(i8 signext 10, i32 %3)
ret i32 0
}
/* Type definitions */
struct ibv_pd {
  int dummy;
};
struct ibv_context {
  int dummy;
};

/* Variables and functions */
struct ibv_pd *ibv_alloc_pd(struct ibv_context *);
struct ibv_pd *mlx4_glue_alloc_pd(struct ibv_context *context) {
  return ibv_alloc_pd(context);
}


x86 assembly (clang, -O0):
<mlx4_glue_alloc_pd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ibv_alloc_pd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlx4_glue_alloc_pd>:
jmp    1030 <ibv_alloc_pd@plt>

LLVM IR (-O0):
%struct.ibv_pd = type { i32 }
%struct.ibv_context = type { i32 }
define %struct.ibv_pd* @mlx4_glue_alloc_pd(%struct.ibv_context* %0) {
%2 = alloca %struct.ibv_context*
store %struct.ibv_context* %0, %struct.ibv_context** %2
%3 = load %struct.ibv_context*, %struct.ibv_context** %2
%4 = call %struct.ibv_pd* @ibv_alloc_pd(%struct.ibv_context* %3)
ret %struct.ibv_pd* %4
}

LLVM IR (-O2):
%struct.ibv_pd = type { i32 }
%struct.ibv_context = type { i32 }
define %struct.ibv_pd* @mlx4_glue_alloc_pd(%struct.ibv_context* %0) {
%2 = tail call %struct.ibv_pd* @ibv_alloc_pd(%struct.ibv_context* %0)
ret %struct.ibv_pd* %2
}
/* Variables and functions */
int /*<<< orphan*/ calc(unsigned int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int scanf(char *, unsigned int *);
int main() {
  unsigned int x;
  while (scanf("%u", &x) == 1)
    printf("%lld\n", calc(x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    1173 <main+0x43>
mov    -0x8(%rbp),%edi
call   1040 <calc@plt>
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    1193 <main+0x63>
lea    0xead(%rip),%r14
lea    0xea3(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0xc(%rsp),%edi
call   1040 <calc@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
je     1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %6, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @calc(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %3
10: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %11
5: ; preds = %0, %5
%6 = load i32, i32* %1
%7 = call i32 @calc(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = icmp eq i32 %9, 1
br i1 %10, label %5, label %11
11: ; preds = %5, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_setguardsize(int /*<<< orphan*/ *, size_t);
int my_pthread_attr_setguardsize(pthread_attr_t *__attr, size_t guard_size) {
  pthread_attr_t *realattr = (pthread_attr_t *)*(unsigned int *)__attr;
  return pthread_attr_setguardsize(realattr, guard_size);
}


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

x86 assembly (clang, -O2):
<my_pthread_attr_setguardsize>:
mov    (%rdi),%edi
jmp    1030 <pthread_attr_setguardsize@plt>

LLVM IR (-O0):
define i32 @my_pthread_attr_setguardsize(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32*
store i32* %0, i32** %3
store i64 %1, i64* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = load i64, i64* %4
%12 = call i32 @pthread_attr_setguardsize(i32* %10, i64 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @my_pthread_attr_setguardsize(i32* nocapture %0, i64 %1) {
%3 = load i32, i32* %0
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @pthread_attr_setguardsize(i32* %5, i64 %1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
int /*<<< orphan*/ stderr;
void error(const char *errinfo, int num) {
  fprintf(stderr, "%s:%d\n", errinfo, num);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s:%d\0A\00"
define void @error(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}