xunge/DecIR huggingface dataset:
int incX(int initX, int initY, int numX, int numY) {
  int y = initY + 1;
  if (y == numY)
    return initX + 1;
  else
    return initX;
}


x86 assembly (clang, -O0):
<incX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1133 <incX+0x33>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <incX+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<incX>:
add    $0x1,%esi
xor    %eax,%eax
cmp    %ecx,%esi
sete   %al
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @incX(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, 1
%6 = icmp eq i32 %5, %3
%7 = zext i1 %6 to i32
%8 = add nsw i32 %7, %0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ g();
void f() { g(); }


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

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

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

LLVM IR (-O2):
define void @f() {
%1 = tail call i32 (...) @g()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(int argc, char *argv[]) { printf("hello, my cat\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"hello, my cat\00"
define void @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void get_today(time_t *startDate, time_t *endDate) {
  time_t t = time(NULL);
  *startDate = t;
  *endDate = t;
}


x86 assembly (clang, -O0):
<get_today>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_today>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,(%rbx)
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @get_today(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = call i32 @time(i32* null)
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = load i32*, i32** %3
store i32 %7, i32* %8
%9 = load i32, i32* %5
%10 = load i32*, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @get_today(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *p) {
  printf("Usage: %s [options]\n"
         "\n"
         "\t-h\tthis help screen\n"
         "\t-t\tdisable timestamp\n"
         "\t-p\texit if parent dies\n"
         "\t-d\tprint debugging information\n"
         "\n",
         p);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [122 x i8] c"Usage: %s [options]\0A\0A\09-h\09this help screen\0A\09-t\09disable timestamp\0A\09-p\09exit if parent dies\0A\09-d\09print debugging information\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [122 x i8] c"Usage: %s [options]\0A\0A\09-h\09this help screen\0A\09-t\09disable timestamp\0A\09-p\09exit if parent dies\0A\09-d\09print debugging information\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int isnotzero(double a) { return a * a > 2.2204460492503131e-16; }


x86 assembly (clang, -O0):
<isnotzero>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee5(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnotzero>:
mulsd  %xmm0,%xmm0
xor    %eax,%eax
ucomisd 0xef2(%rip),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @isnotzero(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = fcmp ogt double %5, 0x3CB0000000000000
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isnotzero(double %0) {
%2 = fmul double %0, %0
%3 = fcmp ogt double %2, 0x3CB0000000000000
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ space_to_dash(char *);
int main() {
  space_to_dash("may the force be with you");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"may the force be with you\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @space_to_dash(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"may the force be with you\00"
define i32 @main() {
%1 = tail call i32 @space_to_dash(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned bitScan_fun_ushort(unsigned short x) {
  unsigned r = 16;
  while (x) {
    --r;
    x >>= 1;
  }
  return r;
}


x86 assembly (clang, -O0):
<bitScan_fun_ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movl   $0x10,-0x8(%rbp)
cmpw   $0x0,-0x2(%rbp)
je     1136 <bitScan_fun_ushort+0x36>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x1,%eax
mov    %ax,-0x2(%rbp)
jmp    1112 <bitScan_fun_ushort+0x12>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitScan_fun_ushort>:
mov    $0x10,%eax
test   %edi,%edi
je     1120 <bitScan_fun_ushort+0x20>
nopl   0x0(%rax)
add    $0xffffffff,%eax
movzwl %di,%ecx
mov    %ecx,%edi
shr    %edi
cmp    $0x1,%cx
ja     1110 <bitScan_fun_ushort+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitScan_fun_ushort(i16 zeroext %0) {
%2 = icmp eq i16 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 16, %1 ]
%5 = phi i16 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %4, -1
%7 = lshr i16 %5, 1
%8 = icmp ult i16 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 16, %1 ], [ %6, %3 ]
ret i32 %10
}
int *needsStack() {
  int a = 5;
  return &a;
}


x86 assembly (clang, -O0):
<needsStack>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
lea    -0x4(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i32* @needsStack() {
%1 = alloca i32
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ PushPop_instr(int);
void PUSH(void) { PushPop_instr(197); }


x86 assembly (clang, -O0):
<PUSH>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc5,%edi
call   1030 <PushPop_instr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PUSH>:
mov    $0xc5,%edi
jmp    1030 <PushPop_instr@plt>

LLVM IR (-O0):
define void @PUSH() {
%1 = call i32 @PushPop_instr(i32 197)
ret void
}

LLVM IR (-O2):
define void @PUSH() {
%1 = tail call i32 @PushPop_instr(i32 197)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
FILE *fdopen(int fildes, const char *mode) {
  fprintf(stderr, "\nAccess to dangerous function %s() denied.\n", "fdopen");
  assert(0);
  ;
}


x86 assembly (clang, -O0):
<fdopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
lea    0xee6(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdopen>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xef4(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [7 x i8] c"fdopen\00"
define i32* @fdopen(i32 %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @assert(i32 0)
%9 = load i32*, i32** %3
ret i32* %9
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [7 x i8] c"fdopen\00"
define noalias i32* @fdopen(i32 %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @assert(i32 0)
ret i32* undef
}
unsigned char test(unsigned char *bm, int ndx) {
  return (bm[ndx >> 3] & (1 << (ndx & 0x07)) ? 1 : 0);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    %esi,%eax
sar    $0x3,%eax
cltq
movzbl (%rdi,%rax,1),%eax
and    $0x7,%sil
movzbl %sil,%ecx
bt     %ecx,%eax
setb   %al
ret

LLVM IR (-O0):
define zeroext i8 @test(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = ashr i32 %6, 3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i32, i32* %4
%13 = and i32 %12, 7
%14 = shl i32 1, %13
%15 = and i32 %11, %14
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 1, i32 0
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @test(i8* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 3
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %1, 7
%9 = shl nuw nsw i32 1, %8
%10 = and i32 %9, %7
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i8
ret i8 %12
}
/* Variables and functions */
int tonum(unsigned char *, int, double *);
int naStr_parsenum(char *str, int len, double *result) {
  return tonum((unsigned char *)str, len, result);
}


x86 assembly (clang, -O0):
<naStr_parsenum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <tonum@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<naStr_parsenum>:
jmp    1030 <tonum@plt>

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

LLVM IR (-O2):
define i32 @naStr_parsenum(i8* %0, i32 %1, double* %2) {
%4 = tail call i32 @tonum(i8* %0, i32 %1, double* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x1f() {
  Assert_real((isprint(31) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              160, ("isprint should be 0 for 0x1f"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x1f>:
push   %rax
mov    $0x1f,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xa0,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x1f\00"
define void @t_isprint_0x1f() {
%1 = call i64 @isprint(i32 31)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 160, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x1f\00"
define void @t_isprint_0x1f() {
%1 = tail call i64 @isprint(i32 31)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 160, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double max_double(double *, int);
double min_double(double *, int);
double range(double values[], int count) {
  double min = min_double(values, count);
  double max = max_double(values, count);
  return max - min;
}


x86 assembly (clang, -O0):
<range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <min_double@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <max_double@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <min_double@plt>
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <max_double@plt>
subsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @range(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store double* %0, double** %3
store i32 %1, i32* %4
%7 = load double*, double** %3
%8 = load i32, i32* %4
%9 = call double @min_double(double* %7, i32 %8)
store double %9, double* %5
%10 = load double*, double** %3
%11 = load i32, i32* %4
%12 = call double @max_double(double* %10, i32 %11)
store double %12, double* %6
%13 = load double, double* %6
%14 = load double, double* %5
%15 = fsub double %13, %14
ret double %15
}

LLVM IR (-O2):
define double @range(double* %0, i32 %1) {
%3 = tail call double @min_double(double* %0, i32 %1)
%4 = tail call double @max_double(double* %0, i32 %1)
%5 = fsub double %4, %3
ret double %5
}
/* Type definitions */
struct task_struct {
  int dummy;
};
struct rq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ resched_task(struct task_struct *);
int /*<<< orphan*/ switched_to_dl(struct rq *, struct task_struct *, int);
void prio_changed_dl(struct rq *rq, struct task_struct *p, int oldprio,
                     int running) {
  if (running) {
    resched_task(p);
  } else
    switched_to_dl(rq, p, running);
}


x86 assembly (clang, -O0):
<prio_changed_dl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     114e <prio_changed_dl+0x2e>
mov    -0x10(%rbp),%rdi
call   1030 <resched_task@plt>
jmp    115e <prio_changed_dl+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1040 <switched_to_dl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prio_changed_dl>:
test   %ecx,%ecx
je     112c <prio_changed_dl+0xc>
mov    %rsi,%rdi
jmp    1030 <resched_task@plt>
xor    %edx,%edx
jmp    1040 <switched_to_dl@plt>

LLVM IR (-O0):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define void @prio_changed_dl(%struct.rq* %0, %struct.task_struct* %1, i32 %2, i32 %3) {
%5 = alloca %struct.rq*
%6 = alloca %struct.task_struct*
%7 = alloca i32
%8 = alloca i32
store %struct.rq* %0, %struct.rq** %5
store %struct.task_struct* %1, %struct.task_struct** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load %struct.task_struct*, %struct.task_struct** %6
%13 = call i32 @resched_task(%struct.task_struct* %12)
br label %19
14: ; preds = %4
%15 = load %struct.rq*, %struct.rq** %5
%16 = load %struct.task_struct*, %struct.task_struct** %6
%17 = load i32, i32* %8
%18 = call i32 @switched_to_dl(%struct.rq* %15, %struct.task_struct* %16, i32 %17)
br label %19
19: ; preds = %14, %11
ret void
}

LLVM IR (-O2):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define void @prio_changed_dl(%struct.rq* %0, %struct.task_struct* %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @resched_task(%struct.task_struct* %1)
br label %10
8: ; preds = %4
%9 = tail call i32 @switched_to_dl(%struct.rq* %0, %struct.task_struct* %1, i32 0)
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World! \n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello World! \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_rhtml_comment();
void all_rhtml_tests() { test_rhtml_comment(); }


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

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

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

LLVM IR (-O2):
define void @all_rhtml_tests() {
%1 = tail call i32 (...) @test_rhtml_comment()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RamRead32A_Ofilm(int, unsigned long *);
unsigned long GinMes_OFILM(unsigned char UcXg1Xg2_OFILM) {
  unsigned long UlMesVal_OFILM;
  if (!UcXg1Xg2_OFILM) {
    RamRead32A_Ofilm(0x1041, &UlMesVal_OFILM);
  } else {
    RamRead32A_Ofilm(0x1141, &UlMesVal_OFILM);
  }
  return (UlMesVal_OFILM);
}


x86 assembly (clang, -O0):
<GinMes_OFILM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
jne    113b <GinMes_OFILM+0x2b>
mov    $0x1041,%edi
lea    -0x10(%rbp),%rsi
call   1030 <RamRead32A_Ofilm@plt>
jmp    1149 <GinMes_OFILM+0x39>
mov    $0x1141,%edi
lea    -0x10(%rbp),%rsi
call   1030 <RamRead32A_Ofilm@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GinMes_OFILM>:
push   %rax
xor    %eax,%eax
test   %edi,%edi
setne  %al
shl    $0x8,%eax
or     $0x1041,%eax
mov    %rsp,%rsi
mov    %eax,%edi
call   1030 <RamRead32A_Ofilm@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @GinMes_OFILM(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i64
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = icmp ne i8 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @RamRead32A_Ofilm(i32 4161, i64* %3)
br label %10
8: ; preds = %1
%9 = call i32 @RamRead32A_Ofilm(i32 4417, i64* %3)
br label %10
10: ; preds = %8, %6
%11 = load i64, i64* %3
ret i64 %11
}

LLVM IR (-O2):
define i64 @GinMes_OFILM(i8 zeroext %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = icmp eq i8 %0, 0
%5 = select i1 %4, i32 4161, i32 4417
%6 = call i32 @RamRead32A_Ofilm(i32 %5, i64* %2)
%7 = load i64, i64* %2
ret i64 %7
}
/* Type definitions */
struct strlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strlist_append(struct strlist *, int /*<<< orphan*/);
void strlist_extend_argv(struct strlist *sl, const char *const *src) {
  while (*src)
    strlist_append(sl, *src++);
}


x86 assembly (clang, -O0):
<strlist_extend_argv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1150 <strlist_extend_argv+0x40>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %eax,%esi
call   1030 <strlist_append@plt>
jmp    1120 <strlist_extend_argv+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlist_extend_argv>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    (%rsi),%rsi
test   %rsi,%rsi
je     1144 <strlist_extend_argv+0x34>
mov    %rdi,%r14
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <strlist_append@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <strlist_extend_argv+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.strlist = type { i32 }
define void @strlist_extend_argv(%struct.strlist* %0, i8** %1) {
%3 = alloca %struct.strlist*
%4 = alloca i8**
store %struct.strlist* %0, %struct.strlist** %3
store i8** %1, i8*** %4
br label %5
5: ; preds = %9, %2
%6 = load i8**, i8*** %4
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load %struct.strlist*, %struct.strlist** %3
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i32 1
store i8** %12, i8*** %4
%13 = load i8*, i8** %11
%14 = ptrtoint i8* %13 to i32
%15 = call i32 @strlist_append(%struct.strlist* %10, i32 %14)
br label %5
16: ; preds = %5
ret void
}

LLVM IR (-O2):
%struct.strlist = type { i32 }
define void @strlist_extend_argv(%struct.strlist* %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %12, %5 ], [ %3, %2 ]
%7 = phi i8** [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = ptrtoint i8* %6 to i64
%10 = trunc i64 %9 to i32
%11 = tail call i32 @strlist_append(%struct.strlist* %0, i32 %10)
%12 = load i8*, i8** %8
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %5
14: ; preds = %5, %2
ret void
}
int check_stack(int a, int b, int c, int d, int e, int f, int g, int h, int i,
                int j) {
  return 111;
}


x86 assembly (clang, -O0):
<check_stack>:
push   %rbp
mov    %rsp,%rbp
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    $0x6f,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @check_stack(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
store i32 %0, i32* %11
store i32 %1, i32* %12
store i32 %2, i32* %13
store i32 %3, i32* %14
store i32 %4, i32* %15
store i32 %5, i32* %16
store i32 %6, i32* %17
store i32 %7, i32* %18
store i32 %8, i32* %19
store i32 %9, i32* %20
ret i32 111
}

LLVM IR (-O2):
define i32 @check_stack(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
ret i32 111
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int libc_exit(int code) { exit(code); }


x86 assembly (clang, -O0):
<libc_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<libc_exit>:
push   %rax
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @libc_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define i32 @libc_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void goRight(int dx) { printf("\e[%dC", dx); }


x86 assembly (clang, -O0):
<goRight>:
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):
<goRight>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dC\00"
define void @goRight(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct crk5_exl_mt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct crk5_exl_mt *);
void crk5_exl_mt_delete(struct crk5_exl_mt *exl) {
  if (!exl)
    return;
  free(exl);
}


x86 assembly (clang, -O0):
<crk5_exl_mt_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <crk5_exl_mt_delete+0x1c>
jmp    1135 <crk5_exl_mt_delete+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crk5_exl_mt_delete>:
test   %rdi,%rdi
je     111a <crk5_exl_mt_delete+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.crk5_exl_mt = type { i32 }
define void @crk5_exl_mt_delete(%struct.crk5_exl_mt* %0) {
%2 = alloca %struct.crk5_exl_mt*
store %struct.crk5_exl_mt* %0, %struct.crk5_exl_mt** %2
%3 = load %struct.crk5_exl_mt*, %struct.crk5_exl_mt** %2
%4 = icmp ne %struct.crk5_exl_mt* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load %struct.crk5_exl_mt*, %struct.crk5_exl_mt** %2
%8 = call i32 @free(%struct.crk5_exl_mt* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.crk5_exl_mt = type { i32 }
define void @crk5_exl_mt_delete(%struct.crk5_exl_mt* %0) {
%2 = icmp eq %struct.crk5_exl_mt* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.crk5_exl_mt* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char *const pstr = "abcd";
  printf("%p  %p\n", pstr, &pstr);
  *(pstr + 2) = 'e';
  printf("%c\n", *(pstr + 2));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xed4(%rip),%rdi
lea    0xec8(%rip),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x65,0xeb8(%rip)
movsbl 0xeb1(%rip),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"abcd\00"
@.str.1 = [8 x i8] c"%p %p\0A\00"
@.str.2 = [4 x i8] c"%c\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %1)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 99)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
void *hmac_sha_md5(char const *, size_t, char *, size_t, char *, int);
void *hmac_sha(const char *buffer, size_t len, char *key, size_t key_len,
               char *resbuf, int type) {
  return hmac_sha_md5(buffer, len, key, key_len, resbuf, type);
}


x86 assembly (clang, -O0):
<hmac_sha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1030 <hmac_sha_md5@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmac_sha>:
jmp    1030 <hmac_sha_md5@plt>

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

LLVM IR (-O2):
define i8* @hmac_sha(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4, i32 %5) {
%7 = tail call i8* @hmac_sha_md5(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4, i32 %5)
ret i8* %7
}
int bz2_ferror(void *stream) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @bz2_ferror(i8* nocapture readnone %0) {
ret i32 0
}
int isascii(int c) { return !!((c >= 0) && (c <= 127)); }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isascii+0x20>
cmpl   $0x7f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ mdaq_pwm_set_duty(unsigned char, double);
void PWMStep(unsigned char module, double pwm_a, double pwm_b) {
  module *= 2;
  mdaq_pwm_set_duty(module, pwm_a);
  mdaq_pwm_set_duty(module + 1, pwm_b);
}


x86 assembly (clang, -O0):
<PWMStep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
movsd  -0x10(%rbp),%xmm0
movzbl %al,%edi
call   1030 <mdaq_pwm_set_duty@plt>
movzbl -0x1(%rbp),%eax
add    $0x1,%eax
movsd  -0x18(%rbp),%xmm0
movzbl %al,%edi
call   1030 <mdaq_pwm_set_duty@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMStep>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
add    %dil,%dil
movzbl %dil,%ebx
mov    %ebx,%edi
call   1030 <mdaq_pwm_set_duty@plt>
or     $0x1,%bl
movzbl %bl,%edi
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1030 <mdaq_pwm_set_duty@plt>

LLVM IR (-O0):
define void @PWMStep(i8 zeroext %0, double %1, double %2) {
%4 = alloca i8
%5 = alloca double
%6 = alloca double
store i8 %0, i8* %4
store double %1, double* %5
store double %2, double* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = mul nsw i32 %8, 2
%10 = trunc i32 %9 to i8
store i8 %10, i8* %4
%11 = load i8, i8* %4
%12 = load double, double* %5
%13 = call i32 @mdaq_pwm_set_duty(i8 zeroext %11, double %12)
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = add nsw i32 %15, 1
%17 = trunc i32 %16 to i8
%18 = load double, double* %6
%19 = call i32 @mdaq_pwm_set_duty(i8 zeroext %17, double %18)
ret void
}

LLVM IR (-O2):
define void @PWMStep(i8 zeroext %0, double %1, double %2) {
%4 = shl i8 %0, 1
%5 = tail call i32 @mdaq_pwm_set_duty(i8 zeroext %4, double %1)
%6 = or i8 %4, 1
%7 = tail call i32 @mdaq_pwm_set_duty(i8 zeroext %6, double %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
void func1(void) {
  int func1_variable;
  static int func1_static_variable;
  printf("&func1_variable... %p\n", &func1_variable);
  printf("&func1_static_variable... %p\n", &func1_static_variable);
}


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

x86 assembly (clang, -O2):
<func1>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
lea    0x2efc(%rip),%rsi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@func1.func1_static_variable = internal global i32 0
@.str = [23 x i8] c"&func1_variable... %p\0A\00"
@.str.1 = [30 x i8] c"&func1_static_variable... %p\0A\00"
define void @func1() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32* @func1.func1_static_variable)
ret void
}

LLVM IR (-O2):
@func1.func1_static_variable = internal global i32 0
@.str = [23 x i8] c"&func1_variable... %p\0A\00"
@.str.1 = [30 x i8] c"&func1_static_variable... %p\0A\00"
define void @func1() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32* @func1.func1_static_variable)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void stbi_image_free(void *retval_from_stbi_load) {
  free((retval_from_stbi_load));
}


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

x86 assembly (clang, -O2):
<stbi_image_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @stbi_image_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int _dgr(double, double);
int _dls(double a, double b) { return _dgr(b, a); }


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

x86 assembly (clang, -O2):
<_dls>:
movaps %xmm0,%xmm2
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
jmp    1030 <_dgr@plt>

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

LLVM IR (-O2):
define i32 @_dls(double %0, double %1) {
%3 = tail call i32 @_dgr(double %1, double %0)
ret i32 %3
}
/* Type definitions */
struct unw_frame_info {
  int dummy;
};

/* Variables and functions */
int unw_access_pr(struct unw_frame_info *, unsigned long *, int);
int unw_set_pr(struct unw_frame_info *i, unsigned long v) {
  return unw_access_pr(i, &v, 1);
}


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

x86 assembly (clang, -O2):
<unw_set_pr>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edx
call   1030 <unw_access_pr@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.unw_frame_info = type { i32 }
define i32 @unw_set_pr(%struct.unw_frame_info* %0, i64 %1) {
%3 = alloca %struct.unw_frame_info*
%4 = alloca i64
store %struct.unw_frame_info* %0, %struct.unw_frame_info** %3
store i64 %1, i64* %4
%5 = load %struct.unw_frame_info*, %struct.unw_frame_info** %3
%6 = call i32 @unw_access_pr(%struct.unw_frame_info* %5, i64* %4, i32 1)
ret i32 %6
}

LLVM IR (-O2):
%struct.unw_frame_info = type { i32 }
define i32 @unw_set_pr(%struct.unw_frame_info* %0, i64 %1) {
%3 = alloca i64
store i64 %1, i64* %3
%4 = call i32 @unw_access_pr(%struct.unw_frame_info* %0, i64* %3, i32 1)
ret i32 %4
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double now() {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return tv.tv_sec + tv.tv_usec / 1000000.0;
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xecb(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @now() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = fdiv double %6, 1.000000e+06
%8 = fadd double %4, %7
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %5, %8
ret double %9
}
int lw6sys_true() { return 1; }


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

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

LLVM IR (-O0):
define i32 @lw6sys_true() {
ret i32 1
}

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

/* Variables and functions */
int /*<<< orphan*/ MC_put_y_mmx(int, int, int /*<<< orphan*/ *,
                                int /*<<< orphan*/ const *, int);
void MC_put_y_8_mmx(uint8_t *dest, const uint8_t *ref, int stride, int height) {
  MC_put_y_mmx(8, height, dest, ref, stride);
}


x86 assembly (clang, -O0):
<MC_put_y_8_mmx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    $0x8,%edi
call   1030 <MC_put_y_mmx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MC_put_y_8_mmx>:
mov    %edx,%r8d
mov    %rsi,%rax
mov    %rdi,%rdx
mov    $0x8,%edi
mov    %ecx,%esi
mov    %rax,%rcx
jmp    1030 <MC_put_y_mmx@plt>

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

LLVM IR (-O2):
define void @MC_put_y_8_mmx(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @MC_put_y_mmx(i32 8, i32 %3, i32* %0, i32* %1, i32 %2)
ret void
}
unsigned int atou(const char *s) {
  unsigned int i = 0;
  while (((*s) >= '0' && (*s) <= '9'))
    i = i * 10 + (*s++ - '0');
  return i;
}


x86 assembly (clang, -O0):
<atou>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
jl     1134 <atou+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1144 <atou+0x44>
jmp    1167 <atou+0x67>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <atou+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atou>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
xor    %eax,%eax
cmp    $0x9,%dl
ja     113b <atou+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1120 <atou+0x20>
ret

LLVM IR (-O0):
define i32 @atou(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 48
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 57
br label %14
14: ; preds = %9, %4
%15 = phi i1 [ false, %4 ], [ %13, %9 ]
br i1 %15, label %16, label %25
16: ; preds = %14
%17 = load i32, i32* %3
%18 = mul i32 %17, 10
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
%21 = load i8, i8* %19
%22 = sext i8 %21 to i32
%23 = sub nsw i32 %22, 48
%24 = add i32 %18, %23
store i32 %24, i32* %3
br label %4
25: ; preds = %14
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @atou(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i32 [ %13, %5 ], [ 0, %1 ]
%8 = phi i8* [ %11, %5 ], [ %0, %1 ]
%9 = zext i8 %6 to i32
%10 = mul i32 %7, 10
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = add i32 %10, -48
%13 = add i32 %12, %9
%14 = load i8, i8* %11
%15 = add i8 %14, -48
%16 = icmp ult i8 %15, 10
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %13, %5 ]
ret i32 %18
}