xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void UARTDMAEnable(uint32_t ui32Base, uint32_t ui32DMAFlags) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000048))) |= ui32DMAFlags;
}


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

x86 assembly (clang, -O2):
<UARTDMAEnable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
mov    -0x8(%rsp),%rcx
or     %rax,0x48(%rcx)
ret

LLVM IR (-O0):
define void @UARTDMAEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, 72
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @UARTDMAEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, 72
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void debug(char *debug) { printf("%s", debug); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @debug(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int __test() {
  int x = 0;
  int y = 0;
  if (x == 3) {
    y = 4;
  } else {
    y = 5;
  }
  return y;
}


x86 assembly (clang, -O0):
<__test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    1128 <__test+0x28>
movl   $0x4,-0x8(%rbp)
jmp    112f <__test+0x2f>
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__test() {
ret i32 5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct tcphdr {
  int /*<<< orphan*/ seq;
};

/* Variables and functions */
uint32_t tcphdr_seq(struct tcphdr *h) { return h->seq; }


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

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

LLVM IR (-O0):
%struct.tcphdr = type { i32 }
define i32 @tcphdr_seq(%struct.tcphdr* %0) {
%2 = alloca %struct.tcphdr*
store %struct.tcphdr* %0, %struct.tcphdr** %2
%3 = load %struct.tcphdr*, %struct.tcphdr** %2
%4 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.tcphdr = type { i32 }
define i32 @tcphdr_seq(%struct.tcphdr* nocapture %0) {
%2 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int ftruncate(int, int /*<<< orphan*/);
int do_truncate(int fd, off_t size) { return ftruncate(fd, size); }


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

x86 assembly (clang, -O2):
<do_truncate>:
jmp    1030 <ftruncate@plt>

LLVM IR (-O0):
define i32 @do_truncate(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 = load i32, i32* %4
%7 = call i32 @ftruncate(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @do_truncate(i32 %0, i32 %1) {
%3 = tail call i32 @ftruncate(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ putchar(char);
int main() {
  char c;
  while ((c = getchar()) != EOF) {
    putchar(c);
  }
  printf("%d\n", EOF);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2e95(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     116c <main+0x3c>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    113f <main+0xf>
lea    0xe8d(%rip),%rdi
mov    0x2e6e(%rip),%rax
movsbl (%rax),%esi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2ea9(%rip),%rbx
cmp    (%rbx),%al
je     1163 <main+0x33>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%al
jne    1150 <main+0x20>
movsbl %al,%esi
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i8 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i8 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i8 signext %5)
%7 = tail call signext i8 (...) @getchar()
%8 = load i8, i8* @EOF
%9 = icmp eq i8 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
%11 = phi i8 [ %1, %0 ], [ %7, %4 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %11)
ret i32 0
}
int ld_ne_cr2(long double a1) { return !(((100) != (a1))); }


x86 assembly (clang, -O0):
<ld_ne_cr2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fucomip %st(1),%st
fstp   %st(0)
setp   %cl
setne  %al
or     %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_ne_cr2>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
fucomip %st(1),%st
fstp   %st(0)
setnp  %al
sete   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ld_ne_cr2(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp une x86_fp80 0xK4005C800000000000000, %3
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ld_ne_cr2(x86_fp80 %0) {
%2 = fcmp oeq x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
void McASPSerializerRxSet(unsigned int baseAddr, unsigned int serNum) {
  (*((volatile unsigned int *)(baseAddr + (0x180 + (serNum * 4))))) &=
      ~(0x00000003u);
  (*((volatile unsigned int *)(baseAddr + (0x180 + (serNum * 4))))) |=
      (0x00000002u);
}


x86 assembly (clang, -O0):
<McASPSerializerRxSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
add    $0x180,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffffc,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
add    $0x180,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPSerializerRxSet>:
lea    (%rdi,%rsi,4),%eax
add    $0x180,%eax
andl   $0xfffffffc,(%rax)
orl    $0x2,(%rax)
ret

LLVM IR (-O0):
define void @McASPSerializerRxSet(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 = load i32, i32* %4
%7 = mul i32 %6, 4
%8 = add i32 384, %7
%9 = add i32 %5, %8
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = and i32 %12, -4
store volatile i32 %13, i32* %11
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = mul i32 %15, 4
%17 = add i32 384, %16
%18 = add i32 %14, %17
%19 = zext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
%21 = load volatile i32, i32* %20
%22 = or i32 %21, 2
store volatile i32 %22, i32* %20
ret void
}

LLVM IR (-O2):
define void @McASPSerializerRxSet(i32 %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = add i32 %0, 384
%5 = add i32 %4, %3
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, -4
store volatile i32 %9, i32* %7
%10 = load volatile i32, i32* %7
%11 = or i32 %10, 2
store volatile i32 %11, i32* %7
ret void
}
int foo(int number) {
  printf("foo %s %s",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/epatel/qt-mac-free-3.3.8/refs/heads/master/"
         "src/3rdparty/dlcompat/test/libfoo.c",
         6);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x6,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0xee9(%rip),%rdi
lea    0xeec(%rip),%rsi
mov    $0x6,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"foo %s %s\00"
@.str.1 = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/epatel/qt-mac-free-3.3.8/refs/heads/master/src/3rdparty/dlcompat/test/libfoo.c\00"
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.1, i64 0, i64 0), i32 6)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [10 x i8] c"foo %s %s\00"
@.str.1 = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/epatel/qt-mac-free-3.3.8/refs/heads/master/src/3rdparty/dlcompat/test/libfoo.c\00"
define i32 @foo(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.1, i64 0, i64 0), i32 6)
ret i32 undef
}
int cmp_int(const void *v1, const void *v2) {
  const int *i1 = (int *)v1;
  const int *i2 = (int *)v2;
  return *i1 == *i2 ? 0 : (*i1 < *i2 ? -1 : +1);
}


x86 assembly (clang, -O0):
<cmp_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
jne    1138 <cmp_int+0x38>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1156 <cmp_int+0x56>
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_int>:
mov    (%rdi),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%eax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp eq i32 %12, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %25
17: ; preds = %2
%18 = load i32*, i32** %5
%19 = load i32, i32* %18
%20 = load i32*, i32** %6
%21 = load i32, i32* %20
%22 = icmp slt i32 %19, %21
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 -1, i32 1
br label %25
25: ; preds = %17, %16
%26 = phi i32 [ 0, %16 ], [ %24, %17 ]
ret i32 %26
}

LLVM IR (-O2):
define i32 @cmp_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
%8 = icmp slt i32 %5, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Variables and functions */
int lcg_knuth_rand();
int xrand(void) { return lcg_knuth_rand(); }


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

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

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

LLVM IR (-O2):
define i32 @xrand() {
%1 = tail call i32 (...) @lcg_knuth_rand()
ret i32 %1
}
int assemble(struct token_purity_t *purity) {}


x86 assembly (clang, -O0):
<assemble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.token_purity_t = type opaque
define i32 @assemble(%struct.token_purity_t* %0) {
%2 = alloca i32
%3 = alloca %struct.token_purity_t*
store %struct.token_purity_t* %0, %struct.token_purity_t** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.token_purity_t = type opaque
define i32 @assemble(%struct.token_purity_t* nocapture readnone %0) {
ret i32 undef
}
void ff_h264dsp_init_aarch64() {}


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

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

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

LLVM IR (-O2):
define void @ff_h264dsp_init_aarch64() {
ret void
}
/* Variables and functions */
int open(char const *, int, int);
int ugene_custom_open2(const char *filename, int oflag, int pflag) {
  return open(filename, oflag, pflag);
}


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

x86 assembly (clang, -O2):
<ugene_custom_open2>:
jmp    1030 <open@plt>

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

LLVM IR (-O2):
define i32 @ugene_custom_open2(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
double unihrf(double, int, int);
double cooldown(double age) { return unihrf(age, 9, 11); }


x86 assembly (clang, -O0):
<cooldown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x9,%edi
mov    $0xb,%esi
call   1030 <unihrf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cooldown>:
mov    $0x9,%edi
mov    $0xb,%esi
jmp    1030 <unihrf@plt>

LLVM IR (-O0):
define double @cooldown(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @unihrf(double %3, i32 9, i32 11)
ret double %4
}

LLVM IR (-O2):
define double @cooldown(double %0) {
%2 = tail call double @unihrf(double %0, i32 9, i32 11)
ret double %2
}
__attribute__((always_)) int rcu_read_lock_held(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @rcu_read_lock_held() {
ret i32 1
}

LLVM IR (-O2):
define i32 @rcu_read_lock_held() {
ret i32 1
}
int next_power_of_two(int n) {
  n--;
  n |= n >> 1;
  n |= n >> 2;
  n |= n >> 4;
  n |= n >> 8;
  n |= n >> 16;
  return ++n;
}


x86 assembly (clang, -O0):
<next_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_power_of_two>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @next_power_of_two(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @next_power_of_two(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}
OP(fd, b7) {
  illegal_1();
  op_b7();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_b7@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_b7@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_b7()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_b7()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ iconv_t;

/* Variables and functions */
int iconv_close(int /*<<< orphan*/);
int portable_iconv_close(void *cd) { return iconv_close((iconv_t)cd); }


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

x86 assembly (clang, -O2):
<portable_iconv_close>:
jmp    1030 <iconv_close@plt>

LLVM IR (-O0):
define i32 @portable_iconv_close(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = call i32 @iconv_close(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @portable_iconv_close(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @iconv_close(i32 %3)
ret i32 %4
}
/* Type definitions */
struct cl_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cl_node_key(struct cl_node *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void cl_node_debug(struct cl_node *n, const char *name) {
  fprintf(stderr, "%8s  key=%p\n", name, cl_node_key(n));
}


x86 assembly (clang, -O0):
<cl_node_debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <cl_node_key@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
lea    0xea3(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cl_node_debug>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
call   1030 <cl_node_key@plt>
lea    0xec5(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fprintf@plt>

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

LLVM IR (-O2):
%struct.cl_node = type { i32 }
@stderr = global i32 0
@.str = [13 x i8] c"%8s key=%p\0A\00"
define void @cl_node_debug(%struct.cl_node* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @cl_node_key(%struct.cl_node* %0)
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %4)
ret void
}
int test_imm_95int8_mem(signed char *val) {
  return ((*val) & (-0x95 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_95int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff6b,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_95int8_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, -149
%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_95int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -149
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *);
char *smartworkcmd(const char *path, char *cmdresult) {
  sprintf(cmdresult,
          "disktool -i %s | grep 'SMART support is' | cut -f 2 -d ':' "
          "1>/dev/null 2>/dev/null",
          path);
  return cmdresult;
}


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

x86 assembly (clang, -O2):
<smartworkcmd>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rdx
lea    0xee2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [83 x i8] c"disktool -i %s | grep 'SMART support is' | cut -f 2 -d ':' 1>/dev/null 2>/dev/null\00"
define i8* @smartworkcmd(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %4
ret i8* %8
}

LLVM IR (-O2):
@.str = [83 x i8] c"disktool -i %s | grep 'SMART support is' | cut -f 2 -d ':' 1>/dev/null 2>/dev/null\00"
define i8* @smartworkcmd(i8* %0, i8* returned writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %1
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int ldsb_p(const void *ptr) { return *(int8_t *)ptr; }


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

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

LLVM IR (-O0):
define i32 @ldsb_p(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @ldsb_p(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
void SPUsetPitch(unsigned char ch, unsigned short pitch) {}


x86 assembly (clang, -O0):
<SPUsetPitch>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @SPUsetPitch(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
ret void
}

LLVM IR (-O2):
define void @SPUsetPitch(i8 zeroext %0, i16 zeroext %1) {
ret void
}
int mySqrt(x) {
  if (x == 0)
    return 0;
  double tmp = 0;
  double y = 1;
  while (y != tmp) {
    tmp = y;
    y = (y + x / y) / 2;
  }
  return (int)y;
}


x86 assembly (clang, -O0):
<mySqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <mySqrt+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1188 <mySqrt+0x88>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed3(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    114d <mySqrt+0x4d>
jp     114d <mySqrt+0x4d>
jmp    1180 <mySqrt+0x80>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe96(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1132 <mySqrt+0x32>
cvttsd2si -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mySqrt>:
test   %edi,%edi
je     1141 <mySqrt+0x41>
cvtsi2sd %edi,%xmm0
movsd  0xef0(%rip),%xmm1
movsd  0xef0(%rip),%xmm2
nopl   0x0(%rax,%rax,1)
movapd %xmm1,%xmm3
movapd %xmm0,%xmm1
divsd  %xmm3,%xmm1
addsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm1
ucomisd %xmm3,%xmm1
jne    1120 <mySqrt+0x20>
jp     1120 <mySqrt+0x20>
cvttsd2si %xmm1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @mySqrt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %26
9: ; preds = %1
store double 0.000000e+00, double* %4
store double 1.000000e+00, double* %5
br label %10
10: ; preds = %14, %9
%11 = load double, double* %5
%12 = load double, double* %4
%13 = fcmp une double %11, %12
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = load double, double* %5
store double %15, double* %4
%16 = load double, double* %5
%17 = load i32, i32* %3
%18 = sitofp i32 %17 to double
%19 = load double, double* %5
%20 = fdiv double %18, %19
%21 = fadd double %16, %20
%22 = fdiv double %21, 2.000000e+00
store double %22, double* %5
br label %10
23: ; preds = %10
%24 = load double, double* %5
%25 = fptosi double %24 to i32
store i32 %25, i32* %2
br label %26
26: ; preds = %23, %8
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @mySqrt(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = sitofp i32 %0 to double
br label %5
5: ; preds = %3, %5
%6 = phi double [ 1.000000e+00, %3 ], [ %9, %5 ]
%7 = fdiv double %4, %6
%8 = fadd double %6, %7
%9 = fmul double %8, 5.000000e-01
%10 = fcmp une double %9, %6
br i1 %10, label %5, label %11
11: ; preds = %5
%12 = fptosi double %9 to i32
br label %13
13: ; preds = %1, %11
%14 = phi i32 [ %12, %11 ], [ 0, %1 ]
ret i32 %14
}
/* Type definitions */
struct DynArr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
char getDynArr(struct DynArr *, int /*<<< orphan*/);
scalar_t__ sizeDynArr(struct DynArr *);
char HeapGetFirst(struct DynArr *heap) {
  assert(sizeDynArr(heap) > 0);
  return getDynArr(heap, 0);
}


x86 assembly (clang, -O0):
<HeapGetFirst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sizeDynArr@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1050 <getDynArr@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HeapGetFirst>:
push   %rbx
mov    %rdi,%rbx
call   1030 <sizeDynArr@plt>
xor    %edi,%edi
test   %rax,%rax
setg   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1050 <getDynArr@plt>

LLVM IR (-O0):
%struct.DynArr = type { i32 }
define signext i8 @HeapGetFirst(%struct.DynArr* %0) {
%2 = alloca %struct.DynArr*
store %struct.DynArr* %0, %struct.DynArr** %2
%3 = load %struct.DynArr*, %struct.DynArr** %2
%4 = call i64 @sizeDynArr(%struct.DynArr* %3)
%5 = icmp sgt i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load %struct.DynArr*, %struct.DynArr** %2
%9 = call signext i8 @getDynArr(%struct.DynArr* %8, i32 0)
ret i8 %9
}

LLVM IR (-O2):
%struct.DynArr = type { i32 }
define signext i8 @HeapGetFirst(%struct.DynArr* %0) {
%2 = tail call i64 @sizeDynArr(%struct.DynArr* %0)
%3 = icmp sgt i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call signext i8 @getDynArr(%struct.DynArr* %0, i32 0)
ret i8 %6
}
long long mixed_mul(double a, long long b) { return a * b; }


x86 assembly (clang, -O0):
<mixed_mul>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixed_mul>:
cvtsi2sd %rdi,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rax
ret

LLVM IR (-O0):
define i64 @mixed_mul(double %0, i64 %1) {
%3 = alloca double
%4 = alloca i64
store double %0, double* %3
store i64 %1, i64* %4
%5 = load double, double* %3
%6 = load i64, i64* %4
%7 = sitofp i64 %6 to double
%8 = fmul double %5, %7
%9 = fptosi double %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @mixed_mul(double %0, i64 %1) {
%3 = sitofp i64 %1 to double
%4 = fmul double %3, %0
%5 = fptosi double %4 to i64
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
int mutex_trylock(int /*<<< orphan*/ *);
int pthread_mutex_trylock(pthread_mutex_t *mutex) {
  assert(mutex);
  return mutex_trylock(mutex);
}


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

x86 assembly (clang, -O2):
<pthread_mutex_trylock>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <mutex_trylock@plt>

LLVM IR (-O0):
define i32 @pthread_mutex_trylock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @assert(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @mutex_trylock(i32* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @pthread_mutex_trylock(i32* %0) {
%2 = tail call i32 @assert(i32* %0)
%3 = tail call i32 @mutex_trylock(i32* %0)
ret i32 %3
}
int main(int args, char **argv) {}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void print_options(void) {
  (void)fprintf(
      stdout, "Commands:\n  1) write secret\n  2) read secret\n  3) logout\n");
  (void)fprintf(stdout, "Please select a command (1-3):\n");
}


x86 assembly (clang, -O0):
<print_options>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xf01(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_options>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf0b(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [58 x i8] c"Commands:\0A 1) write secret\0A 2) read secret\0A 3) logout\0A\00"
@.str.1 = [32 x i8] c"Please select a command (1-3):\0A\00"
define void @print_options() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [58 x i8] c"Commands:\0A 1) write secret\0A 2) read secret\0A 3) logout\0A\00"
@.str.1 = [32 x i8] c"Please select a command (1-3):\0A\00"
define void @print_options() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ expression();
int /*<<< orphan*/ match(char);
int /*<<< orphan*/ popCompare();
int /*<<< orphan*/ setNEqual();
void notEquals() {
  match('>');
  expression();
  popCompare();
  setNEqual();
}


x86 assembly (clang, -O0):
<notEquals>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e,%edi
call   1060 <match@plt>
mov    $0x0,%al
call   1050 <expression@plt>
mov    $0x0,%al
call   1040 <popCompare@plt>
mov    $0x0,%al
call   1030 <setNEqual@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<notEquals>:
push   %rax
mov    $0x3e,%edi
call   1060 <match@plt>
xor    %eax,%eax
call   1050 <expression@plt>
xor    %eax,%eax
call   1040 <popCompare@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <setNEqual@plt>

LLVM IR (-O0):
define void @notEquals() {
%1 = call i32 @match(i8 signext 62)
%2 = call i32 (...) @expression()
%3 = call i32 (...) @popCompare()
%4 = call i32 (...) @setNEqual()
ret void
}

LLVM IR (-O2):
define void @notEquals() {
%1 = tail call i32 @match(i8 signext 62)
%2 = tail call i32 (...) @expression()
%3 = tail call i32 (...) @popCompare()
%4 = tail call i32 (...) @setNEqual()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int students;
  int *studentsp;
  students = 12;
  studentsp = &students;
  *studentsp = 17;
  printf("students:  %d\n", students);
  printf("studentsp: %p\n", studentsp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x11,(%rax)
mov    -0x8(%rbp),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x11,0x4(%rsp)
lea    0xee0(%rip),%rdi
mov    $0x11,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"students: %d\0A\00"
@.str.1 = [15 x i8] c"studentsp: %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 12, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
store i32 17, i32* %4
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32*, i32** %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"students: %d\0A\00"
@.str.1 = [15 x i8] c"studentsp: %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 17, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 17)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret i32 0
}
void mtcp_abort(void) {
  asm volatile("hlt; xor %rax, %rax; mov (%rax), %rax");
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<mtcp_abort>:
push   %rbp
mov    %rsp,%rbp
hlt
xor    %rax,%rax
mov    (%rax),%rax
jmp    110b <mtcp_abort+0xb>

x86 assembly (clang, -O2):
<mtcp_abort>:
hlt
xor    %rax,%rax
mov    (%rax),%rax
nopw   0x0(%rax,%rax,1)
jmp    1110 <mtcp_abort+0x10>

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

LLVM IR (-O2):
define void @mtcp_abort() {
tail call void asm sideeffect "hlt; xor %rax, %rax; mov (%rax), %rax", "~{dirflag},~{fpsr},~{flags}"()
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ ledit_alloc_line_buffer();
int /*<<< orphan*/ ledit_create_initial_nodes();
int /*<<< orphan*/ ledit_open_temp();
void ledit_init() {
  ledit_open_temp();
  ledit_create_initial_nodes();
  ledit_alloc_line_buffer();
}


x86 assembly (clang, -O0):
<ledit_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ledit_open_temp@plt>
mov    $0x0,%al
call   1050 <ledit_create_initial_nodes@plt>
mov    $0x0,%al
call   1030 <ledit_alloc_line_buffer@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ledit_init>:
push   %rax
xor    %eax,%eax
call   1040 <ledit_open_temp@plt>
xor    %eax,%eax
call   1050 <ledit_create_initial_nodes@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ledit_alloc_line_buffer@plt>

LLVM IR (-O0):
define void @ledit_init() {
%1 = call i32 (...) @ledit_open_temp()
%2 = call i32 (...) @ledit_create_initial_nodes()
%3 = call i32 (...) @ledit_alloc_line_buffer()
ret void
}

LLVM IR (-O2):
define void @ledit_init() {
%1 = tail call i32 (...) @ledit_open_temp()
%2 = tail call i32 (...) @ledit_create_initial_nodes()
%3 = tail call i32 (...) @ledit_alloc_line_buffer()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mgrSendMessageToSndModule(int, char *, int /*<<< orphan*/ *);
int mgrVolumeUp(int code, void *arg1, void *arg2) {
  ;
  mgrSendMessageToSndModule((8006), "/audio_out/volume/up", NULL);
  return 0;
}


x86 assembly (clang, -O0):
<mgrVolumeUp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1f46,%edi
lea    0xed1(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <mgrSendMessageToSndModule@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgrVolumeUp>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1f46,%edi
xor    %edx,%edx
call   1030 <mgrSendMessageToSndModule@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"/audio_out/volume/up\00"
define i32 @mgrVolumeUp(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @mgrSendMessageToSndModule(i32 8006, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"/audio_out/volume/up\00"
define i32 @mgrVolumeUp(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @mgrSendMessageToSndModule(i32 8006, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x33() {
  Assert_real((isalnum(51)),
              "/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/ctype/test_isalnum.c",
              260, ("isalnum should be 1 for 3"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x33>:
push   %rbp
mov    %rsp,%rbp
mov    $0x33,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x104,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x33>:
push   %rax
mov    $0x33,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x104,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for 3\00"
define void @t_isalnum_0x33() {
%1 = call i32 @isalnum(i32 51)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 260, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for 3\00"
define void @t_isalnum_0x33() {
%1 = tail call i32 @isalnum(i32 51)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 260, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int c(int temp) {
  temp++;
  printf("%s(0): %p\n", __func__, __builtin_return_address(0));
  a(123);
  return temp;
}


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    0x8(%rbp),%rdx
lea    0xec1(%rip),%rdi
lea    0xec5(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x7b,%edi
mov    $0x0,%al
call   1040 <a@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
push   %rbx
lea    0x1(%rdi),%ebx
mov    0x8(%rsp),%rdx
lea    0xed0(%rip),%rdi
lea    0xed4(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x7b,%edi
xor    %eax,%eax
call   1040 <a@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%s(0): %p\0A\00"
@__func__.c = [2 x i8] c"c\00"
define i32 @c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = call i8* @llvm.returnaddress(i32 0)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @__func__.c, i64 0, i64 0), i8* %5)
%7 = call i32 (i32, ...) bitcast (i32 (...)* @a to i32 (i32, ...)*)(i32 123)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s(0): %p\0A\00"
@__func__.c = [2 x i8] c"c\00"
define i32 @c(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i8* @llvm.returnaddress(i32 0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @__func__.c, i64 0, i64 0), i8* %3)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @a to i32 (i32, ...)*)(i32 123)
ret i32 %2
}
/* Variables and functions */
char *lefttrim(char *, char);
char *ltrimsp(char *str) { return lefttrim(str, ' '); }


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

x86 assembly (clang, -O2):
<ltrimsp>:
mov    $0x20,%esi
jmp    1030 <lefttrim@plt>

LLVM IR (-O0):
define i8* @ltrimsp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @lefttrim(i8* %3, i8 signext 32)
ret i8* %4
}

LLVM IR (-O2):
define i8* @ltrimsp(i8* %0) {
%2 = tail call i8* @lefttrim(i8* %0, i8 signext 32)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int k;
  int l;
  scanf("%d", &k);
  l = k;
  printf("%d\n", l * 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
shl    $0x1,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
add    %esi,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\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 = load i32, i32* %1
%5 = shl nsw i32 %4, 1
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
void problem_output() {}


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

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

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

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