xunge/DecIR huggingface dataset:
unsigned int myMin(unsigned int a, unsigned int b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<myMin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1121 <myMin+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <myMin+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myMin>:
mov    %esi,%eax
cmp    %esi,%edi
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @myMin(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 = icmp ult i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @myMin(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int mix(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x = 0x89abcdef;
  int y = 0x76543210;
  printf("%x\n", mix(x, y));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = tail call i32 @mix(i32 -1985229329, i32 1985229328)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int LEN(const char *str) {
  const char *s;
  for (s = str; *s; ++s)
    ;
  return (s - str);
}


x86 assembly (clang, -O0):
<LEN>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <LEN+0x33>
jmp    1122 <LEN+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <LEN+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LEN>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <LEN+0x10>
ret

LLVM IR (-O0):
define i32 @LEN(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
br label %10
10: ; preds = %9
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i8*, i8** %2
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @LEN(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ is_prime(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  scanf("%d", &number);
  is_prime(number);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <is_prime@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @is_prime(i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ vec3d_scalarMult_new(double *, double *, double const);
void vec3d_scalarMult(double v[3], const double scalar) {
  vec3d_scalarMult_new(v, v, scalar);
}


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

x86 assembly (clang, -O2):
<vec3d_scalarMult>:
mov    %rdi,%rsi
jmp    1030 <vec3d_scalarMult_new@plt>

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

LLVM IR (-O2):
define void @vec3d_scalarMult(double* %0, double %1) {
%3 = tail call i32 @vec3d_scalarMult_new(double* %0, double* %0, double %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", 1 << 3 + 1);
  printf("%d\n", 0x9999 & 0xff == 0x99);
  printf("%d\n", 2 & 3 | 5);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 16)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __set_BASEPRI(unsigned int);
void port_unlock(void) { __set_BASEPRI(0U); }


x86 assembly (clang, -O0):
<port_unlock>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <__set_BASEPRI@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<port_unlock>:
xor    %edi,%edi
jmp    1030 <__set_BASEPRI@plt>

LLVM IR (-O0):
define void @port_unlock() {
%1 = call i32 @__set_BASEPRI(i32 0)
ret void
}

LLVM IR (-O2):
define void @port_unlock() {
%1 = tail call i32 @__set_BASEPRI(i32 0)
ret void
}
/* Variables and functions */
scalar_t__ memcmp(void const *, void const *, size_t);
int memeq(const void *aa, const void *bb, size_t nn) {
  return memcmp(aa, bb, nn) == 0;
}


x86 assembly (clang, -O0):
<memeq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memeq>:
push   %rax
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @memeq(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i64 @memcmp(i8* %7, i8* %8, i64 %9)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @memeq(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @memcmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ fseek(int /*<<< orphan*/ *, long, int);
void seek_bin(FILE *fp, long offset, int origin) {
  if (fseek(fp, offset, origin)) {
    exit(14);
  }
}


x86 assembly (clang, -O0):
<seek_bin>:
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 <fseek@plt>
cmp    $0x0,%rax
je     1157 <seek_bin+0x37>
mov    $0xe,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seek_bin>:
push   %rax
call   1030 <fseek@plt>
test   %rax,%rax
jne    112d <seek_bin+0xd>
pop    %rax
ret
mov    $0xe,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @seek_bin(i32* nocapture %0, i64 %1, i32 %2) {
%4 = tail call i64 @fseek(i32* %0, i64 %1, i32 %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @exit(i32 14)
unreachable
8: ; preds = %3
ret void
}
void foo579(int p) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @Atm128AdcP__HplAtm128Adc__enableAdc() {
%1 = tail call i32 (...) @HplAtm128AdcP__HplAtm128Adc__enableAdc()
ret void
}
int test_imm_56int8_mem(signed char *val) {
  return ((*val) & (0x56 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_56int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 86
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void print_version(int returncode) {
  printf("decode, the interpreter disassembler\nVersion %s\n", "0.1");
  exit(returncode);
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    0xef8(%rip),%rsi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_version>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
lea    0xf00(%rip),%rsi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"decode, the interpreter disassembler\0AVersion %s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
define void @print_version(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@.str = [49 x i8] c"decode, the interpreter disassembler\0AVersion %s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
define void @print_version(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
size_t aeron_producer_window_length(size_t producer_window_length,
                                    size_t term_length) {
  size_t window_length = term_length / 2;
  if (0 != producer_window_length && producer_window_length < window_length) {
    window_length = producer_window_length;
  }
  return window_length;
}


x86 assembly (clang, -O0):
<aeron_producer_window_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     113a <aeron_producer_window_length+0x3a>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    113a <aeron_producer_window_length+0x3a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_producer_window_length>:
shr    %rsi
cmp    %rdi,%rsi
mov    %rsi,%rax
cmova  %rdi,%rax
test   %rdi,%rdi
cmove  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @aeron_producer_window_length(i64 %0, i64 %1) {
%3 = lshr i64 %1, 1
%4 = icmp ne i64 %0, 0
%5 = icmp ugt i64 %3, %0
%6 = and i1 %4, %5
%7 = select i1 %6, i64 %0, i64 %3
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/);
void *runner(void *param) {
  printf("Hello, world\n");
  pthread_exit(0);
}


x86 assembly (clang, -O0):
<runner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runner>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello, world\00"
define noalias i8* @runner(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @pthread_exit(i32 0)
ret i8* undef
}
/* Variables and functions */
void *calloc(int const, size_t const);
int /*<<< orphan*/ err(int, char *, size_t const);
void *xcalloc(const int num, const size_t size) {
  void *tmp = calloc(num, size);
  if (tmp == NULL) {
    err(101, "Calloc call failed - attempted %zu bytes", size);
  }
  return tmp;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115f <xcalloc+0x3f>
mov    -0x10(%rbp),%rdx
mov    $0x65,%edi
lea    0xea6(%rip),%rsi
call   1040 <err@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1148 <xcalloc+0x28>
lea    0xec5(%rip),%rsi
mov    $0x65,%edi
mov    %r14,%rdx
call   1040 <err@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [41 x i8] c"Calloc call failed - attempted %zu bytes\00"
define i8* @xcalloc(i32 %0, i64 %1) {
%3 = tail call i8* @calloc(i32 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err(i32 101, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ led_driver_panic();
void NMI_Handler(void) {
  led_driver_panic();
  while (1) {
  }
}


x86 assembly (clang, -O0):
<NMI_Handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <led_driver_panic@plt>
jmp    111b <NMI_Handler+0xb>

x86 assembly (clang, -O2):
<NMI_Handler>:
push   %rax
xor    %eax,%eax
call   1030 <led_driver_panic@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <NMI_Handler+0x10>

LLVM IR (-O0):
define void @NMI_Handler() {
%1 = call i32 (...) @led_driver_panic()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @NMI_Handler() {
%1 = tail call i32 (...) @led_driver_panic()
br label %2
2: ; preds = %0, %2
br label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
char *asctime_r(int /*<<< orphan*/, char *);
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ const *, struct tm *);
char *ctime_r(const time_t *tim_p, char *result) {
  struct tm tm;
  return asctime_r(localtime_r(tim_p, &tm), result);
}


x86 assembly (clang, -O0):
<ctime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <localtime_r@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <asctime_r@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctime_r>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <localtime_r@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <asctime_r@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i8* @ctime_r(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca %struct.tm
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i32*, i32** %3
%7 = call i32 @localtime_r(i32* %6, %struct.tm* %5)
%8 = load i8*, i8** %4
%9 = call i8* @asctime_r(i32 %7, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i8* @ctime_r(i32* %0, i8* %1) {
%3 = alloca %struct.tm
%4 = bitcast %struct.tm* %3 to i8*
%5 = call i32 @localtime_r(i32* %0, %struct.tm* %3)
%6 = call i8* @asctime_r(i32 %5, i8* %1)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
int /*<<< orphan*/ trio_copy_max(char *, size_t, char const *);
char *trio_create(size_t);
char *TrioDuplicateMax(const char *source, size_t size) {
  char *target;
  assert(source);
  size++;
  target = trio_create(size);
  if (target) {
    trio_copy_max(target, size, source);
  }
  return target;
}


x86 assembly (clang, -O0):
<TrioDuplicateMax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <trio_create@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117e <TrioDuplicateMax+0x4e>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1050 <trio_copy_max@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TrioDuplicateMax>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <assert@plt>
add    $0x1,%rbx
mov    %rbx,%rdi
call   1030 <trio_create@plt>
mov    %rax,%r15
test   %rax,%rax
je     1162 <TrioDuplicateMax+0x32>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <trio_copy_max@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @TrioDuplicateMax(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = call i32 @assert(i8* %6)
%8 = load i64, i64* %4
%9 = add i64 %8, 1
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = call i8* @trio_create(i64 %10)
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %19
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = load i64, i64* %4
%17 = load i8*, i8** %3
%18 = call i32 @trio_copy_max(i8* %15, i64 %16, i8* %17)
br label %19
19: ; preds = %14, %2
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
define i8* @TrioDuplicateMax(i8* %0, i64 %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = add i64 %1, 1
%5 = tail call i8* @trio_create(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @trio_copy_max(i8* %5, i64 %4, i8* %0)
br label %9
9: ; preds = %7, %2
ret i8* %5
}
int fun671() { return 671; }


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

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

LLVM IR (-O0):
define i32 @fun671() {
ret i32 671
}

LLVM IR (-O2):
define i32 @fun671() {
ret i32 671
}
/* Type definitions */
typedef int /*<<< orphan*/ PKCS7_ISSUER_AND_SERIAL;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ PKCS7_ISSUER_AND_SERIAL_it;
void PKCS7_ISSUER_AND_SERIAL_free(PKCS7_ISSUER_AND_SERIAL *a) {
  ASN1_item_free((ASN1_VALUE *)a, &PKCS7_ISSUER_AND_SERIAL_it);
}


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

x86 assembly (clang, -O2):
<PKCS7_ISSUER_AND_SERIAL_free>:
mov    0x2ed1(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@PKCS7_ISSUER_AND_SERIAL_it = global i32 0
define void @PKCS7_ISSUER_AND_SERIAL_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @PKCS7_ISSUER_AND_SERIAL_it)
ret void
}

LLVM IR (-O2):
@PKCS7_ISSUER_AND_SERIAL_it = global i32 0
define void @PKCS7_ISSUER_AND_SERIAL_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @PKCS7_ISSUER_AND_SERIAL_it)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: spray [-c count] [-l length] [-d delay] host\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"usage: spray [-c count] [-l length] [-d delay] host\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"usage: spray [-c count] [-l length] [-d delay] host\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct eqn_node {
  int dummy;
};

/* Variables and functions */
char const *eqn_next(struct eqn_node *, char, size_t *, int /*<<< orphan*/);
const char *eqn_nextrawtok(struct eqn_node *ep, size_t *sz) {
  return eqn_next(ep, '"', sz, 0);
}


x86 assembly (clang, -O0):
<eqn_nextrawtok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x22,%esi
xor    %ecx,%ecx
call   1030 <eqn_next@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eqn_nextrawtok>:
mov    %rsi,%rdx
mov    $0x22,%esi
xor    %ecx,%ecx
jmp    1030 <eqn_next@plt>

LLVM IR (-O0):
%struct.eqn_node = type { i32 }
define i8* @eqn_nextrawtok(%struct.eqn_node* %0, i64* %1) {
%3 = alloca %struct.eqn_node*
%4 = alloca i64*
store %struct.eqn_node* %0, %struct.eqn_node** %3
store i64* %1, i64** %4
%5 = load %struct.eqn_node*, %struct.eqn_node** %3
%6 = load i64*, i64** %4
%7 = call i8* @eqn_next(%struct.eqn_node* %5, i8 signext 34, i64* %6, i32 0)
ret i8* %7
}

LLVM IR (-O2):
%struct.eqn_node = type { i32 }
define i8* @eqn_nextrawtok(%struct.eqn_node* %0, i64* %1) {
%3 = tail call i8* @eqn_next(%struct.eqn_node* %0, i8 signext 34, i64* %1, i32 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ generate();
int /*<<< orphan*/ yyparse();
int main() {
  yyparse();
  generate();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <yyparse@plt>
mov    $0x0,%al
call   1040 <generate@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @yyparse()
%3 = call i32 (...) @generate()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @yyparse()
%2 = tail call i32 (...) @generate()
ret i32 0
}
int _strlen(char *str) {
  int i = 0;
  if (str == 0)
    return -1;
  while (str[i] != '\0')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1126 <_strlen+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1154 <_strlen+0x54>
jmp    112b <_strlen+0x2b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114e <_strlen+0x4e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <_strlen+0x2b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strlen>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     111c <_strlen+0x1c>
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ -1, %1 ], [ %10, %9 ]
ret i32 %12
}
void zeroArray(int A[][5]) {
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 5; j++) {
      A[i][j] = 0;
    }
  }
}


x86 assembly (clang, -O0):
<zeroArray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jge    1165 <zeroArray+0x65>
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    1152 <zeroArray+0x52>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <zeroArray+0x20>
jmp    1157 <zeroArray+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <zeroArray+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeroArray>:
xorps  %xmm0,%xmm0
movups %xmm0,0x60(%rdi)
movups %xmm0,0x50(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movq   $0x0,0x70(%rdi)
ret

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

LLVM IR (-O2):
define void @zeroArray([5 x i32]* nocapture writeonly %0) {
%2 = bitcast [5 x i32]* %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xf4() {
  Assert_real((isxdigit(244) == 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_isxdigit.c",
              1225, ("isxdigit should be 0 for 0xf4"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xf4>:
push   %rax
mov    $0xf4,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4c9,%edx
pop    %rax
jmp    1040 <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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xf4\00"
define void @t_isxdigit_0xf4() {
%1 = call i64 @isxdigit(i32 244)
%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 1225, 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xf4\00"
define void @t_isxdigit_0xf4() {
%1 = tail call i64 @isxdigit(i32 244)
%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 1225, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_C8uint16_reg(unsigned short val) {
  return ((val) & (0xC8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C8uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 200
%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_C8uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 200
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void d_putsl(unsigned char *ptr, signed long data) {
  *ptr++ = ((unsigned long)data & 0xff000000UL) >> 24;
  *ptr++ = ((unsigned long)data & 0x00ff0000UL) >> 16;
  *ptr++ = ((unsigned long)data & 0x0000ff00UL) >> 8;
  *ptr = ((unsigned long)data & 0x000000ffUL) >> 0;
}


x86 assembly (clang, -O0):
<d_putsl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0xff000000,%rax
and    -0x10(%rbp),%rax
shr    $0x18,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
and    $0xff0000,%rax
shr    $0x10,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
and    $0xff00,%rax
shr    $0x8,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
shr    $0x0,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_putsl>:
bswap  %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @d_putsl(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = and i64 %5, 4278190080
%7 = lshr i64 %6, 24
%8 = trunc i64 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
store i8 %8, i8* %9
%11 = load i64, i64* %4
%12 = and i64 %11, 16711680
%13 = lshr i64 %12, 16
%14 = trunc i64 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
store i8 %14, i8* %15
%17 = load i64, i64* %4
%18 = and i64 %17, 65280
%19 = lshr i64 %18, 8
%20 = trunc i64 %19 to i8
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
store i8 %20, i8* %21
%23 = load i64, i64* %4
%24 = and i64 %23, 255
%25 = lshr i64 %24, 0
%26 = trunc i64 %25 to i8
%27 = load i8*, i8** %3
store i8 %26, i8* %27
ret void
}

LLVM IR (-O2):
define void @d_putsl(i8* nocapture writeonly %0, i64 %1) {
%3 = lshr i64 %1, 24
%4 = trunc i64 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %0
%6 = lshr i64 %1, 16
%7 = trunc i64 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %7, i8* %5
%9 = lshr i64 %1, 8
%10 = trunc i64 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %10, i8* %8
%12 = trunc i64 %1 to i8
store i8 %12, i8* %11
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsscanf(char const *, char const *, int /*<<< orphan*/);
int __isoc99_vsscanf(const char *restrict input, const char *restrict format,
                     va_list args) {
  return vsscanf(input, format, args);
}


x86 assembly (clang, -O0):
<__isoc99_vsscanf>:
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 <vsscanf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__isoc99_vsscanf(i8* noalias %0, i8* noalias %1, i32 %2) {
%4 = tail call i32 @vsscanf(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ DeInitialize();
int /*<<< orphan*/ UnMapSharedMemory();
__attribute__((destructor)) void __unload() {
  UnMapSharedMemory();
  DeInitialize();
}


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

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

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__unload, i8* null }]
define void @__unload() {
%1 = call i32 (...) @UnMapSharedMemory()
%2 = call i32 (...) @DeInitialize()
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__unload, i8* null }]
define void @__unload() {
%1 = tail call i32 (...) @UnMapSharedMemory()
%2 = tail call i32 (...) @DeInitialize()
ret void
}
/* Variables and functions */
char *strdup(char const *);
char *string_iconv(int from_utf8, const char *from_code, const char *to_code,
                   const char *string) {
  char *outbuf;
  (void)from_utf8;
  (void)from_code;
  (void)to_code;
  outbuf = strdup(string);
  return outbuf;
}


x86 assembly (clang, -O0):
<string_iconv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_iconv>:
mov    %rcx,%rdi
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @string_iconv(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture %3) {
%5 = tail call i8* @strdup(i8* %3)
ret i8* %5
}
void no_unreg_proc(void *pdata) {}


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

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

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

LLVM IR (-O2):
define void @no_unreg_proc(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WriteInstruction(char *);
void CR_Remove(void) { WriteInstruction("ld (ix+5),255"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"ld (ix+5),255\00"
define void @CR_Remove() {
%1 = call i32 @WriteInstruction(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"ld (ix+5),255\00"
define void @CR_Remove() {
%1 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ advance();
char *factor();
int /*<<< orphan*/ freename(char *);
scalar_t__ match(int);
int /*<<< orphan*/ printf(char *, char *, char *);
char *term() {
  char *tempvar, *tempvar2;
  tempvar = factor();
  while (match(3)) {
    advance();
    tempvar2 = factor();
    printf("    %s *= %s\n", tempvar, tempvar2);
    freename(tempvar2);
  }
  return tempvar;
}


x86 assembly (clang, -O0):
<term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1070 <factor@plt>
mov    %rax,-0x8(%rbp)
mov    $0x3,%edi
call   1060 <match@plt>
cmp    $0x0,%rax
je     11ab <term+0x5b>
mov    $0x0,%al
call   1050 <advance@plt>
mov    $0x0,%al
call   1070 <factor@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe68(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <freename@plt>
jmp    1163 <term+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1070 <factor@plt>
mov    %rax,%r15
mov    $0x3,%edi
call   1060 <match@plt>
test   %rax,%rax
je     11b6 <term+0x66>
lea    0xe8b(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1050 <advance@plt>
xor    %eax,%eax
call   1070 <factor@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <freename@plt>
mov    $0x3,%edi
call   1060 <match@plt>
test   %rax,%rax
jne    1180 <term+0x30>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c" %s *= %s\0A\00"
define i8* @term() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @factor()
store i8* %3, i8** %1
br label %4
4: ; preds = %7, %0
%5 = call i64 @match(i32 3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = call i32 (...) @advance()
%9 = call i8* (...) @factor()
store i8* %9, i8** %2
%10 = load i8*, i8** %1
%11 = load i8*, i8** %2
%12 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
%13 = load i8*, i8** %2
%14 = call i32 @freename(i8* %13)
br label %4
15: ; preds = %4
%16 = load i8*, i8** %1
ret i8* %16
}

LLVM IR (-O2):
@.str = [14 x i8] c" %s *= %s\0A\00"
define i8* @term() {
%1 = tail call i8* (...) @factor()
%2 = tail call i64 @match(i32 3)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @advance()
%6 = tail call i8* (...) @factor()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %6)
%8 = tail call i32 @freename(i8* %6)
%9 = tail call i64 @match(i32 3)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %0
ret i8* %1
}
/* Variables and functions */
scalar_t__ chdir(char *);
int errno;
int /*<<< orphan*/ perror(char *);
int changedir(char *dir) {
  if (chdir(dir) < 0) {
    perror(dir);
    return (errno);
  }
  return 0;
}


x86 assembly (clang, -O0):
<changedir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <chdir@plt>
cmp    $0x0,%rax
jge    1159 <changedir+0x39>
mov    -0x10(%rbp),%rdi
call   1040 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <changedir+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<changedir>:
push   %rbx
mov    %rdi,%rbx
call   1030 <chdir@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     1135 <changedir+0x15>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @changedir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @chdir(i8* %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @perror(i8* %8)
%10 = load i32, i32* @errno
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @changedir(i8* %0) {
%2 = tail call i64 @chdir(i8* %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
%6 = load i32, i32* @errno
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
ret i32 %8
}