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

/* Variables and functions */
int /*<<< orphan*/ nfp_crc32_be_generic(int /*<<< orphan*/,
                                        unsigned char const *, size_t, int);
uint32_t nfp_crc32_be(uint32_t crc, unsigned char const *p, size_t len) {
  return nfp_crc32_be_generic(crc, p, len, 0x04c11db7);
}


x86 assembly (clang, -O0):
<nfp_crc32_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x4c11db7,%ecx
call   1030 <nfp_crc32_be_generic@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nfp_crc32_be>:
mov    $0x4c11db7,%ecx
jmp    1030 <nfp_crc32_be_generic@plt>

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

LLVM IR (-O2):
define i32 @nfp_crc32_be(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @nfp_crc32_be_generic(i32 %0, i8* %1, i64 %2, i32 79764919)
ret i32 %4
}
int numeric_global_rscale(void) { return (30 + 4); }


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

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

LLVM IR (-O0):
define i32 @numeric_global_rscale() {
ret i32 34
}

LLVM IR (-O2):
define i32 @numeric_global_rscale() {
ret i32 34
}
int test_imm_0Aint64_highword_reg(long long val) {
  return ((val >> 32) & (0x0A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_0Aint64_highword_reg>:
movabs $0xa00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Aint64_highword_reg(i64 %0) {
%2 = and i64 %0, 42949672960
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void a6bcdefghijklmnopqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @a6bcdefghijklmnopqrstuvwxzy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a = 0, b = 0;
  printf("%d", (a++) + (++b));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
int cmpDouble(const void *a, const void *b) {
  if (*(double *)a < *(double *)b) {
    return -1;
  }
  if (*(double *)a == *(double *)b) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<cmpDouble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1132 <cmpDouble+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <cmpDouble+0x61>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jne    115a <cmpDouble+0x5a>
jp     115a <cmpDouble+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1161 <cmpDouble+0x61>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpDouble>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movapd %xmm0,%xmm2
cmpneqsd %xmm1,%xmm2
movq   %xmm2,%rcx
and    $0x1,%ecx
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmpDouble(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fcmp olt double %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %24
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to double*
%17 = load double, double* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to double*
%20 = load double, double* %19
%21 = fcmp oeq double %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 0, i32* %3
br label %24
23: ; preds = %14
store i32 1, i32* %3
br label %24
24: ; preds = %23, %22, %13
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @cmpDouble(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp une double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void imprimir(int valor) {
  int i = 0;
  printf("%d", i);
  printf("%d", valor);
}


x86 assembly (clang, -O0):
<imprimir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimir>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xee3(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @imprimir(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int read(int /*<<< orphan*/, char *, int);
int main() {
  char c;
  while (read(STDIN_FILENO, &c, 1) == 1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
jne    1144 <main+0x34>
jmp    111f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%r14
lea    0x7(%rsp),%rbx
mov    (%r14),%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
je     1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define i32 @main() {
%1 = alloca i8
br label %2
2: ; preds = %2, %0
%3 = load i32, i32* @STDIN_FILENO
%4 = call i32 @read(i32 %3, i8* %1, i32 1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %2, label %6
6: ; preds = %2
ret i32 0
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int fork();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  pid_t PID = 0;
  PID = fork();
  if (PID == -1) {
    return 0;
  }
  if (PID == 0) {
    printf("Child Says Hi!\n");
    return 0;
  } else {
    printf("Parent Says Hello\n");
  }
  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)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    115d <main+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1192 <main+0x72>
cmpl   $0x0,-0x14(%rbp)
jne    117f <main+0x5f>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1192 <main+0x72>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
cmp    $0xffffffff,%eax
je     1146 <main+0x26>
test   %eax,%eax
jne    113a <main+0x1a>
lea    0xeda(%rip),%rdi
jmp    1141 <main+0x21>
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Child Says Hi!\0A\00"
@.str.1 = [19 x i8] c"Parent Says Hello\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i32 (...) @fork()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 0, i32* %3
br label %19
11: ; preds = %2
%12 = load i32, i32* %6
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %19
16: ; preds = %11
%17 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16
store i32 0, i32* %3
br label %19
19: ; preds = %18, %14, %10
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@str = [18 x i8] c"Parent Says Hello\00"
@str.2 = [15 x i8] c"Child Says Hi!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @fork()
switch i32 %3, label %4 [
i32 -1, label %8
i32 0, label %5
]
4: ; preds = %2
br label %5
5: ; preds = %2, %4
%6 = phi i8* [ getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0), %4 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0), %2 ]
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
br label %8
8: ; preds = %5, %2
ret i32 0
}
void handler(int sig) { (void)sig; }


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__26__IO__makeOutput();
void Msp430GpioC__4__HplGeneralIO__makeOutput(void) {
  HplMsp430GeneralIOP__26__IO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__4__HplGeneralIO__makeOutput() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__26__IO__makeOutput()
ret void
}
/* Variables and functions */
int O_CREAT;
int O_RDWR;
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
int S_IWUSR;
void *varmap_mmap2(size_t *, size_t *, int *, char const *, int, int);
void *varmap_mmap(size_t *len, size_t *max, int *file_handle,
                  const char *filename) {
  return varmap_mmap2(len, max, file_handle, filename, O_RDWR | O_CREAT,
                      S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
}


x86 assembly (clang, -O0):
<varmap_mmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    0x2ea1(%rip),%rax
mov    (%rax),%r8d
mov    0x2eaf(%rip),%rax
or     (%rax),%r8d
mov    0x2e65(%rip),%rax
mov    (%rax),%r9d
mov    0x2e7b(%rip),%rax
or     (%rax),%r9d
mov    0x2e61(%rip),%rax
or     (%rax),%r9d
mov    0x2e4f(%rip),%rax
or     (%rax),%r9d
call   1030 <varmap_mmap2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<varmap_mmap>:
mov    0x2ec9(%rip),%r9
mov    0x2eda(%rip),%rax
mov    (%rax),%r8d
or     (%r9),%r8d
mov    0x2e8d(%rip),%r10
mov    0x2ea6(%rip),%rax
mov    (%rax),%r9d
or     (%r10),%r9d
mov    0x2e89(%rip),%rax
or     (%rax),%r9d
mov    0x2e77(%rip),%rax
or     (%rax),%r9d
jmp    1030 <varmap_mmap2@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
define i8* @varmap_mmap(i64* %0, i64* %1, i32* %2, i8* %3) {
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i32*
%8 = alloca i8*
store i64* %0, i64** %5
store i64* %1, i64** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i64*, i64** %5
%10 = load i64*, i64** %6
%11 = load i32*, i32** %7
%12 = load i8*, i8** %8
%13 = load i32, i32* @O_RDWR
%14 = load i32, i32* @O_CREAT
%15 = or i32 %13, %14
%16 = load i32, i32* @S_IRUSR
%17 = load i32, i32* @S_IWUSR
%18 = or i32 %16, %17
%19 = load i32, i32* @S_IRGRP
%20 = or i32 %18, %19
%21 = load i32, i32* @S_IROTH
%22 = or i32 %20, %21
%23 = call i8* @varmap_mmap2(i64* %9, i64* %10, i32* %11, i8* %12, i32 %15, i32 %22)
ret i8* %23
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
define i8* @varmap_mmap(i64* %0, i64* %1, i32* %2, i8* %3) {
%5 = load i32, i32* @O_RDWR
%6 = load i32, i32* @O_CREAT
%7 = or i32 %6, %5
%8 = load i32, i32* @S_IRUSR
%9 = load i32, i32* @S_IWUSR
%10 = or i32 %9, %8
%11 = load i32, i32* @S_IRGRP
%12 = or i32 %10, %11
%13 = load i32, i32* @S_IROTH
%14 = or i32 %12, %13
%15 = tail call i8* @varmap_mmap2(i64* %0, i64* %1, i32* %2, i8* %3, i32 %7, i32 %14)
ret i8* %15
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ferror(FILE *fp) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @ferror(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int mean(int *, int, int /*<<< orphan*/ *);
void test_null_result(void) {
  int arr[] = {2, 2, 1};
  assert((mean(arr, 1, NULL) == 1));
}


x86 assembly (clang, -O0):
<test_null_result>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x1,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <mean@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_null_result>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <mean@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test_null_result.arr = [3 x i32] [i32 2, i32 2, i32 1]
define void @test_null_result() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @mean(i32* %3, i32 1, i32* null)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret void
}

LLVM IR (-O2):
@__const.test_null_result.arr = [3 x i32] [i32 2, i32 2, i32 1]
define void @test_null_result() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @mean(i32* %3, i32 1, i32* null)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret void
}
void foo(int *a, int *b, int *c, int *d) {
  *a = 1;
  if (*b)
    *c = 2;
  else
    *d = 3;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     113a <foo+0x3a>
mov    -0x18(%rbp),%rax
movl   $0x2,(%rax)
jmp    1144 <foo+0x44>
mov    -0x20(%rbp),%rax
movl   $0x3,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x1,(%rdi)
cmpl   $0x0,(%rsi)
je     1112 <foo+0x12>
movl   $0x2,(%rdx)
ret
movl   $0x3,(%rcx)
ret

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

LLVM IR (-O2):
define void @foo(i32* nocapture writeonly %0, i32* nocapture %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
store i32 1, i32* %0
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %4
store i32 2, i32* %2
br label %9
8: ; preds = %4
store i32 3, i32* %3
br label %9
9: ; preds = %8, %7
ret void
}
int main(void) {
  signed char x;
  double y = 80;
  x = y;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movabs $0x4054000000000000,%rax
mov    %rax,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %al,-0x5(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca double
store i32 0, i32* %1
store double 8.000000e+01, double* %3
%4 = load double, double* %3
%5 = fptosi double %4 to i8
store i8 %5, i8* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_compute_total_degree_solution(int n, int i, int *m, double *sol) {
  int fail, a[2];
  a[0] = n;
  a[1] = i;
  fail = _ada_use_c2phc(142, a, m, sol);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_compute_total_degree_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
lea    -0x24(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x8e,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_compute_total_degree_solution>:
push   %rax
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x8e,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solcon_compute_total_degree_solution(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca double*
%9 = alloca i32
%10 = alloca [2 x i32]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store double* %3, double** %8
%11 = load i32, i32* %5
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
store i32 %11, i32* %12
%13 = load i32, i32* %6
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 1
store i32 %13, i32* %14
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%16 = load i32*, i32** %7
%17 = load double*, double** %8
%18 = call i32 @_ada_use_c2phc(i32 142, i32* %15, i32* %16, double* %17)
store i32 %18, i32* %9
%19 = load i32, i32* %9
ret i32 %19
}

LLVM IR (-O2):
define i32 @solcon_compute_total_degree_solution(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca [2 x i32]
%6 = bitcast [2 x i32]* %5 to i8*
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %0, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %1, i32* %8
%9 = call i32 @_ada_use_c2phc(i32 142, i32* %7, i32* %2, double* %3)
ret i32 %9
}
int lw_sock_exit() {
  int result = 1;
  return result;
}


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

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

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

LLVM IR (-O2):
define i32 @lw_sock_exit() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ strcmp(char *, char *);
void my_fclose(FILE *f, char *filename) {
  if (filename == NULL || strcmp(filename, "-") == 0) {
    return;
  }
  fclose(f);
}


x86 assembly (clang, -O0):
<my_fclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1155 <my_fclose+0x35>
mov    -0x10(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    115a <my_fclose+0x3a>
jmp    1163 <my_fclose+0x43>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fclose>:
push   %rbx
test   %rsi,%rsi
je     1149 <my_fclose+0x29>
mov    %rdi,%rbx
lea    0xed0(%rip),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1149 <my_fclose+0x29>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
define void @my_fclose(i32* nocapture %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @fclose(i32* %0)
br label %9
9: ; preds = %2, %4, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void get_subdirname(void) { printf("x86"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"x86\00"
define void @get_subdirname() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"x86\00"
define void @get_subdirname() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nextrandom2(int /*<<< orphan*/, int);
int /*<<< orphan*/ swapa(int, int /*<<< orphan*/);
void randomize(int len) {
  for (int i = 0; i < len; i++)
    swapa(i, nextrandom2(0, len - 1));
}


x86 assembly (clang, -O0):
<randomize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1169 <randomize+0x49>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
sub    $0x1,%esi
xor    %edi,%edi
call   1040 <nextrandom2@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1030 <swapa@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <randomize+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomize>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    115a <randomize+0x3a>
mov    %edi,%r14d
lea    -0x1(%r14),%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
mov    %ebp,%esi
call   1040 <nextrandom2@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <swapa@plt>
add    $0x1,%ebx
cmp    %ebx,%r14d
jne    1140 <randomize+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @randomize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 1
%12 = call i32 @nextrandom2(i32 0, i32 %11)
%13 = call i32 @swapa(i32 %9, i32 %12)
br label %14
14: ; preds = %8
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @randomize(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = add nsw i32 %0, -1
br label %6
5: ; preds = %6, %1
ret void
6: ; preds = %3, %6
%7 = phi i32 [ 0, %3 ], [ %10, %6 ]
%8 = tail call i32 @nextrandom2(i32 0, i32 %4)
%9 = tail call i32 @swapa(i32 %7, i32 %8)
%10 = add nuw nsw i32 %7, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %5, label %6
}
/* Variables and functions */
int tuner_i2c_read(void *, unsigned char, int, unsigned char *, int);
signed int fc8180_read(void *handle, unsigned char addr, unsigned char *data) {
  signed int res;
  res = tuner_i2c_read(handle, addr, 1, data, 1);
  return res;
}


x86 assembly (clang, -O0):
<fc8180_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    $0x1,%r8d
movzbl %al,%esi
mov    %r8d,%edx
call   1030 <tuner_i2c_read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc8180_read>:
mov    %rdx,%rcx
mov    $0x1,%edx
mov    $0x1,%r8d
jmp    1030 <tuner_i2c_read@plt>

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

LLVM IR (-O2):
define i32 @fc8180_read(i8* %0, i8 zeroext %1, i8* %2) {
%4 = tail call i32 @tuner_i2c_read(i8* %0, i8 zeroext %1, i32 1, i8* %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ InitializeParameters(char **);
int /*<<< orphan*/ StartSession();
int main(int argc, char *argv[]) {
  InitializeParameters(argv);
  StartSession();
  return 0;
}


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    -0x10(%rbp),%rdi
call   1040 <InitializeParameters@plt>
mov    $0x0,%al
call   1030 <StartSession@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsi,%rdi
call   1040 <InitializeParameters@plt>
xor    %eax,%eax
call   1030 <StartSession@plt>
xor    %eax,%eax
pop    %rcx
ret

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 i8**, i8*** %5
%7 = call i32 @InitializeParameters(i8** %6)
%8 = call i32 (...) @StartSession()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @InitializeParameters(i8** %1)
%4 = tail call i32 (...) @StartSession()
ret i32 0
}
int isupper(int c) {
  if (('Z' - c) < 0)
    return 0;
  else if (('A' - c) >= 0)
    return c;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x5a,%eax
sub    -0x8(%rbp),%eax
cmp    $0x0,%eax
jge    1124 <isupper+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1147 <isupper+0x47>
mov    $0x41,%eax
sub    -0x8(%rbp),%eax
cmp    $0x0,%eax
jl     1140 <isupper+0x40>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <isupper+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
xor    %ecx,%ecx
cmp    $0x42,%edi
mov    $0x0,%eax
cmovl  %edi,%eax
cmp    $0x5b,%edi
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sub nsw i32 90, %4
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %15
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub nsw i32 65, %9
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %15
14: ; preds = %8
store i32 0, i32* %2
br label %15
15: ; preds = %14, %12, %7
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = icmp sgt i32 %0, 90
%3 = icmp slt i32 %0, 66
%4 = select i1 %3, i32 %0, i32 0
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ InitSD();
int /*<<< orphan*/ Nand_Init();
scalar_t__ SD_Init();
int sdmmc_sdcard_init() {
  ;
  InitSD();
  Nand_Init();
  ;
  if (SD_Init() != 0)
    return 0;
  ;
  return 1;
}


x86 assembly (clang, -O0):
<sdmmc_sdcard_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <InitSD@plt>
mov    $0x0,%al
call   1040 <Nand_Init@plt>
mov    $0x0,%al
call   1050 <SD_Init@plt>
cmp    $0x0,%rax
je     1163 <sdmmc_sdcard_init+0x33>
movl   $0x0,-0x4(%rbp)
jmp    116a <sdmmc_sdcard_init+0x3a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdmmc_sdcard_init>:
push   %rax
xor    %eax,%eax
call   1030 <InitSD@plt>
xor    %eax,%eax
call   1040 <Nand_Init@plt>
xor    %eax,%eax
call   1050 <SD_Init@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sdmmc_sdcard_init() {
%1 = alloca i32
%2 = call i32 (...) @InitSD()
%3 = call i32 (...) @Nand_Init()
%4 = call i64 (...) @SD_Init()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %8
7: ; preds = %0
store i32 1, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @sdmmc_sdcard_init() {
%1 = tail call i32 (...) @InitSD()
%2 = tail call i32 (...) @Nand_Init()
%3 = tail call i64 (...) @SD_Init()
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printArray() { printf("Array:\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"Array:\00"
define void @printArray() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int hammingWeight(uint32_t n) {
  int count = 0;
  for (; n; count++) {
    n &= n - 1;
  }
  return count;
}


x86 assembly (clang, -O0):
<hammingWeight>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <hammingWeight+0x32>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <hammingWeight+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hammingWeight>:
xor    %eax,%eax
test   %edi,%edi
je     111c <hammingWeight+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <hammingWeight+0x10>
ret

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

LLVM IR (-O2):
define i32 @hammingWeight(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %5, -1
%7 = and i32 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ isalpha(int);
int _is_scheme_char(int c) {
  return (!isalpha(c) && '+' != c && '-' != c && '.' != c) ? 0 : 1;
}


x86 assembly (clang, -O0):
<_is_scheme_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalpha@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1167 <_is_scheme_char+0x57>
xor    %eax,%eax
mov    $0x2b,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
je     1167 <_is_scheme_char+0x57>
xor    %eax,%eax
mov    $0x2d,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
je     1167 <_is_scheme_char+0x57>
mov    $0x2e,%eax
cmp    -0x4(%rbp),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
mov    $0x1,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_scheme_char>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalpha@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     1125 <_is_scheme_char+0x15>
pop    %rbx
ret
cmp    $0x2b,%ebx
je     1123 <_is_scheme_char+0x13>
cmp    $0x2d,%ebx
je     1123 <_is_scheme_char+0x13>
xor    %eax,%eax
cmp    $0x2e,%ebx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_is_scheme_char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isalpha(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp ne i32 43, %7
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp ne i32 45, %10
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp ne i32 46, %13
br label %15
15: ; preds = %12, %9, %6, %1
%16 = phi i1 [ false, %9 ], [ false, %6 ], [ false, %1 ], [ %14, %12 ]
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 0, i32 1
ret i32 %18
}

LLVM IR (-O2):
define i32 @_is_scheme_char(i32 %0) {
%2 = tail call i32 @isalpha(i32 %0)
%3 = freeze i32 %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
switch i32 %0, label %6 [
i32 45, label %9
i32 43, label %9
]
6: ; preds = %5
%7 = icmp eq i32 %0, 46
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %5, %1, %6
%10 = phi i32 [ 1, %5 ], [ %8, %6 ], [ 1, %1 ], [ 1, %5 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int is_omitted(const char *criterion) {
  return !criterion || strcmp(criterion, "-") == 0 ||
         strcmp(criterion, "*") == 0;
}


x86 assembly (clang, -O0):
<is_omitted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1168 <is_omitted+0x58>
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1168 <is_omitted+0x58>
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_omitted>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
test   %rdi,%rdi
je     1149 <is_omitted+0x39>
mov    %rdi,%rbx
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1149 <is_omitted+0x39>
lea    0xeca(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@.str.1 = [2 x i8] c"*\00"
define i32 @is_omitted(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br label %13
13: ; preds = %9, %5, %1
%14 = phi i1 [ true, %5 ], [ true, %1 ], [ %12, %9 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
@.str.1 = [2 x i8] c"*\00"
define i32 @is_omitted(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %1
%11 = phi i32 [ 1, %3 ], [ 1, %1 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
double NAN;
void set_qnan(double *f) { *f = NAN; }


x86 assembly (clang, -O0):
<set_qnan>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ee9(%rip),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_qnan>:
mov    0x2ef1(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
@NAN = global double 0.000000e+00
define void @set_qnan(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double, double* @NAN
%4 = load double*, double** %2
store double %3, double* %4
ret void
}

LLVM IR (-O2):
@NAN = global double 0.000000e+00
define void @set_qnan(double* nocapture writeonly %0) {
%2 = load double, double* @NAN
store double %2, double* %0
ret void
}
/* Type definitions */
struct rtattr {
  int dummy;
};
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int /*<<< orphan*/ RTA_DATA(struct rtattr const *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
__u64 rta_getattr_u64(const struct rtattr *rta) {
  __u64 tmp;
  memcpy(&tmp, RTA_DATA(rta), sizeof(__u64));
  return tmp;
}


x86 assembly (clang, -O0):
<rta_getattr_u64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <RTA_DATA@plt>
mov    %eax,%esi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rta_getattr_u64>:
push   %rax
call   1040 <RTA_DATA@plt>
lea    0x4(%rsp),%rdi
mov    %eax,%esi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rtattr = type { i32 }
define i32 @rta_getattr_u64(%struct.rtattr* %0) {
%2 = alloca %struct.rtattr*
%3 = alloca i32
store %struct.rtattr* %0, %struct.rtattr** %2
%4 = load %struct.rtattr*, %struct.rtattr** %2
%5 = call i32 @RTA_DATA(%struct.rtattr* %4)
%6 = call i32 @memcpy(i32* %3, i32 %5, i32 4)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
%struct.rtattr = type { i32 }
define i32 @rta_getattr_u64(%struct.rtattr* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @RTA_DATA(%struct.rtattr* %0)
%5 = call i32 @memcpy(i32* %2, i32 %4, i32 4)
%6 = load i32, i32* %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xeb() {
  Assert_real((isodigit(235) == 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",
              1180, ("isodigit should be 0 for 0xeb"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xeb>:
push   %rax
mov    $0xeb,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x49c,%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 = [30 x i8] c"isodigit should be 0 for 0xeb\00"
define void @t_isodigit_0xeb() {
%1 = call i64 @isodigit(i32 235)
%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 1180, 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xeb\00"
define void @t_isodigit_0xeb() {
%1 = tail call i64 @isodigit(i32 235)
%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 1180, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main() {
  char a[] =
      "\\device\\harddiskvolume1\\windows\\temp\\udd28c9.tmpab1213213123";
  char b[] =
      "\\device\\harddiskvolume1\\windows\\temp\\udd28c9.tmpab1213213123";
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x40(%rbp),%rdi
lea    0xeda(%rip),%rsi
mov    $0x3d,%edx
call   1030 <memcpy@plt>
lea    -0x80(%rbp),%rdi
lea    0xec5(%rip),%rsi
mov    $0x3d,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [61 x i8] c"\\device\\harddiskvolume1\\windows\\temp\\udd28c9.tmpab1213213123\00"
@__const.main.b = [61 x i8] c"\\device\\harddiskvolume1\\windows\\temp\\udd28c9.tmpab1213213123\00"
define i32 @main() {
%1 = alloca [61 x i8]
%2 = alloca [61 x i8]
%3 = bitcast [61 x i8]* %1 to i8*
%4 = bitcast [61 x i8]* %2 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
void *CMUTIL_MemRcyAlloc(size_t);
int /*<<< orphan*/ memset(void *, int, size_t);
void *CMUTIL_MemRcyCalloc(size_t nmem, size_t size) {
  size_t totsz = nmem * size;
  void *res = CMUTIL_MemRcyAlloc(totsz);
  memset(res, 0x0, totsz);
  return res;
}


x86 assembly (clang, -O0):
<CMUTIL_MemRcyCalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <CMUTIL_MemRcyAlloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMUTIL_MemRcyCalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1030 <CMUTIL_MemRcyAlloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @CMUTIL_MemRcyCalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = mul i64 %7, %8
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = call i8* @CMUTIL_MemRcyAlloc(i64 %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = load i64, i64* %5
%14 = call i32 @memset(i8* %12, i32 0, i64 %13)
%15 = load i8*, i8** %6
ret i8* %15
}

LLVM IR (-O2):
define i8* @CMUTIL_MemRcyCalloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @CMUTIL_MemRcyAlloc(i64 %3)
%5 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
ret i8* %4
}