xunge/DecIR huggingface dataset:
int top_bit(unsigned int bits) {
  int res;
  __asm__(" xorl %[res],%[res];\n"
          " decl %[res];\n"
          " bsrl %[bits],%[res]\n"
          : [res] "=&r"(res)
          : [bits] "rm"(bits));
  return res;
}


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

x86 assembly (clang, -O2):
<top_bit>:
mov    %edi,-0x4(%rsp)
xor    %eax,%eax
dec    %eax
bsr    -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @top_bit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm " xorl $0,$0;\0A decl $0;\0A bsrl $1,$0\0A", "=&r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @top_bit(i32 %0) {
%2 = tail call i32 asm " xorl $0,$0;\0A decl $0;\0A bsrl $1,$0\0A", "=&r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
brkany(chr, strg) char chr, *strg;
{
  register char *sp;
  for (sp = strg; *sp; sp++)
    if (chr == *sp)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<brkany>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1158 <brkany+0x58>
movsbl -0x5(%rbp),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1142 <brkany+0x42>
movl   $0x1,-0x4(%rbp)
jmp    115f <brkany+0x5f>
jmp    1147 <brkany+0x47>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1116 <brkany+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<brkany>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1122 <brkany+0x22>
movsbl %dil,%edx
add    $0x1,%rsi
movsbl %cl,%ecx
cmp    %ecx,%edx
je     1123 <brkany+0x23>
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <brkany+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @brkany(i32 %0, i8* nocapture %1) {
%3 = shl i32 %0, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 0
br i1 %6, label %16, label %10
7: ; preds = %10
%8 = load i8, i8* %15
%9 = icmp eq i8 %8, 0
br i1 %9, label %16, label %10
10: ; preds = %2, %7
%11 = phi i8 [ %8, %7 ], [ %5, %2 ]
%12 = phi i8* [ %15, %7 ], [ %1, %2 ]
%13 = sext i8 %11 to i32
%14 = icmp eq i32 %4, %13
%15 = getelementptr inbounds i8, i8* %12, i64 1
br i1 %14, label %16, label %7
16: ; preds = %10, %7, %2
%17 = phi i32 [ 0, %2 ], [ 0, %7 ], [ 1, %10 ]
ret i32 %17
}
/* Type definitions */
typedef int uint32_t;
typedef int int16_t;

/* Variables and functions */
uint32_t bitScan_fun_int16_t(int16_t x) {
  uint32_t r = 0;
  int16_t s = (x & 0x8000);
  if (x == 0)
    return 15;
  while ((int16_t)((x <<= 1) & 0x8000) == s)
    ++r;
  return r;
}


x86 assembly (clang, -O0):
<bitScan_fun_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x8000,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112f <bitScan_fun_int16_t+0x2f>
movl   $0xf,-0x4(%rbp)
jmp    115f <bitScan_fun_int16_t+0x5f>
jmp    1134 <bitScan_fun_int16_t+0x34>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
and    $0x8000,%eax
cmp    -0x10(%rbp),%eax
jne    1159 <bitScan_fun_int16_t+0x59>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <bitScan_fun_int16_t+0x34>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitScan_fun_int16_t>:
test   %edi,%edi
je     1122 <bitScan_fun_int16_t+0x22>
mov    $0xffffffff,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    %ecx,%ecx
mov    %ecx,%edx
xor    %edi,%edx
add    $0x1,%eax
test   $0x8000,%edx
je     1110 <bitScan_fun_int16_t+0x10>
ret
mov    $0xf,%eax
ret

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

LLVM IR (-O2):
define i32 @bitScan_fun_int16_t(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %10, %3 ], [ 0, %1 ]
%6 = shl i32 %4, 1
%7 = xor i32 %6, %0
%8 = and i32 %7, 32768
%9 = icmp eq i32 %8, 0
%10 = add nuw nsw i32 %5, 1
br i1 %9, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ 15, %1 ], [ %5, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ hasQualifier(char const **, int /*<<< orphan*/ *);
int hasNoQualifier(const char *identifier) {
  return !hasQualifier(&identifier, NULL);
}


x86 assembly (clang, -O0):
<hasNoQualifier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <hasQualifier@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasNoQualifier>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <hasQualifier@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hasNoQualifier(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @hasQualifier(i8** %2, i32* null)
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @hasNoQualifier(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @hasQualifier(i8** %2, i32* null)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
scalar_t__ is_leap_year(scalar_t__);
uint16_t corrected_year_day_number(uint16_t y, uint16_t ydn) {
  uint8_t a;
  a = is_leap_year(y);
  if (ydn > 59 + a) {
    ydn += 2;
    ydn -= a;
  }
  ydn += 91;
  return ydn;
}


x86 assembly (clang, -O0):
<corrected_year_day_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <is_leap_year@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
add    $0x3b,%rcx
cmp    %rcx,%rax
jle    115d <corrected_year_day_number+0x4d>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x5b,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<corrected_year_day_number>:
push   %rbx
mov    %rsi,%rbx
call   1030 <is_leap_year@plt>
mov    %rbx,%rcx
sub    %rax,%rcx
add    $0x3b,%rax
add    $0x2,%rcx
cmp    %rbx,%rax
cmovge %rbx,%rcx
add    $0x5b,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @corrected_year_day_number(i64 %0, i64 %1) {
%3 = tail call i64 @is_leap_year(i64 %0)
%4 = add nsw i64 %3, 59
%5 = icmp slt i64 %4, %1
%6 = add nsw i64 %1, 2
%7 = sub i64 %6, %3
%8 = select i1 %5, i64 %7, i64 %1
%9 = add nsw i64 %8, 91
ret i64 %9
}
void DvRecorder_Destroy(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ dsc_copy_section(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                    long, long, char *, int /*<<< orphan*/ *);
void dsc_copy(FILE *from, FILE *to, long start, long end) {
  char line[258];
  dsc_copy_section(from, to, start, end, line, NULL);
}


x86 assembly (clang, -O0):
<dsc_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    -0x130(%rbp),%r8
xor    %eax,%eax
mov    %eax,%r9d
call   1030 <dsc_copy_section@plt>
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsc_copy>:
sub    $0x108,%rsp
mov    %rsp,%r8
xor    %r9d,%r9d
call   1030 <dsc_copy_section@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
define void @dsc_copy(i32* %0, i32* %1, i64 %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
%9 = alloca [258 x i8]
store i32* %0, i32** %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = getelementptr inbounds [258 x i8], [258 x i8]* %9, i64 0, i64 0
%15 = call i32 @dsc_copy_section(i32* %10, i32* %11, i64 %12, i64 %13, i8* %14, i32* null)
ret void
}

LLVM IR (-O2):
define void @dsc_copy(i32* %0, i32* %1, i64 %2, i64 %3) {
%5 = alloca [258 x i8]
%6 = getelementptr inbounds [258 x i8], [258 x i8]* %5, i64 0, i64 0
%7 = call i32 @dsc_copy_section(i32* %0, i32* %1, i64 %2, i64 %3, i8* %6, i32* null)
ret void
}
int pass_int(int arg) { return arg; }


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

x86 assembly (clang, -O2):
<pass_int>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @pass_int(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int copy_start_solutions_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(7, a, b, c);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @copy_start_solutions_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 7, i32* undef, i32* undef, double* undef)
ret i32 %1
}
void foo728() {}


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

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

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

LLVM IR (-O2):
define void @foo728() {
ret void
}
cpydata(in, out) {
  char buf[512];
  register int i;
  do
    if ((i = read(in, buf, sizeof buf)) > 0)
      write(out, buf, i);
  while (i == sizeof buf);
}


x86 assembly (clang, -O0):
<cpydata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x210(%rbp),%rsi
mov    $0x200,%edx
mov    $0x0,%al
call   1040 <read@plt>
mov    %eax,-0x214(%rbp)
cmp    $0x0,%eax
jle    116d <cpydata+0x4d>
mov    -0xc(%rbp),%edi
lea    -0x210(%rbp),%rsi
mov    -0x214(%rbp),%edx
mov    $0x0,%al
call   1030 <write@plt>
jmp    1172 <cpydata+0x52>
movslq -0x214(%rbp),%rax
cmp    $0x200,%rax
je     1131 <cpydata+0x11>
mov    -0x4(%rbp),%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpydata>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    %esi,%r14d
mov    %edi,%ebp
mov    %rsp,%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x200,%edx
mov    %ebp,%edi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <read@plt>
test   %eax,%eax
jle    116e <cpydata+0x4e>
mov    %eax,%ebx
mov    %r14d,%edi
mov    %r15,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <write@plt>
cmp    $0x200,%ebx
je     1140 <cpydata+0x20>
add    $0x208,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @cpydata(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [512 x i8]
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
br label %8
8: ; preds = %19, %2
%9 = load i32, i32* %4
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%11 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @read to i32 (i32, i8*, i64, ...)*)(i32 %9, i8* %10, i64 512)
store i32 %11, i32* %7
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i32, i32* %5
%15 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%16 = load i32, i32* %7
%17 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %14, i8* %15, i32 %16)
br label %18
18: ; preds = %13, %8
br label %19
19: ; preds = %18
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = icmp eq i64 %21, 512
br i1 %22, label %8, label %23
23: ; preds = %19
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @cpydata(i32 %0, i32 %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
br label %5
5: ; preds = %8, %2
%6 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @read to i32 (i32, i8*, i64, ...)*)(i32 %0, i8* %4, i64 512)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %1, i8* %4, i32 %6)
%10 = icmp eq i32 %6, 512
br i1 %10, label %5, label %11
11: ; preds = %5, %8
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void error(char *msg) { fprintf(stderr, "%s: %s\n", msg, strerror(errno)); }


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xebc(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
ret void
}
/* Type definitions */
struct index_mm_node {
  int dummy;
};
struct index_mm {
  int dummy;
};

/* Variables and functions */
struct index_mm_node *index_mm_readroot(struct index_mm *);
char *index_mm_search_node(struct index_mm_node *, char const *,
                           int /*<<< orphan*/);
char *index_mm_search(struct index_mm *idx, const char *key) {
  struct index_mm_node *root;
  char *value;
  root = index_mm_readroot(idx);
  value = index_mm_search_node(root, key, 0);
  return value;
}


x86 assembly (clang, -O0):
<index_mm_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <index_mm_readroot@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1040 <index_mm_search_node@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_mm_search>:
push   %rbx
mov    %rsi,%rbx
call   1030 <index_mm_readroot@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
pop    %rbx
jmp    1040 <index_mm_search_node@plt>

LLVM IR (-O0):
%struct.index_mm = type { i32 }
%struct.index_mm_node = type { i32 }
define i8* @index_mm_search(%struct.index_mm* %0, i8* %1) {
%3 = alloca %struct.index_mm*
%4 = alloca i8*
%5 = alloca %struct.index_mm_node*
%6 = alloca i8*
store %struct.index_mm* %0, %struct.index_mm** %3
store i8* %1, i8** %4
%7 = load %struct.index_mm*, %struct.index_mm** %3
%8 = call %struct.index_mm_node* @index_mm_readroot(%struct.index_mm* %7)
store %struct.index_mm_node* %8, %struct.index_mm_node** %5
%9 = load %struct.index_mm_node*, %struct.index_mm_node** %5
%10 = load i8*, i8** %4
%11 = call i8* @index_mm_search_node(%struct.index_mm_node* %9, i8* %10, i32 0)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
ret i8* %12
}

LLVM IR (-O2):
%struct.index_mm = type { i32 }
%struct.index_mm_node = type { i32 }
define i8* @index_mm_search(%struct.index_mm* %0, i8* %1) {
%3 = tail call %struct.index_mm_node* @index_mm_readroot(%struct.index_mm* %0)
%4 = tail call i8* @index_mm_search_node(%struct.index_mm_node* %3, i8* %1, i32 0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int searchInsert(int *, int, int);
int main() {
  int a[] = {1, 3, 5, 6};
  printf("%d", searchInsert(a, 4, 7));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
mov    $0x7,%edx
call   1040 <searchInsert@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x7,%edx
call   1040 <searchInsert@plt>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [4 x i32] [i32 1, i32 3, i32 5, i32 6]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @searchInsert(i32* %3, i32 4, i32 7)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ act8600_i2c_en_SaveConfig();
void act8600_i2c_en_Sleep(void) { act8600_i2c_en_SaveConfig(); }


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

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

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

LLVM IR (-O2):
define void @act8600_i2c_en_Sleep() {
%1 = tail call i32 (...) @act8600_i2c_en_SaveConfig()
ret void
}
char *ToUpper(str)
char *str;
{
  return (
      trstr(str, "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
}


x86 assembly (clang, -O0):
<ToUpper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xeed(%rip),%rdx
mov    $0x0,%al
call   1030 <trstr@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ToUpper>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xefc(%rip),%rdx
xor    %eax,%eax
call   1030 <trstr@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
@.str.1 = [27 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define i8* @ToUpper(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @trstr to i32 (i8*, i8*, i8*, ...)*)(i8* %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
@.str = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
@.str.1 = [27 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define i8* @ToUpper(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @trstr to i32 (i8*, i8*, i8*, ...)*)(i8* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t atrshmlog_get_tsc_null_x86_64_gnu(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @atrshmlog_get_tsc_null_x86_64_gnu() {
ret i32 0
}
int isOperation(char c) {
  if (c == '*')
    return 1;
  else if (c == '+')
    return 1;
  else if (c == '-')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isOperation>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
jne    1123 <isOperation+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1166 <isOperation+0x66>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
jne    113c <isOperation+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1166 <isOperation+0x66>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
jne    1155 <isOperation+0x55>
movl   $0x1,-0x4(%rbp)
jmp    1166 <isOperation+0x66>
jmp    115a <isOperation+0x5a>
jmp    115f <isOperation+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOperation>:
add    $0xd6,%dil
xor    %eax,%eax
cmp    $0x3,%dil
ja     111a <isOperation+0x1a>
movsbq %dil,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.isOperation = [4 x i32] [i32 1, i32 1, i32 0, i32 1]
define i32 @isOperation(i8 signext %0) {
%2 = add i8 %0, -42
%3 = icmp ult i8 %2, 4
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.isOperation, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ SystemInit();
void hw_preinit(void) { SystemInit(); }


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

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

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

LLVM IR (-O2):
define void @hw_preinit() {
%1 = tail call i32 (...) @SystemInit()
ret void
}
/* Variables and functions */
int object_number_of(char *);
int lookup_set(char *setname) {
  int object_number;
  object_number = object_number_of(setname);
  if (object_number == 0)
    return (0);
  return (object_number);
}


x86 assembly (clang, -O0):
<lookup_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <object_number_of@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    113e <lookup_set+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1144 <lookup_set+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookup_set>:
jmp    1030 <object_number_of@plt>

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

LLVM IR (-O2):
define i32 @lookup_set(i8* %0) {
%2 = tail call i32 @object_number_of(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_bit_array(uint64_t *bits) { free(bits); }


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

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

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

LLVM IR (-O2):
define void @free_bit_array(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
void os_perf_priv_free(void *priv __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @os_perf_priv_free(i8* nocapture %0) {
ret void
}
void vec3_mul(const float a[3], float k, float out[3]) {
  out[0] = a[0] * k;
  out[1] = a[1] * k;
  out[2] = a[2] * k;
}


x86 assembly (clang, -O0):
<vec3_mul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mulss  -0xc(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mulss  -0xc(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mulss  -0xc(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_mul>:
movss  (%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rsi)
movss  0x4(%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsi)
mulss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rsi)
ret

LLVM IR (-O0):
define void @vec3_mul(float* %0, float %1, float* %2) {
%4 = alloca float*
%5 = alloca float
%6 = alloca float*
store float* %0, float** %4
store float %1, float* %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float, float* %5
%11 = fmul float %9, %10
%12 = load float*, float** %6
%13 = getelementptr inbounds float, float* %12, i64 0
store float %11, float* %13
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = load float, float* %5
%18 = fmul float %16, %17
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 1
store float %18, float* %20
%21 = load float*, float** %4
%22 = getelementptr inbounds float, float* %21, i64 2
%23 = load float, float* %22
%24 = load float, float* %5
%25 = fmul float %23, %24
%26 = load float*, float** %6
%27 = getelementptr inbounds float, float* %26, i64 2
store float %25, float* %27
ret void
}

LLVM IR (-O2):
define void @vec3_mul(float* nocapture %0, float %1, float* nocapture writeonly %2) {
%4 = load float, float* %0
%5 = fmul float %4, %1
store float %5, float* %2
%6 = getelementptr inbounds float, float* %0, i64 1
%7 = load float, float* %6
%8 = fmul float %7, %1
%9 = getelementptr inbounds float, float* %2, i64 1
store float %8, float* %9
%10 = getelementptr inbounds float, float* %0, i64 2
%11 = load float, float* %10
%12 = fmul float %11, %1
%13 = getelementptr inbounds float, float* %2, i64 2
store float %12, float* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
void main() {
  int x = 3;
  foo(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x3,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 3, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @foo(i32 %2)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @foo(i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ event_add(int /*<<< orphan*/, void *);
int /*<<< orphan*/ promptcmd_log_cmd(char *);
void promptcmd_reset(char *args[], int arg_num) {
  event_add(0, (void *)NULL);
  promptcmd_log_cmd("Added reset event.");
}


x86 assembly (clang, -O0):
<promptcmd_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <event_add@plt>
lea    0xebf(%rip),%rdi
call   1040 <promptcmd_log_cmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<promptcmd_reset>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <event_add@plt>
lea    0xecf(%rip),%rdi
pop    %rax
jmp    1040 <promptcmd_log_cmd@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Added reset event.\00"
define void @promptcmd_reset(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = call i32 @event_add(i32 0, i8* null)
%6 = call i32 @promptcmd_log_cmd(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Added reset event.\00"
define void @promptcmd_reset(i8** nocapture readnone %0, i32 %1) {
%3 = tail call i32 @event_add(i32 0, i8* null)
%4 = tail call i32 @promptcmd_log_cmd(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
void revrse(int n, int *v) {
  int *ve;
  int temp;
  ve = v + n - 1;
  while (ve > v) {
    temp = *v;
    *v = *ve;
    *ve = temp;
    ve--;
    v++;
  }
  return;
}


x86 assembly (clang, -O0):
<revrse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    116b <revrse+0x6b>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    1122 <revrse+0x22>
pop    %rbp
ret

x86 assembly (clang, -O2):
<revrse>:
movslq %edi,%rax
lea    (%rsi,%rax,4),%rax
add    $0xfffffffffffffffc,%rax
cmp    %rsi,%rax
jbe    113a <revrse+0x3a>
add    $0x4,%rsi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    -0x4(%rsi),%ecx
mov    (%rax),%edx
mov    %edx,-0x4(%rsi)
mov    %ecx,(%rax)
add    $0xfffffffffffffffc,%rax
lea    0x4(%rsi),%rcx
cmp    %rsi,%rax
mov    %rcx,%rsi
ja     1120 <revrse+0x20>
ret

LLVM IR (-O0):
define void @revrse(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** %4
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = getelementptr inbounds i32, i32* %10, i64 -1
store i32* %11, i32** %5
br label %12
12: ; preds = %16, %2
%13 = load i32*, i32** %5
%14 = load i32*, i32** %4
%15 = icmp ugt i32* %13, %14
br i1 %15, label %16, label %28
16: ; preds = %12
%17 = load i32*, i32** %4
%18 = load i32, i32* %17
store i32 %18, i32* %6
%19 = load i32*, i32** %5
%20 = load i32, i32* %19
%21 = load i32*, i32** %4
store i32 %20, i32* %21
%22 = load i32, i32* %6
%23 = load i32*, i32** %5
store i32 %22, i32* %23
%24 = load i32*, i32** %5
%25 = getelementptr inbounds i32, i32* %24, i32 -1
store i32* %25, i32** %5
%26 = load i32*, i32** %4
%27 = getelementptr inbounds i32, i32* %26, i32 1
store i32* %27, i32** %4
br label %12
28: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @revrse(i32 %0, i32* %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i32, i32* %1, i64 %3
%5 = getelementptr inbounds i32, i32* %4, i64 -1
%6 = icmp ugt i32* %5, %1
br i1 %6, label %7, label %15
7: ; preds = %2, %7
%8 = phi i32* [ %13, %7 ], [ %5, %2 ]
%9 = phi i32* [ %12, %7 ], [ %1, %2 ]
%10 = load i32, i32* %9
%11 = load i32, i32* %8
store i32 %11, i32* %9
store i32 %10, i32* %8
%12 = getelementptr inbounds i32, i32* %9, i64 1
%13 = getelementptr inbounds i32, i32* %8, i64 -1
%14 = icmp ugt i32* %13, %12
br i1 %14, label %7, label %15
15: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parsingReset();
void sj_onObjectStart(char *name) { parsingReset(); }


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

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

LLVM IR (-O0):
define void @sj_onObjectStart(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @parsingReset()
ret void
}

LLVM IR (-O2):
define void @sj_onObjectStart(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @parsingReset()
ret void
}
int mysum(int a, int b, int d, int e) { return a + b + d + e; }


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

x86 assembly (clang, -O2):
<mysum>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mysum(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %7
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %8
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @mysum(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, %0
%6 = add nsw i32 %5, %2
%7 = add nsw i32 %6, %3
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void sig_pipe_handler(int signum) { fputs(("\n#broken pipe.\n"), stdout); }


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

x86 assembly (clang, -O2):
<sig_pipe_handler>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"\0A#broken pipe.\0A\00"
@stdout = global i32 0
define void @sig_pipe_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0A#broken pipe.\0A\00"
@stdout = global i32 0
define void @sig_pipe_handler(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void *avoid_thread(void *data) {
  while (1) {
    do {
    } while (0);
    sleep(2);
  }
}


x86 assembly (clang, -O0):
<avoid_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
jmp    1121 <avoid_thread+0x11>
jmp    1126 <avoid_thread+0x16>
mov    $0x2,%edi
call   1030 <sleep@plt>
jmp    111c <avoid_thread+0xc>

x86 assembly (clang, -O2):
<avoid_thread>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2,%edi
call   1030 <sleep@plt>
jmp    1120 <avoid_thread+0x10>

LLVM IR (-O0):
define i8* @avoid_thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %5
br label %4
4: ; preds = %3
br label %5
5: ; preds = %4
%6 = call i32 @sleep(i32 2)
br label %3
}

LLVM IR (-O2):
define noalias i8* @avoid_thread(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @sleep(i32 2)
br label %2
}
struct list *PassThroughList(struct list *L) {
  return L;
}


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

x86 assembly (clang, -O2):
<PassThroughList>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.list = type opaque
define %struct.list* @PassThroughList(%struct.list* %0) {
%2 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
%3 = load %struct.list*, %struct.list** %2
ret %struct.list* %3
}

LLVM IR (-O2):
%struct.list = type opaque
define %struct.list* @PassThroughList(%struct.list* readnone returned %0) {
ret %struct.list* %0
}
/* Type definitions */
struct Value {
  int dummy;
};
struct ParseState {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ grab_reference_frame();
void Cvrcap(struct ParseState *Parser, struct Value *ReturnValue,
            struct Value **Param, int NumArgs) {
  grab_reference_frame();
}


x86 assembly (clang, -O0):
<Cvrcap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <grab_reference_frame@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ParseState = type { i32 }
%struct.Value = type { i32 }
define void @Cvrcap(%struct.ParseState* %0, %struct.Value* %1, %struct.Value** %2, i32 %3) {
%5 = alloca %struct.ParseState*
%6 = alloca %struct.Value*
%7 = alloca %struct.Value**
%8 = alloca i32
store %struct.ParseState* %0, %struct.ParseState** %5
store %struct.Value* %1, %struct.Value** %6
store %struct.Value** %2, %struct.Value*** %7
store i32 %3, i32* %8
%9 = call i32 (...) @grab_reference_frame()
ret void
}

LLVM IR (-O2):
%struct.ParseState = type { i32 }
%struct.Value = type { i32 }
define void @Cvrcap(%struct.ParseState* nocapture readnone %0, %struct.Value* nocapture readnone %1, %struct.Value** nocapture readnone %2, i32 %3) {
%5 = tail call i32 (...) @grab_reference_frame()
ret void
}
int max(int x, int y) {
  int z;
  z = x > y ? x : y;
  return z;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void PlotPixel16(int x, int y, uint16_t colour) {
  ((volatile uint16_t *)(0x6000000))[y * 240 + x] = colour;
}


x86 assembly (clang, -O0):
<PlotPixel16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%edx
imul   $0xf0,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
movslq %eax,%rcx
mov    $0x6000000,%eax
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PlotPixel16>:
imul   $0xf0,%esi,%eax
add    %edi,%eax
cltq
mov    %edx,0x6000000(,%rax,4)
ret

LLVM IR (-O0):
define void @PlotPixel16(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %5
%9 = mul nsw i32 %8, 240
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* inttoptr (i64 100663296 to i32*), i64 %12
store volatile i32 %7, i32* %13
ret void
}

LLVM IR (-O2):
define void @PlotPixel16(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, 240
%5 = add nsw i32 %4, %0
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* inttoptr (i64 100663296 to i32*), i64 %6
store volatile i32 %2, i32* %7
ret void
}
void init_serial(unsigned int sysClk) { (void)sysClk; }


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

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

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

LLVM IR (-O2):
define void @init_serial(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ rdrand_get();
void genvalue(unsigned char *x) {
  uint64_t *xptr = (uint64_t *)x;
  for (int idx = 0; idx < 4; ++idx)
    xptr[idx] = rdrand_get();
}


x86 assembly (clang, -O0):
<genvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1157 <genvalue+0x47>
mov    $0x0,%al
call   1030 <rdrand_get@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <genvalue+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genvalue>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rdrand_get@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
call   1030 <rdrand_get@plt>
mov    %eax,0x4(%rbx)
xor    %eax,%eax
call   1030 <rdrand_get@plt>
mov    %eax,0x8(%rbx)
xor    %eax,%eax
call   1030 <rdrand_get@plt>
mov    %eax,0xc(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @genvalue(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 (...) @rdrand_get()
store i32 %3, i32* %2
%4 = tail call i32 (...) @rdrand_get()
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
store i32 %4, i32* %6
%7 = tail call i32 (...) @rdrand_get()
%8 = getelementptr inbounds i8, i8* %0, i64 8
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
%10 = tail call i32 (...) @rdrand_get()
%11 = getelementptr inbounds i8, i8* %0, i64 12
%12 = bitcast i8* %11 to i32*
store i32 %10, i32* %12
ret void
}