xunge/DecIR huggingface dataset:
/* Variables and functions */
int serialDataAvail(int);
int /*<<< orphan*/ usleep(int);
int serialDataBlock(int fd, int count) {
  int ret;
  while ((ret = serialDataAvail(fd)) < count) {
    if (ret < 0)
      return -1;
    usleep(5);
  }
  return 1;
}


x86 assembly (clang, -O0):
<serialDataBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <serialDataAvail@plt>
mov    %eax,-0x10(%rbp)
cmp    -0xc(%rbp),%eax
jge    1167 <serialDataBlock+0x47>
cmpl   $0x0,-0x10(%rbp)
jge    1158 <serialDataBlock+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <serialDataBlock+0x4e>
mov    $0x5,%edi
call   1040 <usleep@plt>
jmp    112e <serialDataBlock+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialDataBlock>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <serialDataAvail@plt>
mov    $0x1,%r14d
cmp    %ebp,%eax
jge    1161 <serialDataBlock+0x41>
nopw   0x0(%rax,%rax,1)
test   %eax,%eax
js     115b <serialDataBlock+0x3b>
mov    $0x5,%edi
call   1040 <usleep@plt>
mov    %ebx,%edi
call   1030 <serialDataAvail@plt>
cmp    %ebp,%eax
jl     1140 <serialDataBlock+0x20>
jmp    1161 <serialDataBlock+0x41>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @serialDataBlock(i32 %0, i32 %1) {
%3 = tail call i32 @serialDataAvail(i32 %0)
%4 = icmp slt i32 %3, %1
br i1 %4, label %5, label %12
5: ; preds = %2, %8
%6 = phi i32 [ %10, %8 ], [ %3, %2 ]
%7 = icmp slt i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = tail call i32 @usleep(i32 5)
%10 = tail call i32 @serialDataAvail(i32 %0)
%11 = icmp slt i32 %10, %1
br i1 %11, label %5, label %12
12: ; preds = %5, %8, %2
%13 = phi i32 [ 1, %2 ], [ 1, %8 ], [ -1, %5 ]
ret i32 %13
}
float floorf(float x) { return __builtin_floorf(x); }


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

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

LLVM IR (-O0):
define float @floorf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.floor.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @floorf(float %0) {
%2 = tail call float @llvm.floor.f32(float %0)
ret float %2
}
int system_ncpus(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @system_ncpus() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xcf() {
  Assert_real((iscntrl(207) == 0),
              "/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_iscntrl.c",
              1040, ("iscntrl should be 0 for 0xcf"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0xcf>:
push   %rbp
mov    %rsp,%rbp
mov    $0xcf,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x410,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0xcf>:
push   %rax
mov    $0xcf,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x410,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xcf\00"
define void @t_iscntrl_0xcf() {
%1 = call i64 @iscntrl(i32 207)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1040, i8* getelementptr inbounds ([29 x i8], [29 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xcf\00"
define void @t_iscntrl_0xcf() {
%1 = tail call i64 @iscntrl(i32 207)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1040, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
scalar_t__ get16(int /*<<< orphan*/ **);
uint32_t get32(uint8_t **ppv) {
  uint32_t l;
  l = (((uint32_t)get16(ppv)) << 16) | (uint32_t)get16(ppv);
  return l;
}


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

x86 assembly (clang, -O2):
<get32>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <get16@plt>
mov    %rax,%rbx
shl    $0x10,%ebx
mov    %r14,%rdi
call   1030 <get16@plt>
or     %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @get32(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = call i64 @get16(i32** %4)
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 16
%8 = load i32**, i32*** %2
%9 = call i64 @get16(i32** %8)
%10 = trunc i64 %9 to i32
%11 = or i32 %7, %10
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @get32(i32** %0) {
%2 = tail call i64 @get16(i32** %0)
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 16
%5 = tail call i64 @get16(i32** %0)
%6 = trunc i64 %5 to i32
%7 = or i32 %4, %6
ret i32 %7
}
int xmvsprintf_skip_atoi(const char **s) {
  int i = 0;
  while (((**s) >= '0' && (**s) <= '9'))
    i = i * 10 + *((*s)++) - '0';
  return i;
}


x86 assembly (clang, -O0):
<xmvsprintf_skip_atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
jl     113a <xmvsprintf_skip_atoi+0x3a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114a <xmvsprintf_skip_atoi+0x4a>
jmp    116f <xmvsprintf_skip_atoi+0x6f>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
movsbl (%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <xmvsprintf_skip_atoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmvsprintf_skip_atoi>:
mov    (%rdi),%rcx
mov    (%rcx),%dl
add    $0xd0,%dl
xor    %eax,%eax
cmp    $0x9,%dl
ja     113f <xmvsprintf_skip_atoi+0x3f>
add    $0x1,%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%rax,%rax,4),%eax
mov    %rcx,(%rdi)
movsbl -0x1(%rcx),%edx
lea    (%rdx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rcx),%edx
add    $0xd0,%dl
add    $0x1,%rcx
cmp    $0xa,%dl
jb     1120 <xmvsprintf_skip_atoi+0x20>
ret

LLVM IR (-O0):
define i32 @xmvsprintf_skip_atoi(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 48
br i1 %9, label %10, label %16
10: ; preds = %4
%11 = load i8**, i8*** %2
%12 = load i8*, i8** %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp sle i32 %14, 57
br label %16
16: ; preds = %10, %4
%17 = phi i1 [ false, %4 ], [ %15, %10 ]
br i1 %17, label %18, label %28
18: ; preds = %16
%19 = load i32, i32* %3
%20 = mul nsw i32 %19, 10
%21 = load i8**, i8*** %2
%22 = load i8*, i8** %21
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %21
%24 = load i8, i8* %22
%25 = sext i8 %24 to i32
%26 = add nsw i32 %20, %25
%27 = sub nsw i32 %26, 48
store i32 %27, i32* %3
br label %4
28: ; preds = %16
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @xmvsprintf_skip_atoi(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %18
6: ; preds = %1, %6
%7 = phi i8* [ %10, %6 ], [ %2, %1 ]
%8 = phi i32 [ %14, %6 ], [ 0, %1 ]
%9 = mul nsw i32 %8, 10
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %10, i8** %0
%11 = load i8, i8* %7
%12 = sext i8 %11 to i32
%13 = add i32 %9, -48
%14 = add i32 %13, %12
%15 = load i8, i8* %10
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %6, label %18
18: ; preds = %6, %1
%19 = phi i32 [ 0, %1 ], [ %14, %6 ]
ret i32 %19
}
char *last_token(char *string, char tok) {
  while (*string == tok)
    string++;
  return string;
}


x86 assembly (clang, -O0):
<last_token>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1132 <last_token+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <last_token+0xe>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_token>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
mov    %rax,%rcx
add    $0x1,%rax
cmp    %sil,0x1(%rcx)
je     1110 <last_token+0x10>
ret

LLVM IR (-O0):
define i8* @last_token(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
br label %5
5: ; preds = %12, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %8, %10
br i1 %11, label %12, label %15
12: ; preds = %5
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
br label %5
15: ; preds = %5
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @last_token(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, %1
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %3, label %8
8: ; preds = %3
ret i8* %4
}
void BSP_UnlockBfg(void) {
  *(volatile unsigned long *)0x02620038 = 0x83e70b13;
  *(volatile unsigned long *)0x0262003c = 0x95a4f1e0;
}


x86 assembly (clang, -O0):
<BSP_UnlockBfg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2620038,%eax
mov    $0x83e70b13,%ecx
mov    %rcx,(%rax)
mov    $0x262003c,%eax
mov    $0x95a4f1e0,%ecx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_UnlockBfg>:
mov    $0x83e70b13,%eax
mov    %rax,0x2620038
02
add    $0x11bde6cd,%rax
mov    %rax,0x262003c
02
ret

LLVM IR (-O0):
define void @BSP_UnlockBfg() {
store volatile i64 2212956947, i64* inttoptr (i64 39977016 to i64*)
store volatile i64 2510615008, i64* inttoptr (i64 39977020 to i64*)
ret void
}

LLVM IR (-O2):
define void @BSP_UnlockBfg() {
store volatile i64 2212956947, i64* inttoptr (i64 39977016 to i64*)
store volatile i64 2510615008, i64* inttoptr (i64 39977020 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *malloc(size_t);
void *ba_alloc(size_t size) {
  void *ptr = malloc(size + sizeof(size_t));
  assert(ptr != NULL);
  *((size_t *)ptr) = size;
  return (void *)ptr + sizeof(size_t);
}


x86 assembly (clang, -O0):
<ba_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ba_alloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
add    $0x8,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %r14,(%rbx)
add    $0x8,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ba_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = add i64 %4, 8
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i64, i64* %2
%12 = load i8*, i8** %3
%13 = bitcast i8* %12 to i64*
store i64 %11, i64* %13
%14 = load i8*, i8** %3
%15 = getelementptr i8, i8* %14, i64 8
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @ba_alloc(i64 %0) {
%2 = add i64 %0, 8
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = bitcast i8* %3 to i64*
store i64 %0, i64* %7
%8 = getelementptr i8, i8* %3, i64 8
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ f1();
int /*<<< orphan*/ f2();
int main(int argc, char *argv[], char *env[]) {
  f1();
  f2();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <f1@plt>
mov    $0x0,%al
call   1030 <f2@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f1@plt>
xor    %eax,%eax
call   1030 <f2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 (...) @f1()
%9 = call i32 (...) @f2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 (...) @f1()
%5 = tail call i32 (...) @f2()
ret i32 0
}
void __attribute__((weak)) start_timer() {}


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

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

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

LLVM IR (-O2):
define weak void @start_timer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x60() {
  Assert_real((isprint(96)),
              "/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_isprint.c",
              485, ("isprint should be 1 for `"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x60>:
push   %rax
mov    $0x60,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1e5,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for `\00"
define void @t_isprint_0x60() {
%1 = call i32 @isprint(i32 96)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 485, 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for `\00"
define void @t_isprint_0x60() {
%1 = tail call i32 @isprint(i32 96)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 485, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned long getreg(unsigned long addr) {
  return *((volatile unsigned char *)addr);
}


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

x86 assembly (clang, -O2):
<getreg>:
movzbl (%rdi),%eax
ret

LLVM IR (-O0):
define i64 @getreg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
%5 = load volatile i8, i8* %4
%6 = zext i8 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @getreg(i64 %0) {
%2 = inttoptr i64 %0 to i8*
%3 = load volatile i8, i8* %2
%4 = zext i8 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, int, char *);
void listenner(int cid, char *from, int from_size, int *port, char *buffer,
               unsigned int buffer_size_returned) {
  if (buffer && buffer_size_returned)
    printf("<%s[%d]:%d>%s\n", from, *port, cid, buffer);
}


x86 assembly (clang, -O0):
<listenner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1160 <listenner+0x50>
cmpl   $0x0,-0x2c(%rbp)
je     1160 <listenner+0x50>
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
mov    -0x4(%rbp),%ecx
mov    -0x28(%rbp),%r8
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listenner>:
test   %r8,%r8
je     112c <listenner+0x1c>
test   %r9d,%r9d
je     112c <listenner+0x1c>
mov    %edi,%eax
mov    (%rcx),%edx
lea    0xedb(%rip),%rdi
mov    %eax,%ecx
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [15 x i8] c"<%s[%d]:%d>%s\0A\00"
define void @listenner(i32 %0, i8* %1, i32 %2, i32* %3, i8* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i32
store i32 %0, i32* %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32* %3, i32** %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%13 = load i8*, i8** %11
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %25
15: ; preds = %6
%16 = load i32, i32* %12
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %25
18: ; preds = %15
%19 = load i8*, i8** %8
%20 = load i32*, i32** %10
%21 = load i32, i32* %20
%22 = load i32, i32* %7
%23 = load i8*, i8** %11
%24 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %19, i32 %21, i32 %22, i8* %23)
br label %25
25: ; preds = %18, %15, %6
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"<%s[%d]:%d>%s\0A\00"
define void @listenner(i32 %0, i8* %1, i32 %2, i32* nocapture %3, i8* %4, i32 %5) {
%7 = icmp ne i8* %4, null
%8 = icmp ne i32 %5, 0
%9 = and i1 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i32, i32* %3
%12 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %11, i32 %0, i8* %4)
br label %13
13: ; preds = %10, %6
ret void
}
/* Type definitions */
struct utmp {
  int ut_type;
};

/* Variables and functions */
int DEAD_PROCESS;
int USER_PROCESS;
int main(void) {
  struct utmp ut;
  ut.ut_type = USER_PROCESS | DEAD_PROCESS;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%eax
mov    0x2ebd(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.utmp = type { i32 }
@USER_PROCESS = global i32 0
@DEAD_PROCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.utmp
store i32 0, i32* %1
%3 = load i32, i32* @USER_PROCESS
%4 = load i32, i32* @DEAD_PROCESS
%5 = or i32 %3, %4
%6 = getelementptr inbounds %struct.utmp, %struct.utmp* %2, i32 0, i32 0
store i32 %5, i32* %6
ret i32 0
}

LLVM IR (-O2):
@USER_PROCESS = global i32 0
@DEAD_PROCESS = global i32 0
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct bnode {
  int dummy;
};

/* Variables and functions */
int height(struct bnode *);
int /*<<< orphan*/ print_level(struct bnode *, int);
void bst_print_level_order(struct bnode *x, int level) {
  int i;
  int h = height(x);
  for (i = 1; i <= h; i++)
    print_level(x, i);
}


x86 assembly (clang, -O0):
<bst_print_level_order>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <height@plt>
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1168 <bst_print_level_order+0x48>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <print_level@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1142 <bst_print_level_order+0x22>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bst_print_level_order>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <height@plt>
test   %eax,%eax
jle    115d <bst_print_level_order+0x3d>
mov    %eax,%r15d
neg    %r15d
mov    $0x1,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <print_level@plt>
lea    (%r15,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1140 <bst_print_level_order+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.bnode = type { i32 }
define void @bst_print_level_order(%struct.bnode* %0, i32 %1) {
%3 = alloca %struct.bnode*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.bnode* %0, %struct.bnode** %3
store i32 %1, i32* %4
%7 = load %struct.bnode*, %struct.bnode** %3
%8 = call i32 @height(%struct.bnode* %7)
store i32 %8, i32* %6
store i32 1, i32* %5
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %20
13: ; preds = %9
%14 = load %struct.bnode*, %struct.bnode** %3
%15 = load i32, i32* %5
%16 = call i32 @print_level(%struct.bnode* %14, i32 %15)
br label %17
17: ; preds = %13
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %9
20: ; preds = %9
ret void
}

LLVM IR (-O2):
%struct.bnode = type { i32 }
define void @bst_print_level_order(%struct.bnode* %0, i32 %1) {
%3 = tail call i32 @height(%struct.bnode* %0)
%4 = icmp slt i32 %3, 1
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 1, %2 ]
%7 = tail call i32 @print_level(%struct.bnode* %0, i32 %6)
%8 = add nuw i32 %6, 1
%9 = icmp eq i32 %6, %3
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret void
}
/* Variables and functions */
size_t gotcha_strlen(const char *s) {
  size_t i;
  for (i = 0; s[i]; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<gotcha_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1138 <gotcha_strlen+0x38>
jmp    1127 <gotcha_strlen+0x27>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <gotcha_strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotcha_strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <gotcha_strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @gotcha_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
int test_imm_51uint16_mem(unsigned short *val) {
  return ((*val) & (0x51 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_51uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 81
%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_51uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 81
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int portaudio_get_current_pos(struct audiotap *audiotap) { return -1; }


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

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

LLVM IR (-O0):
%struct.audiotap = type opaque
define i32 @portaudio_get_current_pos(%struct.audiotap* %0) {
%2 = alloca %struct.audiotap*
store %struct.audiotap* %0, %struct.audiotap** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.audiotap = type opaque
define i32 @portaudio_get_current_pos(%struct.audiotap* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *, char const *);
void _log(const char *tag, const char *src, const char *msg) {
  printf("[%s] %s: %s\n", tag, src, msg);
}


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

x86 assembly (clang, -O2):
<_log>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"[%s] %s: %s\0A\00"
define void @_log(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"[%s] %s: %s\0A\00"
define void @_log(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
ret void
}
int fives(int n) {
  int count = 0;
  while (n % 5 == 0) {
    count++;
    n /= 5;
  }
  return count;
}


x86 assembly (clang, -O0):
<fives>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113e <fives+0x3e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <fives+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fives>:
imul   $0xcccccccd,%edi,%ecx
add    $0x19999999,%ecx
xor    %eax,%eax
cmp    $0x33333332,%ecx
ja     114e <fives+0x4e>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rdi
add    %ecx,%edi
imul   $0xcccccccd,%edi,%ecx
add    $0x19999999,%ecx
cmp    $0x33333333,%ecx
jb     1120 <fives+0x20>
ret

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

LLVM IR (-O2):
define i32 @fives(i32 %0) {
%2 = srem i32 %0, 5
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i32 [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = sdiv i32 %6, 5
%9 = srem i32 %8, 5
%10 = icmp eq i32 %9, 0
br i1 %10, label %4, label %11
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void error_system(const char *msg) {
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<error_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_system>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @error_system(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @error_system(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct i8x_object {
  int dummy;
};
struct i8x_funcref {
  int dummy;
};

/* Variables and functions */
scalar_t__ i8x_ob_unref(struct i8x_object *);
struct i8x_funcref *__attribute__((always_))
i8x_funcref_unref(struct i8x_funcref *x) {
  return (struct i8x_funcref *)i8x_ob_unref((struct i8x_object *)x);
}


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

x86 assembly (clang, -O2):
<i8x_funcref_unref>:
jmp    1030 <i8x_ob_unref@plt>

LLVM IR (-O0):
%struct.i8x_funcref = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_funcref* @i8x_funcref_unref(%struct.i8x_funcref* %0) {
%2 = alloca %struct.i8x_funcref*
store %struct.i8x_funcref* %0, %struct.i8x_funcref** %2
%3 = load %struct.i8x_funcref*, %struct.i8x_funcref** %2
%4 = bitcast %struct.i8x_funcref* %3 to %struct.i8x_object*
%5 = call i64 @i8x_ob_unref(%struct.i8x_object* %4)
%6 = inttoptr i64 %5 to %struct.i8x_funcref*
ret %struct.i8x_funcref* %6
}

LLVM IR (-O2):
%struct.i8x_funcref = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_funcref* @i8x_funcref_unref(%struct.i8x_funcref* %0) {
%2 = bitcast %struct.i8x_funcref* %0 to %struct.i8x_object*
%3 = tail call i64 @i8x_ob_unref(%struct.i8x_object* %2)
%4 = inttoptr i64 %3 to %struct.i8x_funcref*
ret %struct.i8x_funcref* %4
}
int test_imm_9Buint8_reg(unsigned char val) {
  return ((val) & (0x9B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Buint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x9b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Buint8_reg>:
test   $0x9b,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Buint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -101
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int thirdBits(void) {
  int x = 0x24;
  x += x << 6;
  x += x << 12;
  x += x << 24;
  return (x << 1) + 1;
}


x86 assembly (clang, -O0):
<thirdBits>:
push   %rbp
mov    %rsp,%rbp
movl   $0x24,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x6,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xc,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @thirdBits() {
%1 = alloca i32
store i32 36, i32* %1
%2 = load i32, i32* %1
%3 = shl i32 %2, 6
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %3
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = shl i32 %6, 12
%8 = load i32, i32* %1
%9 = add nsw i32 %8, %7
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = shl i32 %10, 24
%12 = load i32, i32* %1
%13 = add nsw i32 %12, %11
store i32 %13, i32* %1
%14 = load i32, i32* %1
%15 = shl i32 %14, 1
%16 = add nsw i32 %15, 1
ret i32 %16
}

LLVM IR (-O2):
define i32 @thirdBits() {
ret i32 1227133513
}
/* Variables and functions */
int /*<<< orphan*/ odd_even_sort2(int *, int);
int /*<<< orphan*/ print_array(int *, int);
int /*<<< orphan*/ random_array(int *, int);
int main(void) {
  int a[20];
  random_array(a, 20);
  print_array(a, 20);
  odd_even_sort2(a, 20);
  print_array(a, 20);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    $0x14,%esi
call   1050 <random_array@plt>
lea    -0x60(%rbp),%rdi
mov    $0x14,%esi
call   1040 <print_array@plt>
lea    -0x60(%rbp),%rdi
mov    $0x14,%esi
call   1030 <odd_even_sort2@plt>
lea    -0x60(%rbp),%rdi
mov    $0x14,%esi
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1050 <random_array@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <print_array@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1030 <odd_even_sort2@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%4 = call i32 @random_array(i32* %3, i32 20)
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%6 = call i32 @print_array(i32* %5, i32 20)
%7 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%8 = call i32 @odd_even_sort2(i32* %7, i32 20)
%9 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%10 = call i32 @print_array(i32* %9, i32 20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%4 = call i32 @random_array(i32* %3, i32 20)
%5 = call i32 @print_array(i32* %3, i32 20)
%6 = call i32 @odd_even_sort2(i32* %3, i32 20)
%7 = call i32 @print_array(i32* %3, i32 20)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int atoi(char *);
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ read(int, char *, int);
int read_expire_cnt() {
  int fd;
  char str[25];
  fd = open("/tmp/heartbeat", O_RDONLY);
  read(fd, str, sizeof(str));
  close(fd);
  return (atoi(str));
}


x86 assembly (clang, -O0):
<read_expire_cnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
lea    0xea8(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x19,%edx
call   1040 <read@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
lea    -0x20(%rbp),%rdi
call   1060 <atoi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_expire_cnt>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
lea    0xea9(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
mov    %rsp,%r14
mov    %eax,%edi
mov    %r14,%rsi
mov    $0x19,%edx
call   1040 <read@plt>
mov    %ebx,%edi
call   1030 <close@plt>
mov    %r14,%rdi
call   1060 <atoi@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/tmp/heartbeat\00"
@O_RDONLY = global i32 0
define i32 @read_expire_cnt() {
%1 = alloca i32
%2 = alloca [25 x i8]
%3 = load i32, i32* @O_RDONLY
%4 = call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%7 = call i32 @read(i32 %5, i8* %6, i32 25)
%8 = load i32, i32* %1
%9 = call i32 @close(i32 %8)
%10 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%11 = call i32 @atoi(i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [15 x i8] c"/tmp/heartbeat\00"
@O_RDONLY = global i32 0
define i32 @read_expire_cnt() {
%1 = alloca [25 x i8]
%2 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @read(i32 %4, i8* %2, i32 25)
%6 = tail call i32 @close(i32 %4)
%7 = call i32 @atoi(i8* %2)
ret i32 %7
}
/* Variables and functions */
int start(int, char **);
int main(int argc, char **argv) { return start(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <start@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @start(i32 %0, i8** %1)
ret i32 %3
}
int test_imm_24uint16_mem(unsigned short *val) {
  return ((*val) & (-0x24 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_24uint16_mem>:
movzwl (%rdi),%eax
test   $0xffdc,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_24uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -36
%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_24uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -36
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ in;

/* Variables and functions */
uint64_t swap64(uint64_t in) {
  return (
      (uint64_t)((((uint64_t)(in) & (uint64_t)0x00000000000000ffULL) << 56) |
                 (((uint64_t)(in) & (uint64_t)0x000000000000ff00ULL) << 40) |
                 (((uint64_t)(in) & (uint64_t)0x0000000000ff0000ULL) << 24) |
                 (((uint64_t)(in) & (uint64_t)0x00000000ff000000ULL) << 8) |
                 (((uint64_t)(in) & (uint64_t)0x000000ff00000000ULL) >> 8) |
                 (((uint64_t)(in) & (uint64_t)0x0000ff0000000000ULL) >> 24) |
                 (((uint64_t)(in) & (uint64_t)0x00ff000000000000ULL) >> 40) |
                 (((uint64_t)(in) & (uint64_t)0xff00000000000000ULL) >> 56)));
}


x86 assembly (clang, -O0):
<swap64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    $0x38,%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
and    $0xff00,%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x0,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x0,%ecx
sar    $0x18,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
and    $0x0,%edx
mov    $0x28,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
and    $0x0,%edx
mov    $0x38,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @swap64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 56
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 40
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = shl i32 %11, 24
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = shl i32 %15, 8
%17 = or i32 %13, %16
%18 = load i32, i32* %2
%19 = and i32 %18, 0
%20 = ashr i32 %19, 8
%21 = or i32 %17, %20
%22 = load i32, i32* %2
%23 = and i32 %22, 0
%24 = ashr i32 %23, 24
%25 = or i32 %21, %24
%26 = load i32, i32* %2
%27 = and i32 %26, 0
%28 = ashr i32 %27, 40
%29 = or i32 %25, %28
%30 = load i32, i32* %2
%31 = and i32 %30, 0
%32 = ashr i32 %31, 56
%33 = or i32 %29, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @swap64(i32 %0) {
ret i32 poison
}
void b_smp_run(unsigned long ptr, unsigned long var) {
  asm volatile("call *0x00100040" : : "a"(ptr), "D"(var));
}


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

x86 assembly (clang, -O2):
<b_smp_run>:
mov    %rdi,%rax
mov    %rsi,%rdi
call   *0x100040
ret

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

LLVM IR (-O2):
define void @b_smp_run(i64 %0, i64 %1) {
tail call void asm sideeffect "call *0x00100040", "{ax},{di},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret void
}
unsigned int AT91F_AIC_SetExceptionVector(unsigned int *pVector,
                                          void (*Handler)(void)) {
  unsigned int oldVector = *pVector;
  if ((unsigned int)Handler == (unsigned int)((void (*)())0xE51FFF20))
    *pVector = (unsigned int)((void (*)())0xE51FFF20);
  else
    *pVector =
        (((((unsigned int)Handler) - ((unsigned int)pVector) - 0x8) >> 2) &
         0x00FFFFFF) |
        0xEA000000;
  return oldVector;
}


x86 assembly (clang, -O0):
<AT91F_AIC_SetExceptionVector>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xe51fff20,%ecx
cmp    %ecx,%eax
jne    1136 <AT91F_AIC_SetExceptionVector+0x36>
mov    -0x8(%rbp),%rax
mov    $0xe51fff20,%ecx
mov    %ecx,(%rax)
jmp    115a <AT91F_AIC_SetExceptionVector+0x5a>
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
sub    %eax,%ecx
sub    $0x8,%ecx
shr    $0x2,%ecx
and    $0xffffff,%ecx
or     $0xea000000,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AT91F_AIC_SetExceptionVector>:
mov    (%rdi),%eax
mov    $0xe51fff20,%ecx
cmp    $0xe51fff20,%esi
je     1128 <AT91F_AIC_SetExceptionVector+0x28>
sub    %edi,%esi
add    $0x3fffff8,%esi
shr    $0x2,%esi
and    $0xffffff,%esi
or     $0xea000000,%esi
mov    %esi,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define i32 @AT91F_AIC_SetExceptionVector(i32* %0, void ()* %1) {
%3 = alloca i32*
%4 = alloca void ()*
%5 = alloca i32
store i32* %0, i32** %3
store void ()* %1, void ()** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load void ()*, void ()** %4
%9 = ptrtoint void ()* %8 to i32
%10 = icmp eq i32 %9, ptrtoint (void (...)* inttoptr (i64 3844079392 to void (...)*) to i32)
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32*, i32** %3
store i32 ptrtoint (void (...)* inttoptr (i64 3844079392 to void (...)*) to i32), i32* %12
br label %24
13: ; preds = %2
%14 = load void ()*, void ()** %4
%15 = ptrtoint void ()* %14 to i32
%16 = load i32*, i32** %3
%17 = ptrtoint i32* %16 to i32
%18 = sub i32 %15, %17
%19 = sub i32 %18, 8
%20 = lshr i32 %19, 2
%21 = and i32 %20, 16777215
%22 = or i32 %21, -369098752
%23 = load i32*, i32** %3
store i32 %22, i32* %23
br label %24
24: ; preds = %13, %11
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @AT91F_AIC_SetExceptionVector(i32* %0, void ()* %1) {
%3 = load i32, i32* %0
%4 = ptrtoint void ()* %1 to i64
%5 = trunc i64 %4 to i32
%6 = icmp eq i32 %5, -450887904
br i1 %6, label %15, label %7
7: ; preds = %2
%8 = ptrtoint i32* %0 to i64
%9 = trunc i64 %8 to i32
%10 = sub i32 67108856, %9
%11 = add i32 %10, %5
%12 = lshr i32 %11, 2
%13 = and i32 %12, 16777215
%14 = or i32 %13, -369098752
br label %15
15: ; preds = %2, %7
%16 = phi i32 [ %14, %7 ], [ -450887904, %2 ]
store i32 %16, i32* %0
ret i32 %3
}
int do_738() { return 738; }


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

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

LLVM IR (-O0):
define i32 @do_738() {
ret i32 738
}

LLVM IR (-O2):
define i32 @do_738() {
ret i32 738
}
int extend_async_thread_pool() { return 0; }


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

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

LLVM IR (-O0):
define i32 @extend_async_thread_pool() {
ret i32 0
}

LLVM IR (-O2):
define i32 @extend_async_thread_pool() {
ret i32 0
}