xunge/DecIR huggingface dataset:
A0AR1(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (*((float *)10000000)) = (p1[1111111 / 4]); }


x86 assembly (clang, -O0):
<A0AR1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movss  0x10f444(%rax),%xmm0
mov    $0x989680,%eax
movss  %xmm0,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<A0AR1>:
movss  0x10f444(%rcx),%xmm0
movss  %xmm0,0x989680
ret

LLVM IR (-O0):
define i32 @A0AR1(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float*, float** %13
%17 = getelementptr inbounds float, float* %16, i64 277777
%18 = load float, float* %17
store float %18, float* inttoptr (i64 10000000 to float*)
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @A0AR1(double %0, double %1, i32 %2, i32 %3, float* nocapture readnone %4, float* nocapture %5) {
%7 = getelementptr inbounds float, float* %5, i64 277777
%8 = load float, float* %7
store float %8, float* inttoptr (i64 10000000 to float*)
ret i32 undef
}
int noDir() {
  int a = 6;
  int b = a;
  a = b;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @noDir() {
ret i32 6
}
int ceasarNumber(char character) {
  int ret = 0;
  if (character > 'e')
    ret = -(character - 'e');
  else
    ret = 'e' - character;
  return ret;
}


x86 assembly (clang, -O0):
<ceasarNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x65,%eax
jle    1131 <ceasarNumber+0x31>
movsbl -0x1(%rbp),%ecx
sub    $0x65,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    113f <ceasarNumber+0x3f>
movsbl -0x1(%rbp),%ecx
mov    $0x65,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceasarNumber>:
mov    $0x65,%eax
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ceasarNumber(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = sub nsw i32 101, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printArray(int *, int);
int main() {
  int i, array[15];
  for (i = 0; i <= 15 - 1; i++)
    array[i] = 2 * i;
  printArray(array, 15);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xe,-0x8(%rbp)
jg     114c <main+0x3c>
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x50(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
lea    -0x50(%rbp),%rdi
mov    $0xf,%esi
call   1030 <printArray@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xeea(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeee(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movabs $0x1a00000018,%rax
mov    %rax,0x30(%rsp)
movl   $0x1c,0x38(%rsp)
mov    %rsp,%rdi
mov    $0xf,%esi
call   1030 <printArray@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [15 x i32]
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 14
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %2
%9 = mul nsw i32 2, %8
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [15 x i32], [15 x i32]* %3, i64 0, i64 %11
store i32 %9, i32* %12
br label %13
13: ; preds = %7
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %4
16: ; preds = %4
%17 = getelementptr inbounds [15 x i32], [15 x i32]* %3, i64 0, i64 0
%18 = call i32 @printArray(i32* %17, i32 15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [15 x i32]
%2 = bitcast [15 x i32]* %1 to i8*
%3 = getelementptr inbounds [15 x i32], [15 x i32]* %1, i64 0, i64 0
%4 = bitcast [15 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 0, i32 2, i32 4, i32 6>, <4 x i32>* %4
%5 = getelementptr inbounds [15 x i32], [15 x i32]* %1, i64 0, i64 4
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 8, i32 10, i32 12, i32 14>, <4 x i32>* %6
%7 = getelementptr inbounds [15 x i32], [15 x i32]* %1, i64 0, i64 8
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 16, i32 18, i32 20, i32 22>, <4 x i32>* %8
%9 = getelementptr inbounds [15 x i32], [15 x i32]* %1, i64 0, i64 12
store i32 24, i32* %9
%10 = getelementptr inbounds [15 x i32], [15 x i32]* %1, i64 0, i64 13
store i32 26, i32* %10
%11 = getelementptr inbounds [15 x i32], [15 x i32]* %1, i64 0, i64 14
store i32 28, i32* %11
%12 = call i32 @printArray(i32* %3, i32 15)
ret i32 0
}
int pldummy_png() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pldummy_png() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
void FN_double_lock_bad(pthread_mutex_t *m) {
  pthread_mutex_lock(m);
  pthread_mutex_lock(m);
}


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

x86 assembly (clang, -O2):
<FN_double_lock_bad>:
push   %rbx
mov    %rdi,%rbx
call   1030 <pthread_mutex_lock@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <pthread_mutex_lock@plt>

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

LLVM IR (-O2):
define void @FN_double_lock_bad(i32* %0) {
%2 = tail call i32 @pthread_mutex_lock(i32* %0)
%3 = tail call i32 @pthread_mutex_lock(i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_hour;
  int tm_min;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int get_time_slot(time_t when) {
  int time_slot;
  struct tm *t = localtime(&when);
  time_slot = t->tm_hour * 2;
  if (t->tm_min >= 30)
    time_slot++;
  return time_slot;
}


x86 assembly (clang, -O0):
<get_time_slot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x1e,0x4(%rax)
jl     114b <get_time_slot+0x3b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_slot>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%ecx
xor    %edx,%edx
cmpl   $0x1e,0x4(%rax)
setge  %dl
lea    (%rdx,%rcx,2),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32 }
define i32 @get_time_slot(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.tm*
store i32 %0, i32* %2
%5 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %5, %struct.tm** %4
%6 = load %struct.tm*, %struct.tm** %4
%7 = getelementptr inbounds %struct.tm, %struct.tm* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 2
store i32 %9, i32* %3
%10 = load %struct.tm*, %struct.tm** %4
%11 = getelementptr inbounds %struct.tm, %struct.tm* %10, i32 0, i32 1
%12 = load i32, i32* %11
%13 = icmp sge i32 %12, 30
br i1 %13, label %14, label %17
14: ; preds = %1
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %17
17: ; preds = %14, %1
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.tm = type { i32, i32 }
define i32 @get_time_slot(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call %struct.tm* @localtime(i32* %2)
%4 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = shl nsw i32 %5, 1
%7 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 1
%8 = load i32, i32* %7
%9 = icmp sgt i32 %8, 29
%10 = zext i1 %9 to i32
%11 = or i32 %6, %10
ret i32 %11
}
int check_char(char *prev, char *curr) {
  if ((*prev == ' ') && (*curr == '\n')) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1138 <check_char+0x38>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1138 <check_char+0x38>
movl   $0x1,-0x4(%rbp)
jmp    113f <check_char+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_char>:
cmpb   $0x20,(%rdi)
jne    110f <check_char+0xf>
mov    $0x1,%eax
cmpb   $0xa,(%rsi)
je     1111 <check_char+0x11>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @check_char(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i8, i8* %1
%7 = icmp eq i8 %6, 10
br i1 %7, label %9, label %8
8: ; preds = %5, %2
br label %9
9: ; preds = %5, %8
%10 = phi i32 [ 0, %8 ], [ 1, %5 ]
ret i32 %10
}
int bit_convert(int data, int maxbit) {
  if (data & (1 << (maxbit - 1))) {
    data -= (1 << maxbit);
  }
  return data;
}


x86 assembly (clang, -O0):
<bit_convert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     113b <bit_convert+0x3b>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_convert>:
mov    %esi,%ecx
lea    -0x1(%rcx),%eax
movzbl %al,%edx
mov    $0xffffffff,%esi
shl    %cl,%esi
xor    %eax,%eax
bt     %edx,%edi
cmovb  %esi,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @bit_convert(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 = sub nsw i32 %6, 1
%8 = shl i32 1, %7
%9 = and i32 %5, %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* %4
%13 = shl i32 1, %12
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, %13
store i32 %15, i32* %3
br label %16
16: ; preds = %11, %2
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @bit_convert(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = shl nuw i32 1, %3
%5 = and i32 %4, %0
%6 = icmp eq i32 %5, 0
%7 = shl nsw i32 -1, %1
%8 = select i1 %6, i32 0, i32 %7
%9 = add i32 %8, %0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ _pmu(int);
int pigpio_command(int, int, unsigned int, unsigned int, int /*<<< orphan*/);
int recvMax(int, char *, unsigned int, int);
int serial_read(int pi, unsigned handle, char *buf, unsigned count) {
  int bytes;
  bytes = pigpio_command(pi, 80, handle, count, 0);
  if (bytes > 0) {
    bytes = recvMax(pi, buf, count, bytes);
  }
  _pmu(pi);
  return bytes;
}


x86 assembly (clang, -O0):
<serial_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    $0x50,%esi
xor    %r8d,%r8d
call   1040 <pigpio_command@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    117d <serial_read+0x4d>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1050 <recvMax@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_pmu@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_read>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %esi,%edx
mov    %edi,%ebx
mov    $0x50,%esi
xor    %r8d,%r8d
call   1040 <pigpio_command@plt>
mov    %eax,%ebp
test   %eax,%eax
jle    1165 <serial_read+0x35>
mov    %ebx,%edi
mov    %r15,%rsi
mov    %r14d,%edx
mov    %ebp,%ecx
call   1050 <recvMax@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <_pmu@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @serial_read(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %8
%13 = call i32 @pigpio_command(i32 %10, i32 80, i32 %11, i32 %12, i32 0)
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %4
%17 = load i32, i32* %5
%18 = load i8*, i8** %7
%19 = load i32, i32* %8
%20 = load i32, i32* %9
%21 = call i32 @recvMax(i32 %17, i8* %18, i32 %19, i32 %20)
store i32 %21, i32* %9
br label %22
22: ; preds = %16, %4
%23 = load i32, i32* %5
%24 = call i32 @_pmu(i32 %23)
%25 = load i32, i32* %9
ret i32 %25
}

LLVM IR (-O2):
define i32 @serial_read(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @pigpio_command(i32 %0, i32 80, i32 %1, i32 %3, i32 0)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @recvMax(i32 %0, i8* %2, i32 %3, i32 %5)
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %8, %7 ], [ %5, %4 ]
%11 = tail call i32 @_pmu(i32 %0)
ret i32 %10
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/cf_flowinfo.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/cf_flowinfo.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/cf_flowinfo.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void test_print(char *text) {
  fprintf(stderr, text);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<test_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_print>:
push   %rbx
mov    %rdi,%rsi
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @test_print(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* %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fflush(i32 %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @test_print(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
ret void
}
void setup_kexec_cpu_down_mpic(void) {}


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

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

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

LLVM IR (-O2):
define void @setup_kexec_cpu_down_mpic() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void cli_print_error(int error) {
  printf("Returned with error code %d\r\n", error);
}


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

x86 assembly (clang, -O2):
<cli_print_error>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Returned with error code %d\0D\0A\00"
define void @cli_print_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Returned with error code %d\0D\0A\00"
define void @cli_print_error(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_unpackhi_epi32(int /*<<< orphan*/ const,
                                      int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm_unpacklo_epi64(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i extract_quarter_3_epi16_sse2(const __m128i *const reg) {
  __m128i tmp = _mm_unpackhi_epi32(*reg, *reg);
  return _mm_unpacklo_epi64(tmp, tmp);
}


x86 assembly (clang, -O0):
<extract_quarter_3_epi16_sse2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
call   1040 <_mm_unpackhi_epi32@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <_mm_unpacklo_epi64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_quarter_3_epi16_sse2>:
push   %rax
mov    (%rdi),%edi
mov    %edi,%esi
call   1040 <_mm_unpackhi_epi32@plt>
mov    %eax,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <_mm_unpacklo_epi64@plt>

LLVM IR (-O0):
define i32 @extract_quarter_3_epi16_sse2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = call i32 @_mm_unpackhi_epi32(i32 %5, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @_mm_unpacklo_epi64(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @extract_quarter_3_epi16_sse2(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @_mm_unpackhi_epi32(i32 %2, i32 %2)
%4 = tail call i32 @_mm_unpacklo_epi64(i32 %3, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ nsc_assert(int);
void ttyflush(void) {
  nsc_assert(0 && "This function is unimplemented.");
  ;
}


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

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

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

LLVM IR (-O2):
define void @ttyflush() {
%1 = tail call i32 @nsc_assert(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_once_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_once(int /*<<< orphan*/ *, void (*)());
void Pthread_once(pthread_once_t *once_control, void (*init_function)()) {
  pthread_once(once_control, init_function);
}


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

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

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

LLVM IR (-O2):
define void @Pthread_once(i32* %0, void (...)* %1) {
%3 = tail call i32 @pthread_once(i32* %0, void (...)* %1)
ret void
}
int main() {
  int x = 0;
  int *px = &x;
  int *ppx[1];
  ppx[0] = &px;
  return *(ppx[0]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    -0x4(%rsp),%rax
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = ptrtoint i32* %1 to i64
%4 = trunc i64 %3 to i32
ret i32 %4
}
char *RCSid() {
  return RCSid("$Id: doc2html.c,v 1.6 2011/05/25 06:14:27 markisch Exp $");
}


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

x86 assembly (clang, -O2):
<RCSid>:
jmp    1100 <RCSid>

LLVM IR (-O0):
@.str = [57 x i8] c"$Id: doc2html.c,v 1.6 2011/05/25 06:14:27 markisch Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
struct lconv {
  char *positive_sign;
};

/* Variables and functions */
struct lconv *localeconv();
int /*<<< orphan*/ printf(char *, char *, char);
int main(void) {
  struct lconv *lconv = localeconv();
  printf("%s  %d\n", lconv->positive_sign, lconv->positive_sign[0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <localeconv@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
lea    0xeb1(%rip),%rdi
movsbl (%rax),%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <localeconv@plt>
mov    (%rax),%rsi
movsbl (%rsi),%edx
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.lconv = type { i8* }
@.str = [8 x i8] c"%s %d\0A\00"
define i32 @main() {
%1 = tail call %struct.lconv* (...) @localeconv()
%2 = getelementptr inbounds %struct.lconv, %struct.lconv* %1, i64 0, i32 0
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3, i8 signext %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ h2o__fatal(char *, int, 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/cwyang/h2o/refs/heads/master/"
               "include/h2o/memory.h",
               375, "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    115c <h2o_mem_alloc+0x3c>
lea    0xeb5(%rip),%rdi
mov    $0x177,%esi
lea    0xf35(%rip),%rdx
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    1146 <h2o_mem_alloc+0x26>
lea    0xecb(%rip),%rdi
lea    0xf50(%rip),%rdx
mov    $0x177,%esi
call   1030 <h2o__fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cwyang/h2o/refs/heads/master/include/h2o/memory.h\00"
@.str.1 = [10 x i8] c"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 ([140 x i8], [140 x i8]* @.str, i64 0, i64 0), i32 375, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cwyang/h2o/refs/heads/master/include/h2o/memory.h\00"
@.str.1 = [10 x i8] c"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 ([140 x i8], [140 x i8]* @.str, i64 0, i64 0), i32 375, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ printw(char *, long long);
int /*<<< orphan*/ refresh();
int nplot(long long dialnum, int row, int col) {
  move(row, col);
  printw("%lld", dialnum);
  refresh();
  return 0;
}


x86 assembly (clang, -O0):
<nplot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1050 <move@plt>
mov    -0x8(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1030 <printw@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nplot>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
mov    %edx,%esi
call   1050 <move@plt>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printw@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
define i32 @nplot(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = call i32 @move(i32 %7, i32 %8)
%10 = load i64, i64* %4
%11 = call i32 @printw(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = call i32 (...) @refresh()
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
define i32 @nplot(i64 %0, i32 %1, i32 %2) {
%4 = tail call i32 @move(i32 %1, i32 %2)
%5 = tail call i32 @printw(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %0)
%6 = tail call i32 (...) @refresh()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
void pointer_doesnt_leak_from_loop() {
  int *h_ptr = (int *)malloc(sizeof(int));
  for (int i = 0; i < 2; ++i) {
  }
  for (int i = 0; i < 10; ++i) {
  }
  free(h_ptr);
}


x86 assembly (clang, -O0):
<pointer_doesnt_leak_from_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    115a <pointer_doesnt_leak_from_loop+0x3a>
jmp    114c <pointer_doesnt_leak_from_loop+0x2c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <pointer_doesnt_leak_from_loop+0x1d>
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    117e <pointer_doesnt_leak_from_loop+0x5e>
jmp    1170 <pointer_doesnt_leak_from_loop+0x50>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1161 <pointer_doesnt_leak_from_loop+0x41>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pointer_doesnt_leak_from_loop>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @pointer_doesnt_leak_from_loop() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i32
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %1
store i32 0, i32* %2
br label %6
6: ; preds = %10, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %13
9: ; preds = %6
br label %10
10: ; preds = %9
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %6
13: ; preds = %6
store i32 0, i32* %3
br label %14
14: ; preds = %18, %13
%15 = load i32, i32* %3
%16 = icmp slt i32 %15, 10
br i1 %16, label %17, label %21
17: ; preds = %14
br label %18
18: ; preds = %17
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %14
21: ; preds = %14
%22 = load i32*, i32** %1
%23 = call i32 @free(i32* %22)
ret void
}

LLVM IR (-O2):
define void @pointer_doesnt_leak_from_loop() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32 @free(i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(void *, size_t, size_t, int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) size_t
softboundmpx_fread(void *ptr, size_t size, size_t nmemb, FILE *stream) {
  return fread(ptr, size, nmemb, stream);
}


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

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

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

LLVM IR (-O2):
define weak i64 @softboundmpx_fread(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = tail call i64 @fread(i8* %0, i64 %1, i64 %2, i32* %3)
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ _print_pair_sum_to_x(int *, int, int);
void main() {
  int arr[] = {10, 22, 28, 29, 30, 40};
  int x = 38;
  _print_pair_sum_to_x(arr, sizeof(arr) / sizeof(int), x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x26,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    $0x6,%esi
call   1030 <_print_pair_sum_to_x@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
mov    $0x26,%edx
call   1030 <_print_pair_sum_to_x@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [6 x i32] [i32 10, i32 22, i32 28, i32 29, i32 30, i32 40]
define void @main() {
%1 = alloca [6 x i32]
%2 = alloca i32
%3 = bitcast [6 x i32]* %1 to i8*
store i32 38, i32* %2
%4 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @_print_pair_sum_to_x(i32* %4, i32 6, i32 %5)
ret void
}

LLVM IR (-O2):
@__const.main.arr = [6 x i32] [i32 10, i32 22, i32 28, i32 29, i32 30, i32 40]
define void @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @_print_pair_sum_to_x(i32* %3, i32 6, i32 38)
ret void
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, float);
float calcev(char *c, int l, int16_t v) {
  if (c)
    snprintf(c, l, "%.2f EV", (float)v / 32);
  return ((float)v / 32);
}


x86 assembly (clang, -O0):
<calcev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1153 <calcev+0x43>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
cvtsi2ssq -0x18(%rbp),%xmm0
movss  0xebd(%rip),%xmm1
divss  %xmm1,%xmm0
lea    0xeb6(%rip),%rdx
call   1030 <snprintf@plt>
cvtsi2ssq -0x18(%rbp),%xmm0
movss  0xe9f(%rip),%xmm1
divss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcev>:
push   %rax
cvtsi2ss %rdx,%xmm0
mulss  0xee2(%rip),%xmm0
test   %rdi,%rdi
je     1141 <calcev+0x31>
lea    0xeda(%rip),%rdx
movss  %xmm0,0x4(%rsp)
movss  0x4(%rsp),%xmm0
call   1030 <snprintf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%.2f EV\00"
define float @calcev(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %16
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = load i64, i64* %6
%13 = sitofp i64 %12 to float
%14 = fdiv float %13, 3.200000e+01
%15 = call i32 @snprintf(i8* %10, i32 %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %14)
br label %16
16: ; preds = %9, %3
%17 = load i64, i64* %6
%18 = sitofp i64 %17 to float
%19 = fdiv float %18, 3.200000e+01
ret float %19
}

LLVM IR (-O2):
@.str = [8 x i8] c"%.2f EV\00"
define float @calcev(i8* %0, i32 %1, i64 %2) {
%4 = icmp eq i8* %0, null
%5 = sitofp i64 %2 to float
%6 = fmul float %5, 3.125000e-02
br i1 %4, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %6)
br label %9
9: ; preds = %3, %7
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ sync();
int /*<<< orphan*/ system(char *);
void clear_cache() {
  sync();
  system("sudo /home/hr/drop-caches.sh");
}


x86 assembly (clang, -O0):
<clear_cache>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <sync@plt>
lea    0xece(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_cache>:
push   %rax
xor    %eax,%eax
call   1040 <sync@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"sudo /home/hr/drop-caches.sh\00"
define void @clear_cache() {
%1 = call i32 (...) @sync()
%2 = call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"sudo /home/hr/drop-caches.sh\00"
define void @clear_cache() {
%1 = tail call i32 (...) @sync()
%2 = tail call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
int Sub(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<Sub>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @Sub(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @Sub(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int foo(int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdout;
int bar(int x) {
  puts("bar");
  fflush(stdout);
  x = foo(x - 4);
  puts("bar after foo");
  return x;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x4(%rbp),%edi
sub    $0x4,%edi
call   1050 <foo@plt>
mov    %eax,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0xfffffffc,%ebx
mov    %ebx,%edi
call   1050 <foo@plt>
mov    %eax,%ebx
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"bar\00"
@stdout = global i32 0
@.str.1 = [14 x i8] c"bar after foo\00"
define i32 @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 4
%8 = call i32 @foo(i32 %7)
store i32 %8, i32* %2
%9 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"bar\00"
@stdout = global i32 0
@.str.1 = [14 x i8] c"bar after foo\00"
define i32 @bar(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = add nsw i32 %0, -4
%6 = tail call i32 @foo(i32 %5)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 %6
}
/* Variables and functions */
char tolower(char);
void lcase(char *s) {
  for (;;) {
    if (*s == 0)
      break;
    *s = tolower(*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<lcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1131 <lcase+0x21>
jmp    1156 <lcase+0x46>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <lcase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcase>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <lcase+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <lcase+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @lcase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void USBHostReset(uint32_t ui32Base, bool bStart) {
  ASSERT(ui32Base == 0x40050000);
  if (bStart) {
    (*((volatile uint8_t *)(ui32Base + 0x00000001))) |= 0x00000008;
  } else {
    (*((volatile uint8_t *)(ui32Base + 0x00000001))) &= ~0x00000008;
  }
}


x86 assembly (clang, -O0):
<USBHostReset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x40050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x0,-0x8(%rbp)
je     1150 <USBHostReset+0x40>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
mov    (%rax),%ecx
or     $0x8,%ecx
mov    %ecx,(%rax)
jmp    115f <USBHostReset+0x4f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffff7,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostReset>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %ebx,%ebx
test   %esi,%esi
setne  %bl
xor    %edi,%edi
cmp    $0x40050000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebp,%rax
mov    0x1(%rax),%ecx
and    $0xfffffff7,%ecx
lea    (%rcx,%rbx,8),%ecx
mov    %ecx,0x1(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @USBHostReset(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 = icmp eq i32 %5, 1074069504
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = or i32 %16, 8
store volatile i32 %17, i32* %15
br label %25
18: ; preds = %2
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
%23 = load volatile i32, i32* %22
%24 = and i32 %23, -9
store volatile i32 %24, i32* %22
br label %25
25: ; preds = %18, %11
ret void
}

LLVM IR (-O2):
define void @USBHostReset(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1074069504
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = icmp eq i32 %1, 0
%7 = add nsw i32 %0, 1
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = and i32 %10, -9
%12 = select i1 %6, i32 0, i32 8
%13 = or i32 %11, %12
store volatile i32 %13, i32* %9
ret void
}