xunge/DecIR huggingface dataset:
int tbx_chksum_type_valid(int type) {
  if ((type > 0) && (type < 5))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<tbx_chksum_type_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1127 <tbx_chksum_type_valid+0x27>
cmpl   $0x5,-0x8(%rbp)
jge    1127 <tbx_chksum_type_valid+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <tbx_chksum_type_valid+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tbx_chksum_type_valid>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x4,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @tbx_chksum_type_valid(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 4
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x63() {
  Assert_real((isodigit(99) == 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_isodigit.c",
              500, ("isodigit should be 0 for c"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x63>:
push   %rax
mov    $0x63,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x1f4,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for c\00"
define void @t_isodigit_0x63() {
%1 = call i64 @isodigit(i32 99)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 500, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for c\00"
define void @t_isodigit_0x63() {
%1 = tail call i64 @isodigit(i32 99)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 500, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ uintmax_t;

/* Variables and functions */
int /*<<< orphan*/ wcstoull(int /*<<< orphan*/ const *, int /*<<< orphan*/ **,
                            int);
uintmax_t wcstoumax(const wchar_t *restrict s, wchar_t **restrict p, int base) {
  return wcstoull(s, p, base);
}


x86 assembly (clang, -O0):
<wcstoumax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <wcstoull@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @wcstoumax(i32* noalias %0, i32** noalias %1, i32 %2) {
%4 = tail call i32 @wcstoull(i32* %0, i32** %1, i32 %2)
ret i32 %4
}
void file5(void) { printf("Control in function %s\n", __func__); }


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

x86 assembly (clang, -O2):
<file5>:
lea    0xee9(%rip),%rdi
lea    0xefa(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Control in function %s\0A\00"
@__func__.file5 = [6 x i8] c"file5\00"
define void @file5() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.file5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Control in function %s\0A\00"
@__func__.file5 = [6 x i8] c"file5\00"
define void @file5() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.file5, i64 0, i64 0))
ret void
}
int func2_in_obj() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @func2_in_obj() {
ret i32 0
}
/* Variables and functions */
scalar_t__ cgiServerHttpsIsOn();
char *cgiAppendSForHttps() {
  if (cgiServerHttpsIsOn())
    return "s";
  return "";
}


x86 assembly (clang, -O0):
<cgiAppendSForHttps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <cgiServerHttpsIsOn@plt>
cmp    $0x0,%rax
je     1139 <cgiAppendSForHttps+0x29>
lea    0xed0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1144 <cgiAppendSForHttps+0x34>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgiAppendSForHttps>:
push   %rax
xor    %eax,%eax
call   1030 <cgiServerHttpsIsOn@plt>
test   %rax,%rax
lea    0xedf(%rip),%rcx
lea    0xed7(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"s\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @cgiAppendSForHttps() {
%1 = alloca i8*
%2 = call i64 (...) @cgiServerHttpsIsOn()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %1
br label %6
5: ; preds = %0
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %6
6: ; preds = %5, %4
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@.str = [2 x i8] c"s\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @cgiAppendSForHttps() {
%1 = tail call i64 (...) @cgiServerHttpsIsOn()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
int Operand_label12_encode(unsigned int *valp) {
  unsigned imm12_0, label12_0;
  label12_0 = *valp;
  imm12_0 = (label12_0 - 0x4) & 0xfff;
  *valp = imm12_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_label12_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
and    $0xfff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_label12_encode>:
mov    $0xffc,%eax
add    (%rdi),%eax
and    $0xfff,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_label12_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = sub i32 %7, 4
%9 = and i32 %8, 4095
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32*, i32** %2
store i32 %10, i32* %11
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_label12_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add i32 %2, 4092
%4 = and i32 %3, 4095
store i32 %4, i32* %0
ret i32 0
}
int test_imm_48int16_reg(short val) {
  return ((val) & (0x48 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_48int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x48,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_48int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 72
%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_48int16_reg(i16 signext %0) {
%2 = and i16 %0, 72
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void offset(void) { return; }


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

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

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

LLVM IR (-O2):
define void @offset() {
ret void
}
/* Variables and functions */
long hash(char *);
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char w[200] = {0};
  long h;
  scanf("%s", w);
  h = hash(w);
  printf("%ld", h);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
xor    %esi,%esi
mov    $0xc8,%edx
call   1050 <memset@plt>
lea    -0xd0(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1060 <scanf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <hash@plt>
mov    %rax,-0xd8(%rbp)
mov    -0xd8(%rbp),%rsi
lea    0xe6a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0xc0(%rsp)
lea    0xe6b(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <hash@plt>
lea    0xe54(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
%3 = alloca i64
store i32 0, i32* %1
%4 = bitcast [200 x i8]* %2 to i8*
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%8 = call i64 @hash(i8* %7)
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i64 @hash(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %4)
ret i32 0
}
void customInit() {}


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

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

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

LLVM IR (-O2):
define void @customInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int fact(int n) {
  int r;
  r = 1;
  while (n > 0) {
    r = r * n;
    printf("n = %d, r = %d\n", n, r);
    --n;
  }
  return r;
}


x86 assembly (clang, -O0):
<fact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1156 <fact+0x46>
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1122 <fact+0x12>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fact>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    114b <fact+0x3b>
mov    %edi,%ebx
mov    $0x1,%ebp
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
imul   %ebx,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     1130 <fact+0x20>
jmp    1150 <fact+0x40>
mov    $0x1,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"n = %d, r = %d\0A\00"
define i32 @fact(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = mul nsw i32 %8, %9
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
%14 = load i32, i32* %2
%15 = add nsw i32 %14, -1
store i32 %15, i32* %2
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [16 x i8] c"n = %d, r = %d\0A\00"
define i32 @fact(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = add nsw i32 %5, -1
%9 = icmp ugt i32 %5, 1
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ crc32_u8(unsigned int *, unsigned int);
void crc32_u32(unsigned int *p, unsigned int u) {
  crc32_u8(p, u & 0xff);
  crc32_u8(p, (u >> 8) & 0xff);
  crc32_u8(p, (u >> 16) & 0xff);
  crc32_u8(p, (u >> 24) & 0xff);
}


x86 assembly (clang, -O0):
<crc32_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
and    $0xff,%esi
call   1030 <crc32_u8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
shr    $0x8,%esi
and    $0xff,%esi
call   1030 <crc32_u8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
shr    $0x10,%esi
and    $0xff,%esi
call   1030 <crc32_u8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
shr    $0x18,%esi
and    $0xff,%esi
call   1030 <crc32_u8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32_u32>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
movzbl %bl,%esi
call   1030 <crc32_u8@plt>
movzbl %bh,%esi
mov    %r14,%rdi
call   1030 <crc32_u8@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%esi
mov    %r14,%rdi
call   1030 <crc32_u8@plt>
shr    $0x18,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <crc32_u8@plt>

LLVM IR (-O0):
define void @crc32_u32(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 = and i32 %6, 255
%8 = call i32 @crc32_u8(i32* %5, i32 %7)
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = lshr i32 %10, 8
%12 = and i32 %11, 255
%13 = call i32 @crc32_u8(i32* %9, i32 %12)
%14 = load i32*, i32** %3
%15 = load i32, i32* %4
%16 = lshr i32 %15, 16
%17 = and i32 %16, 255
%18 = call i32 @crc32_u8(i32* %14, i32 %17)
%19 = load i32*, i32** %3
%20 = load i32, i32* %4
%21 = lshr i32 %20, 24
%22 = and i32 %21, 255
%23 = call i32 @crc32_u8(i32* %19, i32 %22)
ret void
}

LLVM IR (-O2):
define void @crc32_u32(i32* %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i32 @crc32_u8(i32* %0, i32 %3)
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = tail call i32 @crc32_u8(i32* %0, i32 %6)
%8 = lshr i32 %1, 16
%9 = and i32 %8, 255
%10 = tail call i32 @crc32_u8(i32* %0, i32 %9)
%11 = lshr i32 %1, 24
%12 = tail call i32 @crc32_u8(i32* %0, i32 %11)
ret void
}
/* Type definitions */
struct ps_process_info {
  int dummy;
};
struct ps_process {
  int dummy;
};

/* Variables and functions */
scalar_t__ obus_object_get_info(int /*<<< orphan*/);
int /*<<< orphan*/ ps_process_const_object(struct ps_process const *);
const struct ps_process_info *
ps_process_get_info(const struct ps_process *object) {
  return (const struct ps_process_info *)obus_object_get_info(
      ps_process_const_object(object));
}


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

x86 assembly (clang, -O2):
<ps_process_get_info>:
push   %rax
call   1030 <ps_process_const_object@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <obus_object_get_info@plt>

LLVM IR (-O0):
%struct.ps_process_info = type { i32 }
%struct.ps_process = type { i32 }
define %struct.ps_process_info* @ps_process_get_info(%struct.ps_process* %0) {
%2 = alloca %struct.ps_process*
store %struct.ps_process* %0, %struct.ps_process** %2
%3 = load %struct.ps_process*, %struct.ps_process** %2
%4 = call i32 @ps_process_const_object(%struct.ps_process* %3)
%5 = call i64 @obus_object_get_info(i32 %4)
%6 = inttoptr i64 %5 to %struct.ps_process_info*
ret %struct.ps_process_info* %6
}

LLVM IR (-O2):
%struct.ps_process_info = type { i32 }
%struct.ps_process = type { i32 }
define %struct.ps_process_info* @ps_process_get_info(%struct.ps_process* %0) {
%2 = tail call i32 @ps_process_const_object(%struct.ps_process* %0)
%3 = tail call i64 @obus_object_get_info(i32 %2)
%4 = inttoptr i64 %3 to %struct.ps_process_info*
ret %struct.ps_process_info* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ key;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
char *malloc(int);
char *create_str_key(char key) {
  char *ret = malloc(2 * sizeof(key));
  assert(0 != ret);
  ret[0] = key;
  ret[1] = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<create_str_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_str_key>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %bpl,(%rbx)
movb   $0x0,0x1(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias i8* @create_str_key(i8 signext %0) {
%2 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
store i8 %0, i8* %2
%6 = getelementptr inbounds i8, i8* %2, i64 1
store i8 0, i8* %6
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateTamperEventsClearNoLock(void) {
  _HibernateWriteComplete();
  (*((volatile unsigned long *)(0x400FC400))) |= 0x00000010;
}


x86 assembly (clang, -O0):
<HibernateTamperEventsClearNoLock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
mov    $0x400fc400,%eax
mov    (%rax),%rcx
or     $0x10,%rcx
mov    $0x400fc400,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateTamperEventsClearNoLock>:
push   %rax
xor    %eax,%eax
call   1030 <_HibernateWriteComplete@plt>
orq    $0x10,0x400fc400
40 10
pop    %rax
ret

LLVM IR (-O0):
define void @HibernateTamperEventsClearNoLock() {
%1 = call i32 (...) @_HibernateWriteComplete()
%2 = load volatile i64, i64* inttoptr (i64 1074775040 to i64*)
%3 = or i64 %2, 16
store volatile i64 %3, i64* inttoptr (i64 1074775040 to i64*)
ret void
}

LLVM IR (-O2):
define void @HibernateTamperEventsClearNoLock() {
%1 = tail call i32 (...) @_HibernateWriteComplete()
%2 = load volatile i64, i64* inttoptr (i64 1074775040 to i64*)
%3 = or i64 %2, 16
store volatile i64 %3, i64* inttoptr (i64 1074775040 to i64*)
ret void
}
/* Variables and functions */
int rand();
int coap_prng_impl(unsigned char *buf, size_t len) {
  while (len--) {
    *buf++ = rand() & 0xFF;
  }
  return 1;
}


x86 assembly (clang, -O0):
<coap_prng_impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     115d <coap_prng_impl+0x4d>
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1120 <coap_prng_impl+0x10>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coap_prng_impl>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1144 <coap_prng_impl+0x34>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <coap_prng_impl+0x20>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @coap_prng_impl(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %10, %4 ], [ %0, %2 ]
%7 = add i64 %5, -1
%8 = tail call i32 (...) @rand()
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %9, i8* %6
%11 = icmp eq i64 %7, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret i32 1
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(int);
int main() {
  int c;
  printf("%d\n", 3 != 4);
  while ((c = getchar()) != EOF) {
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e87(%rip),%rcx
cmp    (%rcx),%eax
je     1176 <main+0x46>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    1150 <main+0x20>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e98(%rip),%rbx
cmp    (%rbx),%eax
je     1172 <main+0x42>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%eax
jne    1160 <main+0x30>
xor    %eax,%eax
pop    %rbx
ret

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

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


x86 assembly (clang, -O0):
<_is_using_at_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x40,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_using_at_char>:
cmp    $0x40,%dil
sete   %al
ret

LLVM IR (-O0):
define zeroext i8 @_is_using_at_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 64
%6 = zext i1 %5 to i32
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @_is_using_at_char(i8 signext %0) {
%2 = icmp eq i8 %0, 64
%3 = zext i1 %2 to i8
ret i8 %3
}
void CloseOutput(void) {}


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

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

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

LLVM IR (-O2):
define void @CloseOutput() {
ret void
}
int fun189() { return 189; }


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

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

LLVM IR (-O0):
define i32 @fun189() {
ret i32 189
}

LLVM IR (-O2):
define i32 @fun189() {
ret i32 189
}
int scanf(const char *_format, ...) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @scanf(i8* nocapture readnone %0, ...) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int ntohl(int);
int /*<<< orphan*/ stderr;
void traps(void) {
  static char test[] __attribute__((aligned(sizeof(int)))) = "CONF";
  int *tmp = (int *)test;
  if (*tmp != ntohl(0x434f4e46)) {
    fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n", *tmp);
    exit(2);
  }
}


x86 assembly (clang, -O0):
<traps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0x2ef9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x434f4e46,%edi
call   1050 <ntohl@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
je     1188 <traps+0x58>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xe87(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traps>:
push   %rax
mov    $0x434f4e46,%edi
call   1050 <ntohl@plt>
cmp    $0x464e4f43,%eax
jne    1144 <traps+0x14>
pop    %rax
ret
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
mov    $0x464e4f43,%edx
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@traps.test = internal global [5 x i8] c"CONF\00"
@stderr = global i32 0
@.str = [50 x i8] c"fixdep: sizeof(int) != 4 or wrong endianess? %#x\0A\00"
define void @traps() {
%1 = alloca i32*
store i32* bitcast ([5 x i8]* @traps.test to i32*), i32** %1
%2 = load i32*, i32** %1
%3 = load i32, i32* %2
%4 = call i32 @ntohl(i32 1129270854)
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = load i32*, i32** %1
%9 = load i32, i32* %8
%10 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @exit(i32 2)
unreachable
12: ; preds = %0
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"fixdep: sizeof(int) != 4 or wrong endianess? %#x\0A\00"
define void @traps() {
%1 = tail call i32 @ntohl(i32 1129270854)
%2 = icmp eq i32 %1, 1179537219
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 1179537219)
%6 = tail call i32 @exit(i32 2)
unreachable
7: ; preds = %0
ret void
}
int iscntrl(int c) { return (c >= 0 && c <= '\037') || c == '\177'; }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1120 <iscntrl+0x20>
mov    $0x1,%al
cmpl   $0x1f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    112a <iscntrl+0x2a>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
cmp    $0x20,%edi
setb   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 31
br i1 %7, label %11, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 127
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ true, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
char *getenv(char const *);
int /*<<< orphan*/ stderr;
int env2d(const char *n) {
  char *v_ch = getenv(n);
  if (v_ch == NULL) {
    fprintf(stderr, "(rw) ERROR: environment variable `%s' should be set\n", n);
    exit(2);
  }
  return atoi(v_ch);
}


x86 assembly (clang, -O0):
<env2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1187 <env2d+0x47>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe88(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x2,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rdi
call   1050 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<env2d>:
push   %rbx
mov    %rdi,%rbx
call   1030 <getenv@plt>
test   %rax,%rax
je     1157 <env2d+0x17>
mov    %rax,%rdi
pop    %rbx
jmp    1050 <atoi@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0x2,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"(rw) ERROR: environment variable `%s' should be set\0A\00"
define i32 @env2d(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @getenv(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i32 @exit(i32 2)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
%15 = call i32 @atoi(i8* %14)
ret i32 %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"(rw) ERROR: environment variable `%s' should be set\0A\00"
define i32 @env2d(i8* %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 2)
unreachable
8: ; preds = %1
%9 = tail call i32 @atoi(i8* %2)
ret i32 %9
}
void cbc_printf(int col, int row, char *t, ...) {}


x86 assembly (clang, -O0):
<cbc_printf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cbc_printf(i32 %0, i32 %1, i8* %2, ...) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @cbc_printf(i32 %0, i32 %1, i8* nocapture %2, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
int dvorak(char layout[][96], int i) {
  strncpy(
      layout[i],
      " 1234567890[]',.pyfgcrl/"
      "=\\aoeuidhtns-;qjkxbmwvz!@#$%^&*(){}\"<>PYFGCRL?+|AOEUIDHTNS_:QJKXBMWVZ",
      96);
  return 58;
}


x86 assembly (clang, -O0):
<dvorak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
imul   $0x60,%rax,%rax
add    %rax,%rdi
lea    0xecb(%rip),%rsi
mov    $0x60,%edx
call   1030 <strncpy@plt>
mov    $0x3a,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvorak>:
push   %rax
movslq %esi,%rax
lea    (%rax,%rax,2),%rax
shl    $0x5,%rax
add    %rax,%rdi
lea    0xeda(%rip),%rsi
mov    $0x60,%edx
call   1030 <strncpy@plt>
mov    $0x3a,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [94 x i8] c" 1234567890[]',.pyfgcrl/=\\aoeuidhtns-;qjkxbmwvz!@#$%^&*(){}\22<>PYFGCRL?+|AOEUIDHTNS_:QJKXBMWVZ\00"
define i32 @dvorak([96 x i8]* %0, i32 %1) {
%3 = alloca [96 x i8]*
%4 = alloca i32
store [96 x i8]* %0, [96 x i8]** %3
store i32 %1, i32* %4
%5 = load [96 x i8]*, [96 x i8]** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [96 x i8], [96 x i8]* %5, i64 %7
%9 = getelementptr inbounds [96 x i8], [96 x i8]* %8, i64 0, i64 0
%10 = call i32 @strncpy(i8* %9, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i32 96)
ret i32 58
}

LLVM IR (-O2):
@.str = [94 x i8] c" 1234567890[]',.pyfgcrl/=\\aoeuidhtns-;qjkxbmwvz!@#$%^&*(){}\22<>PYFGCRL?+|AOEUIDHTNS_:QJKXBMWVZ\00"
define i32 @dvorak([96 x i8]* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [96 x i8], [96 x i8]* %0, i64 %3, i64 0
%5 = tail call i32 @strncpy(i8* %4, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i32 96)
ret i32 58
}
/* Variables and functions */
scalar_t__ malloc(int);
void *shepard_note_on() {
  double *res = (double *)malloc(sizeof(double));
  *res = 0.0;
  return (void *)res;
}


x86 assembly (clang, -O0):
<shepard_note_on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shepard_note_on>:
push   %rax
mov    $0x8,%edi
call   1030 <malloc@plt>
movq   $0x0,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @shepard_note_on() {
%1 = alloca double*
%2 = call i64 @malloc(i32 8)
%3 = inttoptr i64 %2 to double*
store double* %3, double** %1
%4 = load double*, double** %1
store double 0.000000e+00, double* %4
%5 = load double*, double** %1
%6 = bitcast double* %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @shepard_note_on() {
%1 = tail call i64 @malloc(i32 8)
%2 = inttoptr i64 %1 to double*
store double 0.000000e+00, double* %2
%3 = inttoptr i64 %1 to i8*
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void quire_print_usage(FILE *out) {
  fprintf(out,
          "Usage:\n"
          "    cgen --source config.yaml [--c-header config.h]"
          " [--c-source config.c]\n"
          "\n"
          "Options:\n"
          " --source FILE    File name of the source yaml file\n"
          " --prefix NAME    Prefix for all declarations of the config\n"
          " --c-header FILE  Write C header to FILE\n"
          " --c-source FILE  Write parser source in C to FILE\n"
          " --enable COND    Enable section in config marked !If:COND\n"
          " --version-info DATA\n"
          "                  Version info to put into command-line help\n");
}


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

x86 assembly (clang, -O2):
<quire_print_usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x1b4,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [437 x i8] c"Usage:\0A cgen --source config.yaml [--c-header config.h] [--c-source config.c]\0A\0AOptions:\0A --source FILE File name of the source yaml file\0A --prefix NAME Prefix for all declarations of the config\0A --c-header FILE Write C header to FILE\0A --c-source FILE Write parser source in C to FILE\0A --enable COND Enable section in config marked !If:COND\0A --version-info DATA\0A Version info to put into command-line help\0A\00"
define void @quire_print_usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([437 x i8], [437 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [437 x i8] c"Usage:\0A cgen --source config.yaml [--c-header config.h] [--c-source config.c]\0A\0AOptions:\0A --source FILE File name of the source yaml file\0A --prefix NAME Prefix for all declarations of the config\0A --c-header FILE Write C header to FILE\0A --c-source FILE Write parser source in C to FILE\0A --enable COND Enable section in config marked !If:COND\0A --version-info DATA\0A Version info to put into command-line help\0A\00"
define void @quire_print_usage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([437 x i8], [437 x i8]* @.str, i64 0, i64 0), i64 436, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ raise(int);
void c_raise_(int *sig) { raise(*sig); }


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

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

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

LLVM IR (-O2):
define void @c_raise_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @raise(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
struct aFILE {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _get_actual_fp(struct aFILE *);
int vfscanf(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int my_vfscanf(struct aFILE *fp, const char *fmt, va_list arg) {
  return vfscanf(_get_actual_fp(fp), fmt, arg);
}


x86 assembly (clang, -O0):
<my_vfscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <vfscanf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_vfscanf>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <vfscanf@plt>

LLVM IR (-O0):
%struct.aFILE = type { i32 }
define i32 @my_vfscanf(%struct.aFILE* %0, i8* %1, i32 %2) {
%4 = alloca %struct.aFILE*
%5 = alloca i8*
%6 = alloca i32
store %struct.aFILE* %0, %struct.aFILE** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.aFILE*, %struct.aFILE** %4
%8 = call i32 @_get_actual_fp(%struct.aFILE* %7)
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @vfscanf(i32 %8, i8* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.aFILE = type { i32 }
define i32 @my_vfscanf(%struct.aFILE* %0, i8* %1, i32 %2) {
%4 = tail call i32 @_get_actual_fp(%struct.aFILE* %0)
%5 = tail call i32 @vfscanf(i32 %4, i8* %1, i32 %2)
ret i32 %5
}
__attribute__((always_)) void print_irqtrace_events(struct task_struct *curr) {}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define void @print_irqtrace_events(%struct.task_struct* %0) {
%2 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %2
ret void
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @print_irqtrace_events(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug_perror(char *);
int /*<<< orphan*/ exit(int);
scalar_t__ listen(int, int);
void tcp_listen(int sockfd) {
  if (listen(sockfd, 10) < 0) {
    debug_perror("Could not listen for connection");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<tcp_listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xa,%esi
call   1040 <listen@plt>
cmp    $0x0,%rax
jge    1168 <tcp_listen+0x38>
lea    0xea7(%rip),%rdi
call   1030 <debug_perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcp_listen>:
push   %rax
mov    $0xa,%esi
call   1040 <listen@plt>
test   %rax,%rax
js     1142 <tcp_listen+0x12>
pop    %rax
ret
lea    0xeb7(%rip),%rdi
call   1030 <debug_perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Could not listen for connection\00"
define void @tcp_listen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @listen(i32 %3, i32 10)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @debug_perror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Could not listen for connection\00"
define void @tcp_listen(i32 %0) {
%2 = tail call i64 @listen(i32 %0, i32 10)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @debug_perror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xd0() {
  Assert_real((isbdigit(208) == 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_isbdigit.c",
              1045, ("isbdigit should be 0 for 0xd0"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xd0>:
push   %rax
mov    $0xd0,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x415,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xd0\00"
define void @t_isbdigit_0xd0() {
%1 = call i64 @isbdigit(i32 208)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1045, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xd0\00"
define void @t_isbdigit_0xd0() {
%1 = tail call i64 @isbdigit(i32 208)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1045, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}