xunge/DecIR huggingface dataset:
int control_access_block_update_ro(unsigned char gid, unsigned short paddr,
                                   unsigned char sz, unsigned char cnt) {
  return -1;
}


x86 assembly (clang, -O0):
<control_access_block_update_ro>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %si,%dx
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @control_access_block_update_ro(i8 zeroext %0, i16 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8
%6 = alloca i16
%7 = alloca i8
%8 = alloca i8
store i8 %0, i8* %5
store i16 %1, i16* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @control_access_block_update_ro(i8 zeroext %0, i16 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
ret i32 -1
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int gca_search_int64(const void *aa, void *bb) {
  const int64_t a = *(const int64_t *)aa;
  const int64_t b = *(int64_t *)bb;
  return (((a) > (b)) - ((b) > (a)));
}


x86 assembly (clang, -O0):
<gca_search_int64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x20(%rbp),%rcx
cmp    -0x18(%rbp),%rcx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gca_search_int64>:
mov    (%rdi),%rcx
mov    (%rsi),%rdx
xor    %eax,%eax
xor    %esi,%esi
cmp    %rdx,%rcx
setg   %al
setl   %sil
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @gca_search_int64(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
store i64 %9, i64* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i64*
%12 = load i64, i64* %11
store i64 %12, i64* %6
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = icmp sgt i64 %13, %14
%16 = zext i1 %15 to i32
%17 = load i64, i64* %6
%18 = load i64, i64* %5
%19 = icmp sgt i64 %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @gca_search_int64(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp sgt i64 %6, %4
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
void print_fMatrix(Matrix_p, x_size, y_size) long x_size, y_size;
float *Matrix_p;
{
  int i;
  for (i = 0; i < y_size; ++i)
    print_fArray(Matrix_p + (x_size * i), x_size);
  return;
}


x86 assembly (clang, -O0):
<print_fMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1169 <print_fMatrix+0x59>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   %rcx,%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <print_fArray@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <print_fMatrix+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_fMatrix>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
jle    1146 <print_fMatrix+0x36>
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x0(,%rsi,4),%r12
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <print_fArray@plt>
add    %r12,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <print_fMatrix+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @print_fMatrix(float* %0, i64 %1, i64 %2) {
%4 = icmp sgt i64 %2, 0
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i64 [ %10, %5 ], [ 0, %3 ]
%7 = mul nsw i64 %6, %1
%8 = getelementptr inbounds float, float* %0, i64 %7
%9 = tail call i32 (float*, i64, ...) bitcast (i32 (...)* @print_fArray to i32 (float*, i64, ...)*)(float* %8, i64 %1)
%10 = add nuw nsw i64 %6, 1
%11 = icmp eq i64 %10, %2
br i1 %11, label %12, label %5
12: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ new_op(int);
void parse_ENDFILE() { new_op(2); }


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

x86 assembly (clang, -O2):
<parse_ENDFILE>:
mov    $0x2,%edi
jmp    1030 <new_op@plt>

LLVM IR (-O0):
define void @parse_ENDFILE() {
%1 = call i32 @new_op(i32 2)
ret void
}

LLVM IR (-O2):
define void @parse_ENDFILE() {
%1 = tail call i32 @new_op(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ timer_init();
int /*<<< orphan*/ timer_run();
void timer_start() {
  timer_init();
  timer_run();
}


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

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

LLVM IR (-O0):
define void @timer_start() {
%1 = call i32 (...) @timer_init()
%2 = call i32 (...) @timer_run()
ret void
}

LLVM IR (-O2):
define void @timer_start() {
%1 = tail call i32 (...) @timer_init()
%2 = tail call i32 (...) @timer_run()
ret void
}
/* Type definitions */
struct pipeline {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct pipeline *);
int /*<<< orphan*/ pipeline_free_internal(struct pipeline *);
void pipeline_free(struct pipeline *p) {
  pipeline_free_internal(p);
  free(p);
}


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

x86 assembly (clang, -O2):
<pipeline_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <pipeline_free_internal@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.pipeline = type { i32 }
define void @pipeline_free(%struct.pipeline* %0) {
%2 = alloca %struct.pipeline*
store %struct.pipeline* %0, %struct.pipeline** %2
%3 = load %struct.pipeline*, %struct.pipeline** %2
%4 = call i32 @pipeline_free_internal(%struct.pipeline* %3)
%5 = load %struct.pipeline*, %struct.pipeline** %2
%6 = call i32 @free(%struct.pipeline* %5)
ret void
}

LLVM IR (-O2):
%struct.pipeline = type { i32 }
define void @pipeline_free(%struct.pipeline* %0) {
%2 = tail call i32 @pipeline_free_internal(%struct.pipeline* %0)
%3 = tail call i32 @free(%struct.pipeline* %0)
ret void
}
/* Variables and functions */
int _decompress(char *, int, char *);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_decompress(char *src, int srcsize, char *dest) {
  int ret;
  monLock();
  ret = _decompress(src, srcsize, dest);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_decompress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <monLock@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <_decompress@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1050 <monUnlock@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_decompress>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <monLock@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1030 <_decompress@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <monUnlock@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mon_decompress(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = call i32 (...) @monLock()
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = call i32 @_decompress(i8* %9, i32 %10, i8* %11)
store i32 %12, i32* %7
%13 = call i32 (...) @monUnlock()
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
define i32 @mon_decompress(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 (...) @monLock()
%5 = tail call i32 @_decompress(i8* %0, i32 %1, i8* %2)
%6 = tail call i32 (...) @monUnlock()
ret i32 %5
}
double powD(double n, double exp) {
  int newRoundingMode = 0x0A7F;
  ;
  int originalRoundingMode = 0x0000;
  asm("fnstcw %[originalRoundingMode]"
      "\n"
      "fldcw  %[newRoundingMode]"
      "\n"
      "fldl   %[expIn]"
      "\n"
      "fldl   %[nIn]"
      "\n"
      "fyl2x"
      "\n"
      "fld    %%st(0)"
      "\n"
      "frndint"
      "\n"
      "fldz"
      "\n"
      "fcomi"
      "\n"
      "ja NEGATIVE"
      "\n"
      "POSITIVE:"
      "\n"
      "faddp"
      "\n"
      "mov    $0, %%eax"
      "\n"
      "jmp    FRACTIONSTEPS"
      "\n"
      "NEGATIVE:"
      "\n"
      "faddp"
      "\n"
      "mov    $1, %%eax"
      "\n"
      "jmp    FRACTIONSTEPS"
      "\n"
      "FRACTIONSTEPS:"
      "\n"
      "fsub   %%st(1),%%st(0)"
      "\n"
      "fldz"
      "\n"
      "fcomi"
      "\n"
      "je     NOREMAINDER"
      "\n"
      "jmp    REMAINDER"
      "\n"
      "REMAINDER:"
      "\n"
      "faddp"
      "\n"
      "fld1"
      "\n"
      "fsubp"
      "\n"
      "f2xm1"
      "\n"
      "fld1"
      "\n"
      "faddp"
      "\n"
      "fscale"
      "\n"
      "test   %%eax, %%eax"
      "\n"
      "jz     FINAL"
      "\n"
      "jmp    DIVIDEBYTWO"
      "\n"
      "NOREMAINDER:"
      "\n"
      "faddp"
      "\n"
      "fxch"
      "\n"
      "fld1"
      "\n"
      "fscale"
      "\n"
      "jmp    FINAL"
      "\n"
      "DIVIDEBYTWO:"
      "\n"
      "fld1"
      "\n"
      "fld1"
      "\n"
      "faddp"
      "\n"
      "fxch"
      "\n"
      "fdivp"
      "\n"
      "jmp FINAL"
      "\n"
      "FINAL:"
      "\n"
      "fstpl  %[nOut]"
      "\n"
      "fldcw  %[originalRoundingMode]"
      "\n"
      : [nOut] "=m"(n)
      : [nIn] "m"(n), [expIn] "m"(exp),
        [originalRoundingMode] "m"(originalRoundingMode),
        [newRoundingMode] "m"(newRoundingMode)
      : "eax", "ebx", "ecx");
  return n;
}


x86 assembly (clang, -O0):
<powD>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movl   $0xa7f,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
fnstcw -0x20(%rbp)
fldcw  -0x1c(%rbp)
fldl   -0x18(%rbp)
fldl   -0x10(%rbp)
fyl2x
fld    %st(0)
frndint
fldz
fcomi  %st(1),%st
ja     1145 <NEGATIVE>

x86 assembly (clang, -O2):
<powD>:
push   %rbx
movsd  %xmm0,-0x18(%rsp)
movsd  %xmm1,-0x8(%rsp)
movl   $0xa7f,-0xc(%rsp)
movl   $0x0,-0x10(%rsp)
fnstcw -0x10(%rsp)
fldcw  -0xc(%rsp)
fldl   -0x8(%rsp)
fldl   -0x18(%rsp)
fyl2x
fld    %st(0)
frndint
fldz
fcomi  %st(1),%st
ja     1142 <NEGATIVE>

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

LLVM IR (-O2):
define double @powD(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
store double %0, double* %3
store double %1, double* %4
%7 = bitcast i32* %5 to i8*
store i32 2687, i32* %5
%8 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%9 = load double, double* %3
ret double %9
}
const char *dlerror(void) {
  puts("# ");
  puts(__FUNCTION__);
  puts("()\n");
  delay(100000000);
  return "ERROR: dlerror()\n";
}


x86 assembly (clang, -O0):
<dlerror>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
mov    $0x0,%al
call   1040 <delay@plt>
lea    0xeaa(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlerror>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
xor    %eax,%eax
call   1040 <delay@plt>
lea    0xead(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.dlerror = [8 x i8] c"dlerror\00"
@.str.1 = [4 x i8] c"()\0A\00"
@.str.2 = [18 x i8] c"ERROR: dlerror()\0A\00"
define i8* @dlerror() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.dlerror, i64 0, i64 0))
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.dlerror = [8 x i8] c"dlerror\00"
@.str.1 = [4 x i8] c"()\0A\00"
@.str.2 = [18 x i8] c"ERROR: dlerror()\0A\00"
define i8* @dlerror() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.dlerror, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint8_t BSP_Button1_Input(void) { return (*((volatile uint32_t *)0x40007100)); }


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

x86 assembly (clang, -O2):
<BSP_Button1_Input>:
mov    0x40007100,%eax
ret

LLVM IR (-O0):
define i32 @BSP_Button1_Input() {
%1 = load volatile i32, i32* inttoptr (i64 1073770752 to i32*)
ret i32 %1
}

LLVM IR (-O2):
define i32 @BSP_Button1_Input() {
%1 = load volatile i32, i32* inttoptr (i64 1073770752 to i32*)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *arg) {
  printf("Usage: %s <option(s)> \n"
         "\t-x\t set size of x dimension\n"
         "\t-y\t set size of y dimension\n"
         "\t-X\t set x coordinate for pulse\n"
         "\t-Y\t set y coordinate for pulse\n"
         "\t-k\t set kernel source file\n"
         "\t-t\t set number of time steps\n",
         arg);
}


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 = [204 x i8] c"Usage: %s <option(s)> \0A\09-x\09 set size of x dimension\0A\09-y\09 set size of y dimension\0A\09-X\09 set x coordinate for pulse\0A\09-Y\09 set y coordinate for pulse\0A\09-k\09 set kernel source file\0A\09-t\09 set number of time steps\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 ([204 x i8], [204 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [204 x i8] c"Usage: %s <option(s)> \0A\09-x\09 set size of x dimension\0A\09-y\09 set size of y dimension\0A\09-X\09 set x coordinate for pulse\0A\09-Y\09 set y coordinate for pulse\0A\09-k\09 set kernel source file\0A\09-t\09 set number of time steps\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([204 x i8], [204 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct s_smc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hwt_stop(struct s_smc *);
void hwt_restart(struct s_smc *smc) { hwt_stop(smc); }


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

x86 assembly (clang, -O2):
<hwt_restart>:
jmp    1030 <hwt_stop@plt>

LLVM IR (-O0):
%struct.s_smc = type { i32 }
define void @hwt_restart(%struct.s_smc* %0) {
%2 = alloca %struct.s_smc*
store %struct.s_smc* %0, %struct.s_smc** %2
%3 = load %struct.s_smc*, %struct.s_smc** %2
%4 = call i32 @hwt_stop(%struct.s_smc* %3)
ret void
}

LLVM IR (-O2):
%struct.s_smc = type { i32 }
define void @hwt_restart(%struct.s_smc* %0) {
%2 = tail call i32 @hwt_stop(%struct.s_smc* %0)
ret void
}
int is_string_char(c)
int c;
{
  c &= 0177;
  return (c >= ' ' || c == '\n' || c == '\r' || c == '\t');
}


x86 assembly (clang, -O0):
<is_string_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jge    1147 <is_string_char+0x47>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1147 <is_string_char+0x47>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1147 <is_string_char+0x47>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_string_char>:
and    $0x7f,%edi
mov    $0x1,%eax
cmp    $0x1f,%edi
ja     1117 <is_string_char+0x17>
cmp    $0xa,%edi
je     1117 <is_string_char+0x17>
cmp    $0xd,%edi
jne    1118 <is_string_char+0x18>
ret
xor    %eax,%eax
cmp    $0x9,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_string_char(i32 %0) {
%2 = and i32 %0, 127
%3 = icmp ugt i32 %2, 31
br i1 %3, label %8, label %4
4: ; preds = %1
switch i32 %2, label %5 [
i32 13, label %8
i32 10, label %8
]
5: ; preds = %4
%6 = icmp eq i32 %2, 9
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %4, %1, %5
%9 = phi i32 [ 1, %4 ], [ %7, %5 ], [ 1, %1 ], [ 1, %4 ]
ret i32 %9
}
/* Variables and functions */
void *malloc(size_t);
void *test24_malloc(size_t n) {
  static int invoke_count = 0;
  if (++invoke_count >= 5) {
    return 0;
  } else {
    return malloc(n);
  }
}


x86 assembly (clang, -O0):
<test24_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2f0a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f01(%rip)
cmp    $0x5,%eax
jl     1141 <test24_malloc+0x31>
movq   $0x0,-0x8(%rbp)
jmp    114e <test24_malloc+0x3e>
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test24_malloc>:
mov    0x2f16(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f0d(%rip)
cmp    $0x3,%eax
jle    1127 <test24_malloc+0x17>
xor    %eax,%eax
ret
jmp    1030 <malloc@plt>

LLVM IR (-O0):
@test24_malloc.invoke_count = internal global i32 0
define i8* @test24_malloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i32, i32* @test24_malloc.invoke_count
%5 = add nsw i32 %4, 1
store i32 %5, i32* @test24_malloc.invoke_count
%6 = icmp sge i32 %5, 5
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %11
8: ; preds = %1
%9 = load i64, i64* %3
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %2
br label %11
11: ; preds = %8, %7
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@test24_malloc.invoke_count = internal unnamed_addr global i32 0
define noalias i8* @test24_malloc(i64 %0) {
%2 = load i32, i32* @test24_malloc.invoke_count
%3 = add nsw i32 %2, 1
store i32 %3, i32* @test24_malloc.invoke_count
%4 = icmp sgt i32 %2, 3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i8* @malloc(i64 %0)
br label %7
7: ; preds = %1, %5
%8 = phi i8* [ %6, %5 ], [ null, %1 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ echo_test(int, int, int /*<<< orphan*/);
void echo_test_1000K_0(void) { echo_test(0x00, 0x14, 0); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    $0x14,%esi
mov    %edx,%edi
call   1030 <echo_test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
xor    %edi,%edi
mov    $0x14,%esi
xor    %edx,%edx
jmp    1030 <echo_test@plt>

LLVM IR (-O0):
define void @echo_test_1000K_0() {
%1 = call i32 @echo_test(i32 0, i32 20, i32 0)
ret void
}

LLVM IR (-O2):
define void @echo_test_1000K_0() {
%1 = tail call i32 @echo_test(i32 0, i32 20, i32 0)
ret void
}
void fc34(int n) {
a : {
  typedef int(*b)[n];
  {
    typedef int(*c)[n];
    goto a;
    0;
  }
  {
    typedef int(*d)[n];
    0;
  };
  typedef int(*e)[n];
  0;
};
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc34>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc34+0x7>

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

LLVM IR (-O0):
define void @fc34(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
br label %3
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc34(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int strtoul(char const *, void *, int /*<<< orphan*/);
int atoi(const char *nptr) { return strtoul(nptr, ((void *)0), 0); }


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <strtoul@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <strtoul@plt>

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = tail call i32 @strtoul(i8* nocapture %0, i8* null, i32 0)
ret i32 %2
}
int test_imm_15int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x15 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_15int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1376256
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char const *argv[]) {
  int a;
  scanf("%d", &a);
  printf("%d", 480 / a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1e0,%eax
cltd
idivl  -0x14(%rbp)
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    $0x1e0,%eax
xor    %edx,%edx
idivl  0xc(%rsp)
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = sdiv i32 480, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
double exp(double);
double rq_rate_continuous_to_discount(double r, double days,
                                      double days_in_year) {
  return exp(-r * (days / days_in_year));
}


x86 assembly (clang, -O0):
<rq_rate_continuous_to_discount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x10(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_rate_continuous_to_discount>:
xorpd  0xee8(%rip),%xmm0
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @rq_rate_continuous_to_discount(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = fneg double %7
%9 = load double, double* %5
%10 = load double, double* %6
%11 = fdiv double %9, %10
%12 = fmul double %8, %11
%13 = call double @exp(double %12)
ret double %13
}

LLVM IR (-O2):
define double @rq_rate_continuous_to_discount(double %0, double %1, double %2) {
%4 = fneg double %0
%5 = fdiv double %1, %2
%6 = fmul double %5, %4
%7 = tail call double @exp(double %6)
ret double %7
}
/* Variables and functions */
int close(int);
int udpClose(int fd) {
  int ret;
  if ((ret = close(fd)) != 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<udpClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     113b <udpClose+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1142 <udpClose+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udpClose>:
push   %rax
call   1030 <close@plt>
neg    %eax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @udpClose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp ne i32 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SysCtlDelay(int);
void _EEPROMSectorMaskClear(void) {
  SysCtlDelay(10);
  (*((volatile unsigned long *)(0x400FD0FC))) = 3;
  SysCtlDelay(10);
  (*((volatile unsigned long *)(0x400AE2C0))) = 0;
  SysCtlDelay(10);
  (*((volatile unsigned long *)(0x400FD0FC))) = 0;
  SysCtlDelay(10);
}


x86 assembly (clang, -O0):
<_EEPROMSectorMaskClear>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
mov    $0x400fd0fc,%eax
movq   $0x3,(%rax)
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
mov    $0x400ae2c0,%eax
movq   $0x0,(%rax)
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
mov    $0x400fd0fc,%eax
movq   $0x0,(%rax)
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_EEPROMSectorMaskClear>:
push   %rax
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
movq   $0x3,0x400fd0fc
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
movq   $0x0,0x400ae2c0
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
movq   $0x0,0x400fd0fc
mov    $0xa,%edi
pop    %rax
jmp    1030 <SysCtlDelay@plt>

LLVM IR (-O0):
define void @_EEPROMSectorMaskClear() {
%1 = call i32 @SysCtlDelay(i32 10)
store volatile i64 3, i64* inttoptr (i64 1074778364 to i64*)
%2 = call i32 @SysCtlDelay(i32 10)
store volatile i64 0, i64* inttoptr (i64 1074455232 to i64*)
%3 = call i32 @SysCtlDelay(i32 10)
store volatile i64 0, i64* inttoptr (i64 1074778364 to i64*)
%4 = call i32 @SysCtlDelay(i32 10)
ret void
}

LLVM IR (-O2):
define void @_EEPROMSectorMaskClear() {
%1 = tail call i32 @SysCtlDelay(i32 10)
store volatile i64 3, i64* inttoptr (i64 1074778364 to i64*)
%2 = tail call i32 @SysCtlDelay(i32 10)
store volatile i64 0, i64* inttoptr (i64 1074455232 to i64*)
%3 = tail call i32 @SysCtlDelay(i32 10)
store volatile i64 0, i64* inttoptr (i64 1074778364 to i64*)
%4 = tail call i32 @SysCtlDelay(i32 10)
ret void
}
int notquote(int c) { return (c != '\"' && c != '\n'); }


x86 assembly (clang, -O0):
<notquote>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x22,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <notquote+0x20>
cmpl   $0xa,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<notquote>:
cmp    $0x22,%edi
setne  %al
cmp    $0xa,%edi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @notquote(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 34
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 10
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @notquote(i32 %0) {
%2 = icmp ne i32 %0, 34
%3 = icmp ne i32 %0, 10
%4 = and i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int lib_a(int);
scalar_t__ lib_d(int);
int main(void) {
  int res = lib_a(1111);
  res += lib_d(4444);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x457,%edi
call   1030 <lib_a@plt>
mov    %eax,-0x8(%rbp)
mov    $0x115c,%edi
call   1040 <lib_d@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @lib_a(i32 1111)
store i32 %3, i32* %2
%4 = call i64 @lib_d(i32 4444)
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = add nsw i64 %6, %4
%8 = trunc i64 %7 to i32
store i32 %8, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @lib_a(i32 1111)
%2 = tail call i64 @lib_d(i32 4444)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hello world \n");
  while (1) {
    int i, j;
  }
  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>
jmp    112b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [14 x i8] c"hello world \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %0, %5
br label %5
}

LLVM IR (-O2):
@str = [13 x i8] c"hello world \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x51() {
  Assert_real((isprint(81)),
              "/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",
              410, ("isprint should be 1 for Q"));
}


x86 assembly (clang, -O0):
<t_isprint_0x51>:
push   %rbp
mov    %rsp,%rbp
mov    $0x51,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x19a,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x51>:
push   %rax
mov    $0x51,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x19a,%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 = [26 x i8] c"isprint should be 1 for Q\00"
define void @t_isprint_0x51() {
%1 = call i32 @isprint(i32 81)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 410, i8* getelementptr inbounds ([26 x i8], [26 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 = [26 x i8] c"isprint should be 1 for Q\00"
define void @t_isprint_0x51() {
%1 = tail call i32 @isprint(i32 81)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 410, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_FAuint16_reg(unsigned short val) {
  return ((val) & (0xFA << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_FAuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 250
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  unsigned char c = argv[1][0];
  if (c == 127)
    printf("win\n");
  else
    printf("lose\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0x7f,%eax
jne    1151 <main+0x41>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    115d <main+0x4d>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rax
cmpb   $0x7f,(%rax)
lea    0xee6(%rip),%rax
lea    0xeda(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [5 x i8] c"lose\00"
@str.2 = [4 x i8] c"win\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 127
%7 = select i1 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0)
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}
/* Variables and functions */
double fabs(double);
double delta(double x, double y) { return fabs(x - y); }


x86 assembly (clang, -O0):
<delta>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movaps 0xee1(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<delta>:
subsd  %xmm1,%xmm0
andpd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @delta(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = call double @llvm.fabs.f64(double %7)
ret double %8
}

LLVM IR (-O2):
define double @delta(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @llvm.fabs.f64(double %3)
ret double %4
}
/* Variables and functions */
scalar_t__ is_prime(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int count = 0;
#pragma omp parallel for reduction(+ : count)
  for (int n = 2; n < 200000; ++n)
    if (is_prime(n))
      ++count;
  printf("Primes found: %d\n", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x30d40,-0xc(%rbp)
jge    1178 <main+0x58>
mov    -0xc(%rbp),%edi
call   1040 <is_prime@plt>
cmp    $0x0,%rax
je     1165 <main+0x45>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116a <main+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
mov    $0x2,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1040 <is_prime@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebx
add    $0x1,%ebp
cmp    $0x30d40,%ebp
jne    1130 <main+0x10>
lea    0xeb0(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Primes found: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 2, i32* %3
br label %4
4: ; preds = %15, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 200000
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load i32, i32* %3
%9 = call i64 @is_prime(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %7
br label %15
15: ; preds = %14
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %4
%19 = load i32, i32* %2
%20 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Primes found: %d\0A\00"
define i32 @main() {
br label %3
1: ; preds = %3
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
3: ; preds = %0, %3
%4 = phi i32 [ 2, %0 ], [ %10, %3 ]
%5 = phi i32 [ 0, %0 ], [ %9, %3 ]
%6 = tail call i64 @is_prime(i32 %4)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %5, %8
%10 = add nuw nsw i32 %4, 1
%11 = icmp eq i32 %10, 200000
br i1 %11, label %1, label %3
}
int do_865() { return 865; }


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

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

LLVM IR (-O0):
define i32 @do_865() {
ret i32 865
}

LLVM IR (-O2):
define i32 @do_865() {
ret i32 865
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ find_track(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rstrip(char *);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  char search_for[80];
  printf("Search for: ");
  fgets(search_for, 80, stdin);
  rstrip(search_for);
  find_track(search_for);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
call   1050 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    0x2e7b(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1060 <fgets@plt>
lea    -0x60(%rbp),%rdi
call   1030 <rstrip@plt>
lea    -0x60(%rbp),%rdi
call   1040 <find_track@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xeb4(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1060 <fgets@plt>
mov    %rbx,%rdi
call   1030 <rstrip@plt>
mov    %rbx,%rdi
call   1040 <find_track@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Search for: \00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [80 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %8, i32 80, i32 %9)
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%12 = call i32 @rstrip(i8* %11)
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%14 = call i32 @find_track(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Search for: \00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %4, i32 80, i32 %6)
%8 = call i32 @rstrip(i8* %4)
%9 = call i32 @find_track(i8* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_tkill;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, int);
int tkill(pid_t tid, int sig) { return syscall(SYS_tkill, tid, sig); }


x86 assembly (clang, -O0):
<tkill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ed3(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tkill>:
mov    %esi,%edx
mov    %edi,%esi
mov    0x2edd(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_tkill = global i32 0
define i32 @tkill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @SYS_tkill
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @syscall(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@SYS_tkill = global i32 0
define i32 @tkill(i32 %0, i32 %1) {
%3 = load i32, i32* @SYS_tkill
%4 = tail call i32 @syscall(i32 %3, i32 %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
void document_close_body_stream(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void document_close_body(void) { return document_close_body_stream(stdout); }


x86 assembly (clang, -O0):
<document_close_body>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <document_close_body_stream@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<document_close_body>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <document_close_body_stream@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @document_close_body() {
%1 = load i32, i32* @stdout
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @document_close_body() {
%1 = load i32, i32* @stdout
tail call void @document_close_body_stream(i32 %1)
ret void
}
int isatty(int file) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @isatty(i32 %0) {
ret i32 -1
}