xunge/DecIR huggingface dataset:
int null_test_deref_basic_ok() {
  int x = 0;
  int *p = &x;
  int ret = *p;
  if (p == 0)
    return -1;
  return ret;
}


x86 assembly (clang, -O0):
<null_test_deref_basic_ok>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <null_test_deref_basic_ok+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    1139 <null_test_deref_basic_ok+0x39>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @null_test_deref_basic_ok() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, int *, float *);
int main() {
  int X;
  float Y, Z;
  scanf("%d%f", &X, &Y);
  Z = X / Y;
  printf("%.3f km/l\n", Z);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"%d%f\00"
@.str.1 = [11 x i8] c"%.3f km/l\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, float* %3)
%6 = load i32, i32* %2
%7 = sitofp i32 %6 to float
%8 = load float, float* %3
%9 = fdiv float %7, %8
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%f\00"
@.str.1 = [11 x i8] c"%.3f km/l\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = bitcast i32* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, float* %2)
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to float
%8 = load float, float* %2
%9 = fdiv float %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void argerror(char *progname) {
  fprintf(stderr, "Usage: %s file [-o file]\n", progname);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<argerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<argerror>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: %s file [-o file]\0A\00"
@EXIT_FAILURE = global i32 0
define void @argerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: %s file [-o file]\0A\00"
@EXIT_FAILURE = global i32 0
define void @argerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
scalar_t__ valve_close();
scalar_t__ valve_open();
int valve_cycle() {
  if (valve_open() < 0)
    return (-1);
  sleep(1);
  if (valve_close() < 0)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<valve_cycle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <valve_open@plt>
cmp    $0x0,%rax
jge    1155 <valve_cycle+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    1183 <valve_cycle+0x53>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x0,%al
call   1030 <valve_close@plt>
cmp    $0x0,%rax
jge    117c <valve_cycle+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1183 <valve_cycle+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valve_cycle>:
push   %rax
xor    %eax,%eax
call   1040 <valve_open@plt>
test   %rax,%rax
js     1154 <valve_cycle+0x24>
mov    $0x1,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
call   1030 <valve_close@plt>
sar    $0x3f,%rax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @valve_cycle() {
%1 = tail call i64 (...) @valve_open()
%2 = icmp slt i64 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 @sleep(i32 1)
%5 = tail call i64 (...) @valve_close()
%6 = ashr i64 %5, 63
%7 = trunc i64 %6 to i32
br label %8
8: ; preds = %3, %0
%9 = phi i32 [ -1, %0 ], [ %7, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int ErrorExit(int code) {
  fprintf(stderr, "Fatal error code %d\n", code);
  return code;
}


x86 assembly (clang, -O0):
<ErrorExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ErrorExit>:
push   %rbx
mov    %edi,%ebx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Fatal error code %d\0A\00"
define i32 @ErrorExit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Fatal error code %d\0A\00"
define i32 @ErrorExit(i32 returned %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a = 9;
  int b = 3;
  int *p = &b;
  int c = a / (*p);
  printf("%d \n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x9,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
cltd
idivl  (%rcx)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
int rand_neg(void) {
  static unsigned int neg = 0;
  static int sign[8] = {0, 0, 0, 1, 1, 0, 1, 1};
  return (sign[(neg++) % 8]);
}


x86 assembly (clang, -O0):
<rand_neg>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f4a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f3f(%rip)
and    $0x7,%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0x2f0d(%rip),%rax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_neg>:
mov    0x2f1e(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f15(%rip)
and    $0x7,%eax
lea    0xee7(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@rand_neg.neg = internal global i32 0
@rand_neg.sign = internal global [8 x i32] [i32 0, i32 0, i32 0, i32 1, i32 1, i32 0, i32 1, i32 1]
define i32 @rand_neg() {
%1 = load i32, i32* @rand_neg.neg
%2 = add i32 %1, 1
store i32 %2, i32* @rand_neg.neg
%3 = urem i32 %1, 8
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [8 x i32], [8 x i32]* @rand_neg.sign, i64 0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
@rand_neg.neg = internal unnamed_addr global i32 0
@rand_neg.sign = internal unnamed_addr constant [8 x i32] [i32 0, i32 0, i32 0, i32 1, i32 1, i32 0, i32 1, i32 1]
define i32 @rand_neg() {
%1 = load i32, i32* @rand_neg.neg
%2 = add i32 %1, 1
store i32 %2, i32* @rand_neg.neg
%3 = and i32 %1, 7
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [8 x i32], [8 x i32]* @rand_neg.sign, i64 0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x26_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x26_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x26_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x26_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x26_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printmatw(double *, int, int, int);
void printmat(double *a, int m, int n) { printmatw(a, m, n, 5); }


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

x86 assembly (clang, -O2):
<printmat>:
mov    $0x5,%ecx
jmp    1030 <printmatw@plt>

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

LLVM IR (-O2):
define void @printmat(double* %0, i32 %1, i32 %2) {
%4 = tail call i32 @printmatw(double* %0, i32 %1, i32 %2, i32 5)
ret void
}
/* Variables and functions */
double log10(float);
unsigned long pow(int, int);
float round(float);
float DectodB(unsigned long int decimaldigit) {
  float temp = 0.0;
  temp = decimaldigit * pow(2, -23);
  temp = 20.0 * log10(temp);
  temp = round(temp);
  return temp;
}


x86 assembly (clang, -O0):
<DectodB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x2,%edi
mov    $0xffffffe9,%esi
call   1030 <pow@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
imul   %rcx,%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x14(%rbp)
test   %rax,%rax
movss  %xmm0,-0x10(%rbp)
js     119e <DectodB+0x6e>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1050 <log10@plt>
movaps %xmm0,%xmm1
movsd  0xe43(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <round@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DectodB>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%edi
mov    $0xffffffe9,%esi
call   1030 <pow@plt>
imul   %rbx,%rax
test   %rax,%rax
js     1153 <DectodB+0x23>
cvtsi2ss %rax,%xmm0
jmp    1168 <DectodB+0x38>
mov    %rax,%rcx
shr    %rcx
and    $0x1,%eax
or     %rcx,%rax
cvtsi2ss %rax,%xmm0
addss  %xmm0,%xmm0
call   1040 <log10@plt>
mulsd  0xe8b(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbx
jmp    1050 <roundf@plt>

LLVM IR (-O0):
define float @DectodB(i64 %0) {
%2 = alloca i64
%3 = alloca float
store i64 %0, i64* %2
store float 0.000000e+00, float* %3
%4 = load i64, i64* %2
%5 = call i64 @pow(i32 2, i32 -23)
%6 = mul i64 %4, %5
%7 = uitofp i64 %6 to float
store float %7, float* %3
%8 = load float, float* %3
%9 = call double @log10(float %8)
%10 = fmul double 2.000000e+01, %9
%11 = fptrunc double %10 to float
store float %11, float* %3
%12 = load float, float* %3
%13 = call float @round(float %12)
store float %13, float* %3
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @DectodB(i64 %0) {
%2 = tail call i64 @pow(i32 2, i32 -23)
%3 = mul i64 %2, %0
%4 = uitofp i64 %3 to float
%5 = tail call double @log10(float %4)
%6 = fmul double %5, 2.000000e+01
%7 = fptrunc double %6 to float
%8 = tail call float @llvm.round.f32(float %7)
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ TimerHardware_StartTimer();
int /*<<< orphan*/ intervalTimer_initAll();
void TimerHardware_Init() {
  intervalTimer_initAll();
  TimerHardware_StartTimer();
}


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

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

LLVM IR (-O0):
define void @TimerHardware_Init() {
%1 = call i32 (...) @intervalTimer_initAll()
%2 = call i32 (...) @TimerHardware_StartTimer()
ret void
}

LLVM IR (-O2):
define void @TimerHardware_Init() {
%1 = tail call i32 (...) @intervalTimer_initAll()
%2 = tail call i32 (...) @TimerHardware_StartTimer()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int __attribute__((weak)) pthread_mutex_unlock(pthread_mutex_t *mutex) {
  (void)mutex;
  return 0;
}


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

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

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

LLVM IR (-O2):
define weak i32 @pthread_mutex_unlock(i32* %0) {
ret i32 0
}
/* Variables and functions */
double ranf();
int sample_Bin(double pi) { return (ranf() < pi); }


x86 assembly (clang, -O0):
<sample_Bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <ranf@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample_Bin>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <ranf@plt>
xor    %eax,%eax
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sample_Bin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @ranf()
%4 = load double, double* %2
%5 = fcmp olt double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @sample_Bin(double %0) {
%2 = tail call double (...) @ranf()
%3 = fcmp olt double %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_silence_memblock() {
  printf("NOT IMPLEMENTED:"
         "pa_silence_memblock"
         "\n");
}


x86 assembly (clang, -O0):
<pa_silence_memblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [37 x i8] c"NOT IMPLEMENTED:pa_silence_memblock\0A\00"
define i32 @pa_silence_memblock() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_silence_memblock\00"
define i32 @pa_silence_memblock() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ opt;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                      unsigned int *, int);
int os_set_reuseaddr(int fd) {
  unsigned int opt = 1;
  return (0 == setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)));
}


x86 assembly (clang, -O0):
<os_set_reuseaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_set_reuseaddr>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @os_set_reuseaddr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_REUSEADDR
%7 = call i64 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
%8 = icmp eq i64 0, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @os_set_reuseaddr(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEADDR
%6 = call i64 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
START_TEST(test_machinetalk) { ck_assert_int_eq(0, 0); }


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

x86 assembly (clang, -O2):
<START_TEST>:
xor    %edi,%edi
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <ck_assert_int_eq@plt>

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

LLVM IR (-O2):
define i32 @START_TEST(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @ck_assert_int_eq to i32 (i32, i32, ...)*)(i32 0, i32 0)
ret i32 undef
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
int htonl(int);
u_int32_t make_ip_addr(int a, int b, int c, int d) {
  u_int32_t l;
  l = ((a << 24) & 0xff000000) | ((b << 16) & 0xff0000) | ((c << 8) & 0xff00) |
      (d & 0xff);
  return htonl(l);
}


x86 assembly (clang, -O0):
<make_ip_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
and    $0xff000000,%eax
mov    -0x8(%rbp),%ecx
shl    $0x10,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <htonl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_ip_addr>:
shl    $0x18,%edi
movzbl %sil,%eax
shl    $0x10,%eax
or     %eax,%edi
shl    $0x8,%edx
movzwl %dx,%eax
or     %eax,%edi
movzbl %cl,%eax
or     %eax,%edi
jmp    1030 <htonl@plt>

LLVM IR (-O0):
define i32 @make_ip_addr(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = shl i32 %10, 24
%12 = and i32 %11, -16777216
%13 = load i32, i32* %6
%14 = shl i32 %13, 16
%15 = and i32 %14, 16711680
%16 = or i32 %12, %15
%17 = load i32, i32* %7
%18 = shl i32 %17, 8
%19 = and i32 %18, 65280
%20 = or i32 %16, %19
%21 = load i32, i32* %8
%22 = and i32 %21, 255
%23 = or i32 %20, %22
store i32 %23, i32* %9
%24 = load i32, i32* %9
%25 = call i32 @htonl(i32 %24)
ret i32 %25
}

LLVM IR (-O2):
define i32 @make_ip_addr(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %0, 24
%6 = shl i32 %1, 16
%7 = and i32 %6, 16711680
%8 = or i32 %7, %5
%9 = shl i32 %2, 8
%10 = and i32 %9, 65280
%11 = or i32 %8, %10
%12 = and i32 %3, 255
%13 = or i32 %11, %12
%14 = tail call i32 @htonl(i32 %13)
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ h2o__fatal(char *);
void *malloc(size_t);
void *h2o_mem_alloc(size_t sz) {
  void *p = malloc(sz);
  if (p == NULL)
    h2o__fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/cubicdaiya/h2o/refs/heads/"
               "master/lib/common/h2o/memory.h"
               ":"
               "330"
               ":"
               "no memory");
  return p;
}


x86 assembly (clang, -O0):
<h2o_mem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <h2o_mem_alloc+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_mem_alloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <h2o_mem_alloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [161 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cubicdaiya/h2o/refs/heads/master/lib/common/h2o/memory.h:330:no memory\00"
define i8* @h2o_mem_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @h2o__fatal(i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [161 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cubicdaiya/h2o/refs/heads/master/lib/common/h2o/memory.h:330:no memory\00"
define noalias i8* @h2o_mem_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @h2o__fatal(i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int fn_b(int x) { return x + 1; }


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

x86 assembly (clang, -O2):
<fn_b>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @fn_b(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @fn_b(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
void nullvc(int nparam, double *x) {
  int i;
  for (i = 1; i <= nparam; i++)
    x[i] = 0.e0;
  return;
}


x86 assembly (clang, -O0):
<nullvc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     113c <nullvc+0x3c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <nullvc+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullvc>:
test   %edi,%edi
jle    112d <nullvc+0x1d>
push   %rax
add    $0x8,%rsi
mov    %edi,%edx
shl    $0x3,%rdx
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @nullvc(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
store i32 1, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load double*, double** %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
store double 0.000000e+00, double* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @nullvc(i32 %0, double* nocapture writeonly %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = getelementptr double, double* %1, i64 1
%6 = bitcast double* %5 to i8*
%7 = zext i32 %0 to i64
%8 = shl nuw nsw i64 %7, 3
br label %9
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int getpid();
int utils_get_pid() { return getpid(); }


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

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

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

LLVM IR (-O2):
define i32 @utils_get_pid() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void cleanup() { unlink("test.txt"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
define void @cleanup() {
%1 = call i32 @unlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
define void @cleanup() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ button_update();
void update_all_inputs(void) {
  button_update();
  return;
}


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

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

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

LLVM IR (-O2):
define void @update_all_inputs() {
%1 = tail call i32 (...) @button_update()
ret void
}
double MaxDouble(double a, double b) { return (a >= b) ? a : b; }


x86 assembly (clang, -O0):
<MaxDouble>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     112d <MaxDouble+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <MaxDouble+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MaxDouble>:
movapd %xmm1,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @MaxDouble(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
void no_op(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @no_op(i8* nocapture %0, ...) {
ret void
}
void irq_null_end(void) {}


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

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

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

LLVM IR (-O2):
define void @irq_null_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x;
  int y;
  ({
    x = 1;
    x;
  });
  assert(x == 1);
  x = ({
    y = 1;
    2;
  });
  assert(x == 2);
  assert(y == 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x1,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%6 = load i32, i32* %2
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
store i32 1, i32* %3
store i32 2, i32* %5
%12 = load i32, i32* %5
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 2
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 1
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t signed_multiply_32x16t(int32_t a, uint32_t b) {}


x86 assembly (clang, -O0):
<signed_multiply_32x16t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @signed_multiply_32x16t(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _dictStringCopyHTKeyDestructor(void *privdata, void *key) {
  ((void)privdata);
  free((void *)key);
}


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

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

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

LLVM IR (-O2):
define void @_dictStringCopyHTKeyDestructor(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
void border_nw_ext_corner_special_sand_long_vert(unsigned char *pic,
                                                 unsigned char *mirr) {
  *pic = 0x2F;
  *mirr = 0x01 | 0x02;
}


x86 assembly (clang, -O0):
<border_nw_ext_corner_special_sand_long_vert>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x2f,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x3,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_nw_ext_corner_special_sand_long_vert>:
movb   $0x2f,(%rdi)
movb   $0x3,(%rsi)
ret

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

LLVM IR (-O2):
define void @border_nw_ext_corner_special_sand_long_vert(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
store i8 47, i8* %0
store i8 3, i8* %1
ret void
}
/* Variables and functions */
int rand();
int roll_dice(void) {
  int x, y;
  x = (rand() % 6) + 1;
  y = (rand() % 6) + 1;
  return x + y;
}


x86 assembly (clang, -O0):
<roll_dice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roll_dice>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rbx
imul   $0x2aaaaaab,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
add    %ebx,%eax
add    $0x2,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @roll_dice() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 6
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = call i32 (...) @rand()
%7 = srem i32 %6, 6
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @roll_dice() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 6
%5 = add nsw i32 %2, 2
%6 = add nsw i32 %5, %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: ./a.out [my_addr] [my_port] [your_addr] [your_port]\n");
  exit(errno);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"Usage: ./a.out [my_addr] [my_port] [your_addr] [your_port]\0A\00"
@errno = global i32 0
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @errno
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
@str = [59 x i8] c"Usage: ./a.out [my_addr] [my_port] [your_addr] [your_port]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @errno
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Type definitions */
struct PKplex_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
int PKplex_cmdline_parser_required(struct PKplex_args_info *args_info,
                                   const char *prog_name) {
  (void)(args_info);
  (void)(prog_name);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<PKplex_cmdline_parser_required>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PKplex_cmdline_parser_required>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.PKplex_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @PKplex_cmdline_parser_required(%struct.PKplex_args_info* %0, i8* %1) {
%3 = alloca %struct.PKplex_args_info*
%4 = alloca i8*
store %struct.PKplex_args_info* %0, %struct.PKplex_args_info** %3
store i8* %1, i8** %4
%5 = load %struct.PKplex_args_info*, %struct.PKplex_args_info** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
%struct.PKplex_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @PKplex_cmdline_parser_required(%struct.PKplex_args_info* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Ptngc_i32x2_to_d(unsigned long const, unsigned long const);
int /*<<< orphan*/ unquantize(double *, int const, int const,
                              int /*<<< orphan*/, int *);
void tng_compress_int_to_double(int *posvel_int, const unsigned long prec_hi,
                                const unsigned long prec_lo, const int natoms,
                                const int nframes, double *posvel_double) {
  unquantize(posvel_double, natoms, nframes,
             (Ptngc_i32x2_to_d(prec_hi, prec_lo)), posvel_int);
}


x86 assembly (clang, -O0):
<tng_compress_int_to_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <Ptngc_i32x2_to_d@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%esi
mov    -0x2c(%rbp),%edx
mov    %eax,%ecx
mov    -0x8(%rbp),%r8
call   1030 <unquantize@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tng_compress_int_to_double>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r9,%r15
mov    %r8d,%r14d
mov    %ecx,%ebp
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <Ptngc_i32x2_to_d@plt>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %eax,%ecx
mov    %rbx,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <unquantize@plt>

LLVM IR (-O0):
define void @tng_compress_int_to_double(i32* %0, i64 %1, i64 %2, i32 %3, i32 %4, double* %5) {
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
store i32* %0, i32** %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store double* %5, double** %12
%13 = load double*, double** %12
%14 = load i32, i32* %10
%15 = load i32, i32* %11
%16 = load i64, i64* %8
%17 = load i64, i64* %9
%18 = call i32 @Ptngc_i32x2_to_d(i64 %16, i64 %17)
%19 = load i32*, i32** %7
%20 = call i32 @unquantize(double* %13, i32 %14, i32 %15, i32 %18, i32* %19)
ret void
}

LLVM IR (-O2):
define void @tng_compress_int_to_double(i32* %0, i64 %1, i64 %2, i32 %3, i32 %4, double* %5) {
%7 = tail call i32 @Ptngc_i32x2_to_d(i64 %1, i64 %2)
%8 = tail call i32 @unquantize(double* %5, i32 %3, i32 %4, i32 %7, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
void earlyeof(void) { errx(1, "premature EOF in JSON data"); }


x86 assembly (clang, -O0):
<earlyeof>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <errx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<earlyeof>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"premature EOF in JSON data\00"
define void @earlyeof() {
%1 = call i32 @errx(i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"premature EOF in JSON data\00"
define void @earlyeof() {
%1 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ invertString(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char input[] = "Diederich is een goede docent!";
  printf("Input: %s\n", input);
  invertString(input);
  printf("Output: %s\n", input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0x14(%rbp)
mov    0xeb4(%rip),%al
mov    %al,-0x12(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1040 <invertString@plt>
lea    -0x30(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xee3(%rip),%xmm0
movups %xmm0,0xf(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xedc(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <invertString@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.input = [31 x i8] c"Diederich is een goede docent!\00"
@.str = [11 x i8] c"Input: %s\0A\00"
@.str.1 = [12 x i8] c"Output: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [31 x i8]
store i32 0, i32* %1
%3 = bitcast [31 x i8]* %2 to i8*
%4 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 0
%7 = call i32 @invertString(i8* %6)
%8 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.input = [31 x i8] c"Diederich is een goede docent!\00"
@.str = [11 x i8] c"Input: %s\0A\00"
@.str.1 = [12 x i8] c"Output: %s\0A\00"
define i32 @main() {
%1 = alloca [31 x i8]
%2 = getelementptr inbounds [31 x i8], [31 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @invertString(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *xmalloc(int, char const *);
char *xstrdup(const char *str, const char *caller) {
  char *out = xmalloc((strlen(str) + 1) * sizeof(*out), caller);
  strcpy(out, str);
  return out;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1050 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
mov    %r14,%rsi
call   1050 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 1
%11 = trunc i64 %10 to i32
%12 = load i8*, i8** %4
%13 = call i8* @xmalloc(i32 %11, i8* %12)
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = load i8*, i8** %3
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 1
%5 = tail call i8* @xmalloc(i32 %4, i8* %1)
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}