xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: test_steal $PID\n");
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Usage: test_steal $PID\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [23 x i8] c"Usage: test_steal $PID\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
long rand();
int /*<<< orphan*/ seed_random();
long get_random() {
  static int initialized;
  if (!initialized) {
    seed_random();
    initialized = 1;
  }
  return (rand());
}


x86 assembly (clang, -O0):
<get_random>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f09(%rip)
jne    1142 <get_random+0x22>
mov    $0x0,%al
call   1030 <seed_random@plt>
movl   $0x1,0x2ef2(%rip)
mov    $0x0,%al
call   1040 <rand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random>:
push   %rax
cmpb   $0x0,0x2f0c(%rip)
jne    1138 <get_random+0x18>
xor    %eax,%eax
call   1030 <seed_random@plt>
movb   $0x1,0x2efc(%rip)
xor    %eax,%eax
pop    %rcx
jmp    1040 <rand@plt>

LLVM IR (-O0):
@get_random.initialized = internal global i32 0
define i64 @get_random() {
%1 = load i32, i32* @get_random.initialized
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 (...) @seed_random()
store i32 1, i32* @get_random.initialized
br label %5
5: ; preds = %3, %0
%6 = call i64 (...) @rand()
ret i64 %6
}

LLVM IR (-O2):
@get_random.initialized = internal unnamed_addr global i1 false
define i64 @get_random() {
%1 = load i1, i1* @get_random.initialized
br i1 %1, label %4, label %2
2: ; preds = %0
%3 = tail call i32 (...) @seed_random()
store i1 true, i1* @get_random.initialized
br label %4
4: ; preds = %2, %0
%5 = tail call i64 (...) @rand()
ret i64 %5
}
int a(int x, int y) {
  unsigned t = x & y;
  unsigned tt = x | y;
  t = t - tt;
  return t + -1;
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
mov    %edi,%eax
xor    %esi,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @a(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = and i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = or i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub i32 %13, %14
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = add i32 %16, -1
ret i32 %17
}

LLVM IR (-O2):
define i32 @a(i32 %0, i32 %1) {
%3 = xor i32 %0, %1
%4 = xor i32 %3, -1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_ldi_hlp_a(void) { op_write1(0x22); }


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

x86 assembly (clang, -O2):
<op_enc_ldi_hlp_a>:
mov    $0x22,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_ldi_hlp_a() {
%1 = call i32 @op_write1(i32 34)
ret void
}

LLVM IR (-O2):
define void @op_enc_ldi_hlp_a() {
%1 = tail call i32 @op_write1(i32 34)
ret void
}
/* Variables and functions */
double ceil(double const);
double stdlib_base_ceil(const double x) { return ceil(x); }


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

x86 assembly (clang, -O2):
<stdlib_base_ceil>:
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define double @stdlib_base_ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.ceil.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @stdlib_base_ceil(double %0) {
%2 = tail call double @llvm.ceil.f64(double %0)
ret double %2
}
/* Variables and functions */
int get_dimlen(char const *, char *);
int read_mosaic_xgrid_size(const char *xgrid_file) {
  int ncells;
  ncells = get_dimlen(xgrid_file, "ncells");
  return ncells;
}


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

x86 assembly (clang, -O2):
<read_mosaic_xgrid_size>:
lea    0xee9(%rip),%rsi
jmp    1030 <get_dimlen@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"ncells\00"
define i32 @read_mosaic_xgrid_size(i8* %0) {
%2 = tail call i32 @get_dimlen(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void print_help(char *name) {
  printf(
      "\nUsage: %s [action] [action] ...\n\n"
      "    Each action is of the form: [type][value]\n"
      "    Where type is one of G (Go) or P (Pause)\n"
      "    For Go actions, the value is an integer 0-100 specifying\n"
      "    the servo position as a percent of the total range.\n"
      "    For Pause actions, the value is time in milliseconds to pause.\n\n"
      "    For example, the following command would go to 10%%, wait 1500ms "
      "and go to 60%%:\n"
      "        %s G10 P1500 G60\n",
      name, name);
}


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

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

LLVM IR (-O0):
@.str = [421 x i8] c"\0AUsage: %s [action] [action] ...\0A\0A Each action is of the form: [type][value]\0A Where type is one of G (Go) or P (Pause)\0A For Go actions, the value is an integer 0-100 specifying\0A the servo position as a percent of the total range.\0A For Pause actions, the value is time in milliseconds to pause.\0A\0A For example, the following command would go to 10%%, wait 1500ms and go to 60%%:\0A %s G10 P1500 G60\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([421 x i8], [421 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [421 x i8] c"\0AUsage: %s [action] [action] ...\0A\0A Each action is of the form: [type][value]\0A Where type is one of G (Go) or P (Pause)\0A For Go actions, the value is an integer 0-100 specifying\0A the servo position as a percent of the total range.\0A For Pause actions, the value is time in milliseconds to pause.\0A\0A For example, the following command would go to 10%%, wait 1500ms and go to 60%%:\0A %s G10 P1500 G60\0A\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([421 x i8], [421 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret void
}
/* Variables and functions */
double ceil(double);
double floor(double);
double float_truncate(double value) {
  if (value > 0.0) {
    return floor(value);
  } else if (value < 0.0) {
    return ceil(value);
  }
  return value;
}


x86 assembly (clang, -O0):
<float_truncate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1153 <float_truncate+0x33>
movsd  -0x10(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1184 <float_truncate+0x64>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1175 <float_truncate+0x55>
movsd  -0x10(%rbp),%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1184 <float_truncate+0x64>
jmp    117a <float_truncate+0x5a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_truncate>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112f <float_truncate+0xf>
jmp    1040 <floor@plt>
ucomisd %xmm0,%xmm1
jbe    113a <float_truncate+0x1a>
jmp    1030 <ceil@plt>
ret

LLVM IR (-O0):
define double @float_truncate(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = call double @llvm.floor.f64(double %7)
store double %8, double* %2
br label %18
9: ; preds = %1
%10 = load double, double* %3
%11 = fcmp olt double %10, 0.000000e+00
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load double, double* %3
%14 = call double @llvm.ceil.f64(double %13)
store double %14, double* %2
br label %18
15: ; preds = %9
br label %16
16: ; preds = %15
%17 = load double, double* %3
store double %17, double* %2
br label %18
18: ; preds = %16, %12, %6
%19 = load double, double* %2
ret double %19
}

LLVM IR (-O2):
define double @float_truncate(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @llvm.floor.f64(double %0)
br label %9
5: ; preds = %1
%6 = fcmp olt double %0, 0.000000e+00
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call double @llvm.ceil.f64(double %0)
br label %9
9: ; preds = %5, %7, %3
%10 = phi double [ %4, %3 ], [ %8, %7 ], [ %0, %5 ]
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void nocrash_fputs() {
  FILE *f;
  f = fopen("this_file_doesnt_exist", "r");
  if (f) {
    fputs("blablabla", f);
    fclose(f);
  }
}


x86 assembly (clang, -O0):
<nocrash_fputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1173 <nocrash_fputs+0x43>
mov    -0x8(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1040 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nocrash_fputs>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     116e <nocrash_fputs+0x3e>
mov    %rax,%rbx
lea    0xec6(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [10 x i8] c"blablabla\00"
define void @nocrash_fputs() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load i32*, i32** %1
%7 = call i32 @fputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32* %6)
%8 = load i32*, i32** %1
%9 = call i32 @fclose(i32* %8)
br label %10
10: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [10 x i8] c"blablabla\00"
define void @nocrash_fputs() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i64 9, i64 1, i32* %1)
%5 = tail call i32 @fclose(i32* %1)
br label %6
6: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
int /*<<< orphan*/ sleep(int);
int syscall(int /*<<< orphan*/);
void *thread(void *arg) {
  *(int *)arg = syscall(SYS_gettid);
  while (1)
    sleep(1);
  return NULL;
}


x86 assembly (clang, -O0):
<thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1142 <thread+0x22>

x86 assembly (clang, -O2):
<thread>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
mov    %eax,(%rbx)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1140 <thread+0x20>

LLVM IR (-O0):
@SYS_gettid = global i32 0
define i8* @thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @SYS_gettid
%4 = call i32 @syscall(i32 %3)
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
store i32 %4, i32* %6
br label %7
7: ; preds = %1, %7
%8 = call i32 @sleep(i32 1)
br label %7
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
define noalias i8* @thread(i8* nocapture writeonly %0) {
%2 = load i32, i32* @SYS_gettid
%3 = tail call i32 @syscall(i32 %2)
%4 = bitcast i8* %0 to i32*
store i32 %3, i32* %4
br label %5
5: ; preds = %1, %5
%6 = tail call i32 @sleep(i32 1)
br label %5
}
int alive() { return 1; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned char);
void print_hash(FILE *output, unsigned char *hash, size_t len) {
  size_t i;
  for (i = 0; i < len; ++i) {
    fprintf(output, "%02x", hash[i]);
  }
}


x86 assembly (clang, -O0):
<print_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1167 <print_hash+0x57>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
lea    0xeb3(%rip),%rsi
movzbl (%rax,%rcx,1),%edx
call   1030 <fprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <print_hash+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hash>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %rdx,%rdx
je     1149 <print_hash+0x39>
mov    %rdx,%r13
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xed0(%rip),%r12
movzbl (%r14,%rbx,1),%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1130 <print_hash+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%02x\00"
define void @print_hash(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i64 0, i64* %7
br label %8
8: ; preds = %19, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %6
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i32*, i32** %4
%14 = load i8*, i8** %5
%15 = load i64, i64* %7
%16 = getelementptr inbounds i8, i8* %14, i64 %15
%17 = load i8, i8* %16
%18 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %17)
br label %19
19: ; preds = %12
%20 = load i64, i64* %7
%21 = add i64 %20, 1
store i64 %21, i64* %7
br label %8
22: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%02x\00"
define void @print_hash(i32* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %12, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %10, %5 ], [ 0, %3 ]
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %8)
%10 = add nuw 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 */
double pow(double, double);
double linear_to_gamma_2_2(double value) {
  if (value > 0.003130804954)
    return 1.055 * pow(value, (1.0 / 2.4)) - 0.055;
  return 12.92 * value;
}


x86 assembly (clang, -O0):
<linear_to_gamma_2_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1168 <linear_to_gamma_2_2+0x58>
movsd  -0x10(%rbp),%xmm0
movsd  0xedf(%rip),%xmm1
call   1030 <pow@plt>
movsd  0xec2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebe(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117a <linear_to_gamma_2_2+0x6a>
movsd  0xe98(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_to_gamma_2_2>:
push   %rax
ucomisd 0xee7(%rip),%xmm0
jbe    113a <linear_to_gamma_2_2+0x2a>
movsd  0xeed(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xee8(%rip),%xmm0
addsd  0xee8(%rip),%xmm0
pop    %rax
ret
mulsd  0xec6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @linear_to_gamma_2_2(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0x3F69A5C61C671835
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %3
%8 = call double @pow(double %7, double 0x3FDAAAAAAAAAAAAB)
%9 = call double @llvm.fmuladd.f64(double 1.055000e+00, double %8, double -5.500000e-02)
store double %9, double* %2
br label %13
10: ; preds = %1
%11 = load double, double* %3
%12 = fmul double 1.292000e+01, %11
store double %12, double* %2
br label %13
13: ; preds = %10, %6
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @linear_to_gamma_2_2(double %0) {
%2 = fcmp ogt double %0, 0x3F69A5C61C671835
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call double @pow(double %0, double 0x3FDAAAAAAAAAAAAB)
%5 = tail call double @llvm.fmuladd.f64(double %4, double 1.055000e+00, double -5.500000e-02)
br label %8
6: ; preds = %1
%7 = fmul double %0, 1.292000e+01
br label %8
8: ; preds = %6, %3
%9 = phi double [ %5, %3 ], [ %7, %6 ]
ret double %9
}
/* Variables and functions */
scalar_t__ isNumber(char);
int numberLength(char *number) {
  int i;
  for (i = 0; isNumber(number[i]); i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<numberLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isNumber@plt>
cmp    $0x0,%rax
je     1151 <numberLength+0x41>
jmp    1143 <numberLength+0x33>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <numberLength+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numberLength>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0xffffffff,%ebp
nopl   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <isNumber@plt>
add    $0x1,%ebp
add    $0x1,%rbx
test   %rax,%rax
jne    1120 <numberLength+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @numberLength(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %8, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = tail call i64 @isNumber(i8 signext %5)
%7 = icmp eq i64 %6, 0
%8 = add nuw i64 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
%10 = trunc i64 %3 to i32
ret i32 %10
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ _nvram_buf_set(char *, char *, char *);
int nvram_commit(int /*<<< orphan*/);
int32_t nvram_set(char *section, char *key, char *value) {
  ;
  if ((0) == _nvram_buf_set(section, key, value))
    return nvram_commit(0);
  return (-1);
}


x86 assembly (clang, -O0):
<nvram_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <_nvram_buf_set@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    1160 <nvram_set+0x40>
xor    %edi,%edi
call   1030 <nvram_commit@plt>
mov    %eax,-0x4(%rbp)
jmp    1167 <nvram_set+0x47>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvram_set>:
push   %rax
call   1040 <_nvram_buf_set@plt>
test   %eax,%eax
je     1131 <nvram_set+0x11>
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %edi,%edi
pop    %rax
jmp    1030 <nvram_commit@plt>

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

LLVM IR (-O2):
define i32 @nvram_set(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @_nvram_buf_set(i8* %0, i8* %1, i8* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @nvram_commit(i32 0)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int crescente(int N) {
  if (N == 0) {
    printf("N: %d\n", N);
    return 0;
  } else {
    printf("N: %d\n", N);
    return crescente(N - 1);
  }
}


x86 assembly (clang, -O0):
<crescente>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1150 <crescente+0x30>
mov    -0x8(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    116d <crescente+0x4d>
mov    -0x8(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <crescente@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crescente>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     113f <crescente+0x2f>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <crescente+0x20>
lea    0xeba(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"N: %d\0A\00"
define i32 @crescente(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %5, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ %0, %1 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add nsw i32 %6, -1
%9 = icmp eq i32 %8, 0
br i1 %9, label %3, label %5
}
int foo(int i, int j) { return (i < j + 1) || (j > i - 1); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%edx
add    $0x1,%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x9(%rbp)
jl     1131 <foo+0x31>
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmp    %esi,%edi
setle  %al
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = icmp slt i32 %5, %7
br i1 %8, label %14, label %9
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = icmp sgt i32 %10, %12
br label %14
14: ; preds = %9, %2
%15 = phi i1 [ true, %2 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp sle i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int main() {
  int x = 1;
  if (x) {
    return 1;
  } else {
    return 2;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1128 <main+0x28>
movl   $0x1,-0x4(%rbp)
jmp    112f <main+0x2f>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ errno;
scalar_t__ rename(char *, char *);
int /*<<< orphan*/ send_errno(int /*<<< orphan*/);
int /*<<< orphan*/ send_success();
void do_mv(int argc, char **argv) {
  assert(argc == 2);
  if (rename(argv[0], argv[1]) == 0) {
    send_success();
  } else {
    send_errno(errno);
  }
}


x86 assembly (clang, -O0):
<do_mv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1050 <rename@plt>
cmp    $0x0,%rax
jne    118a <do_mv+0x4a>
mov    $0x0,%al
call   1040 <send_success@plt>
jmp    1198 <do_mv+0x58>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
call   1060 <send_errno@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_mv>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
mov    %eax,%edi
call   1030 <assert@plt>
mov    (%rbx),%rdi
mov    0x8(%rbx),%rsi
call   1050 <rename@plt>
test   %rax,%rax
je     1173 <do_mv+0x33>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
pop    %rbx
jmp    1060 <send_errno@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <send_success@plt>

LLVM IR (-O0):
@errno = global i32 0
define void @do_mv(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 2
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i64 @rename(i8* %11, i8* %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @send_success()
br label %22
19: ; preds = %2
%20 = load i32, i32* @errno
%21 = call i32 @send_errno(i32 %20)
br label %22
22: ; preds = %19, %17
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @do_mv(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @rename(i8* %6, i8* %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = tail call i32 (...) @send_success()
br label %16
13: ; preds = %2
%14 = load i32, i32* @errno
%15 = tail call i32 @send_errno(i32 %14)
br label %16
16: ; preds = %13, %11
ret void
}
unsigned eq_hash(const char *p) {
  (void)p;
  return 5;
}


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

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

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

LLVM IR (-O2):
define i32 @eq_hash(i8* nocapture readnone %0) {
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ double_open(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc < 2) {
    printf("Missing filename\n");
    exit(127);
  }
  double_open(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1166 <main+0x36>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x7f,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <double_open@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jle    1143 <main+0x13>
mov    0x8(%rsi),%rdi
call   1040 <double_open@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x7f,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@str = [17 x i8] c"Missing filename\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 127)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @double_open(i8* %9)
ret i32 0
}
char *strchr(const char *pString, int character) {
  char *p = (char *)pString;
  char c = character & 0xFF;
  while (*p != c) {
    if (*p == 0) {
      return 0;
    }
    p++;
  }
  return p;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x21(%rbp),%ecx
cmp    %ecx,%eax
je     115f <strchr+0x5f>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114e <strchr+0x4e>
movq   $0x0,-0x8(%rbp)
jmp    1167 <strchr+0x67>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111e <strchr+0x1e>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
movsbl (%rdi),%edx
cmp    %edx,%ecx
je     1120 <strchr+0x20>
xchg   %ax,%ax
test   %dl,%dl
je     1121 <strchr+0x21>
movsbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    %edx,%ecx
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @strchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
%9 = load i32, i32* %5
%10 = and i32 %9, 255
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
br label %12
12: ; preds = %25, %2
%13 = load i8*, i8** %6
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = load i8, i8* %7
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %15, %17
br i1 %18, label %19, label %28
19: ; preds = %12
%20 = load i8*, i8** %6
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %19
store i8* null, i8** %3
br label %30
25: ; preds = %19
%26 = load i8*, i8** %6
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %6
br label %12
28: ; preds = %12
%29 = load i8*, i8** %6
store i8* %29, i8** %3
br label %30
30: ; preds = %28, %24
%31 = load i8*, i8** %3
ret i8* %31
}

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %17, label %8
8: ; preds = %2, %12
%9 = phi i8 [ %14, %12 ], [ %5, %2 ]
%10 = phi i8* [ %13, %12 ], [ %0, %2 ]
%11 = icmp eq i8 %9, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %4, %15
br i1 %16, label %17, label %8
17: ; preds = %8, %12, %2
%18 = phi i8* [ %0, %2 ], [ %13, %12 ], [ null, %8 ]
ret i8* %18
}
int sem_sub(int semid, int val) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sem_sub(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
unsigned int strlen(const char *str) {
  unsigned int len = 0;
  while (str[len]) {
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     112e <strlen+0x2e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int op_if(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ t();
int op_or(int a, int b) { return op_if(a, t(), b); }


x86 assembly (clang, -O0):
<op_or>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <t@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
call   1040 <op_if@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_or>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <t@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <op_if@plt>

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

LLVM IR (-O2):
define i32 @op_or(i32 %0, i32 %1) {
%3 = tail call i32 (...) @t()
%4 = tail call i32 @op_if(i32 %0, i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int swap_quaddobl_slices(void) {
  double *c;
  int fail, *a, *b;
  fail = _ada_use_c2phc(666, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<swap_quaddobl_slices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x29a,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_quaddobl_slices>:
mov    $0x29a,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @swap_quaddobl_slices() {
%1 = alloca double*
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = load double*, double** %1
%8 = call i32 @_ada_use_c2phc(i32 666, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %2
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @swap_quaddobl_slices() {
%1 = tail call i32 @_ada_use_c2phc(i32 666, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
scalar_t__ VIM_HIF_GetReg16(int);
int /*<<< orphan*/ VIM_HIF_SetReg8(int, int);
unsigned short VIM_LCDIF_RsLExR(void) {
  VIM_HIF_SetReg8((0x0400 + 0x026), 0x0);
  return (unsigned short)VIM_HIF_GetReg16((0x0400 + 0x022));
}


x86 assembly (clang, -O0):
<VIM_LCDIF_RsLExR>:
push   %rbp
mov    %rsp,%rbp
mov    $0x426,%edi
xor    %esi,%esi
call   1040 <VIM_HIF_SetReg8@plt>
mov    $0x422,%edi
call   1030 <VIM_HIF_GetReg16@plt>
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_LCDIF_RsLExR>:
push   %rax
mov    $0x426,%edi
xor    %esi,%esi
call   1040 <VIM_HIF_SetReg8@plt>
mov    $0x422,%edi
call   1030 <VIM_HIF_GetReg16@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @VIM_LCDIF_RsLExR() {
%1 = call i32 @VIM_HIF_SetReg8(i32 1062, i32 0)
%2 = call i64 @VIM_HIF_GetReg16(i32 1058)
%3 = trunc i64 %2 to i16
ret i16 %3
}

LLVM IR (-O2):
define zeroext i16 @VIM_LCDIF_RsLExR() {
%1 = tail call i32 @VIM_HIF_SetReg8(i32 1062, i32 0)
%2 = tail call i64 @VIM_HIF_GetReg16(i32 1058)
%3 = trunc i64 %2 to i16
ret i16 %3
}
__typeof__(printf(1, 1)) test_printf_239(void) { return printf(1, 1); }


x86 assembly (clang, -O0):
<test_printf_239>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_printf_239>:
mov    $0x1,%edi
mov    $0x1,%esi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
define i32 @test_printf_239() {
%1 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_printf_239() {
%1 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i32 1)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_STRING;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ DIRECTORYSTRING_it;
void DIRECTORYSTRING_free(ASN1_STRING *a) {
  ASN1_item_free((ASN1_VALUE *)a, &DIRECTORYSTRING_it);
}


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

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

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

LLVM IR (-O2):
@DIRECTORYSTRING_it = global i32 0
define void @DIRECTORYSTRING_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @DIRECTORYSTRING_it)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ h265nal_init(int *);
int /*<<< orphan*/ h265nal_set_type(int *, int);
void h265aud_init(uint8_t *p_h265aud) {
  h265nal_init(p_h265aud);
  h265nal_set_type(p_h265aud, 35);
  p_h265aud[5] = 0x10;
}


x86 assembly (clang, -O0):
<h265aud_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <h265nal_init@plt>
mov    -0x8(%rbp),%rdi
mov    $0x23,%esi
call   1030 <h265nal_set_type@plt>
mov    -0x8(%rbp),%rax
movl   $0x10,0x14(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265aud_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <h265nal_init@plt>
mov    %rbx,%rdi
mov    $0x23,%esi
call   1030 <h265nal_set_type@plt>
movl   $0x10,0x14(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @h265aud_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @h265nal_init(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @h265nal_set_type(i32* %5, i32 35)
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 5
store i32 16, i32* %8
ret void
}

LLVM IR (-O2):
define void @h265aud_init(i32* %0) {
%2 = tail call i32 @h265nal_init(i32* %0)
%3 = tail call i32 @h265nal_set_type(i32* %0, i32 35)
%4 = getelementptr inbounds i32, i32* %0, i64 5
store i32 16, i32* %4
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double tdiv(double value, struct timeval tv) {
  return value / ((double)tv.tv_sec + ((double)tv.tv_usec / 1000000.0));
}


x86 assembly (clang, -O0):
<tdiv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm2
movsd  0xed6(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tdiv>:
cvtsi2sd %rsi,%xmm1
cvtsi2sd %rdi,%xmm2
divsd  0xeee(%rip),%xmm2
addsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @tdiv(double %0, i64 %1, i64 %2) {
%4 = alloca %struct.timeval
%5 = alloca double
%6 = bitcast %struct.timeval* %4 to { i64, i64 }*
%7 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %6, i32 0, i32 0
store i64 %1, i64* %7
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %6, i32 0, i32 1
store i64 %2, i64* %8
store double %0, double* %5
%9 = load double, double* %5
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to double
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%14 = load i64, i64* %13
%15 = sitofp i64 %14 to double
%16 = fdiv double %15, 1.000000e+06
%17 = fadd double %12, %16
%18 = fdiv double %9, %17
ret double %18
}

LLVM IR (-O2):
define double @tdiv(double %0, i64 %1, i64 %2) {
%4 = sitofp i64 %2 to double
%5 = sitofp i64 %1 to double
%6 = fdiv double %5, 1.000000e+06
%7 = fadd double %6, %4
%8 = fdiv double %0, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello(void (*f)()) {
  printf("in C\n");
  f();
}


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

x86 assembly (clang, -O2):
<hello>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
mov    %rbx,%rcx
pop    %rbx
jmp    *%rcx

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

LLVM IR (-O2):
@str = [5 x i8] c"in C\00"
define void @hello(void (...)* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
tail call void (...) %0()
ret void
}