xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR9B_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR9B_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR9B_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
void bar() { return; }


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

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

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

LLVM IR (-O2):
define void @bar() {
ret void
}
to16bit(c1, c2) int c1, c2;
{ return ((c1 & 0xff) << 8) + (c2 & 0xff); }


x86 assembly (clang, -O0):
<to16bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to16bit>:
shl    $0x8,%edi
movzwl %di,%ecx
movzbl %sil,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @to16bit(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 = and i32 %5, 255
%7 = shl i32 %6, 8
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @to16bit(i32 %0, i32 %1) {
%3 = shl i32 %0, 8
%4 = and i32 %3, 65280
%5 = and i32 %1, 255
%6 = or i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char z[9];
  printf("Enter string: ");
  scanf("%[aeiou]", z);
  printf("The input was \"%s\"\n", z);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Enter string: \00"
@.str.1 = [9 x i8] c"%[aeiou]\00"
@.str.2 = [20 x i8] c"The input was \22%s\22\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter string: \00"
@.str.1 = [9 x i8] c"%[aeiou]\00"
@.str.2 = [20 x i8] c"The input was \22%s\22\0A\00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
long long int lmax(long long int a, long long int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<lmax>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <lmax+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <lmax+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmax>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @lmax(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int ObjectSize3(void *const p __attribute__((pass_object_size(3)))) {
  return __builtin_object_size(p, 3);
}


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

x86 assembly (clang, -O2):
<ObjectSize3>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i32 @ObjectSize3(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ObjectSize3(i8* nocapture readnone %0, i64 %1) {
%3 = trunc i64 %1 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int compose_woven(uint16_t width, uint16_t height, int i, int j) {
  return (j * (width >> 2) + (i >> 2)) + (i & 3) * (width >> 2) * height;
}


x86 assembly (clang, -O0):
<compose_woven>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
imul   %ecx,%eax
mov    -0xc(%rbp),%ecx
sar    $0x2,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
and    $0x3,%ecx
mov    -0x4(%rbp),%edx
sar    $0x2,%edx
imul   %edx,%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compose_woven>:
sar    $0x2,%edi
mov    %edx,%r8d
sar    $0x2,%r8d
and    $0x3,%edx
imul   %esi,%edx
lea    (%rdx,%rcx,1),%eax
imul   %edi,%eax
add    %r8d,%eax
ret

LLVM IR (-O0):
define i32 @compose_woven(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32, i32* %5
%11 = ashr i32 %10, 2
%12 = mul nsw i32 %9, %11
%13 = load i32, i32* %7
%14 = ashr i32 %13, 2
%15 = add nsw i32 %12, %14
%16 = load i32, i32* %7
%17 = and i32 %16, 3
%18 = load i32, i32* %5
%19 = ashr i32 %18, 2
%20 = mul nsw i32 %17, %19
%21 = load i32, i32* %6
%22 = mul nsw i32 %20, %21
%23 = add nsw i32 %15, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @compose_woven(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = ashr i32 %0, 2
%6 = ashr i32 %2, 2
%7 = and i32 %2, 3
%8 = mul i32 %7, %1
%9 = add i32 %8, %3
%10 = mul i32 %9, %5
%11 = add i32 %10, %6
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_if_nonnull(void *v) {
  if (v != NULL)
    free(v);
}


x86 assembly (clang, -O0):
<free_if_nonnull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <free_if_nonnull+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @free_if_nonnull(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int start_line(const char *line) {
  if (strcmp(line + 8, " T _start\n") == 0)
    return 1;
  else if (strcmp(line + 16, " T _start\n") == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<start_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1146 <start_line+0x36>
movl   $0x1,-0x4(%rbp)
jmp    117c <start_line+0x6c>
mov    -0x10(%rbp),%rdi
add    $0x10,%rdi
lea    0xeab(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1170 <start_line+0x60>
movl   $0x1,-0x4(%rbp)
jmp    117c <start_line+0x6c>
jmp    1175 <start_line+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_line>:
push   %rbx
mov    %rdi,%rbx
add    $0x8,%rdi
lea    0xee1(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1149 <start_line+0x39>
add    $0x10,%rbx
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c" T _start\0A\00"
define i32 @start_line(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 8
%3 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 16
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ 1, %1 ], [ %9, %5 ]
ret i32 %11
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t rot16l5(uint16_t x) { return (x << 5) | (x >> 11); }


x86 assembly (clang, -O0):
<rot16l5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
mov    -0x4(%rbp),%ecx
sar    $0xb,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot16l5>:
mov    %edi,%eax
shl    $0x5,%eax
sar    $0xb,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rot16l5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 5
%5 = load i32, i32* %2
%6 = ashr i32 %5, 11
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rot16l5(i32 %0) {
%2 = shl i32 %0, 5
%3 = ashr i32 %0, 11
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128Timer1P__CompareC__default__fired();
void HplAtm128Timer1P__CompareC__fired(void) {
  HplAtm128Timer1P__CompareC__default__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplAtm128Timer1P__CompareC__fired() {
%1 = tail call i32 (...) @HplAtm128Timer1P__CompareC__default__fired()
ret void
}
int mini(int a, int b) {
  if (a >= b)
    return a;
  return b;
}


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

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

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

LLVM IR (-O2):
define i32 @mini(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
size_t pad_size_to(size_t, int);
size_t pad_size(size_t initial) { return pad_size_to(initial, 8); }


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

x86 assembly (clang, -O2):
<pad_size>:
mov    $0x8,%esi
jmp    1030 <pad_size_to@plt>

LLVM IR (-O0):
define i64 @pad_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @pad_size_to(i64 %3, i32 8)
ret i64 %4
}

LLVM IR (-O2):
define i64 @pad_size(i64 %0) {
%2 = tail call i64 @pad_size_to(i64 %0, i32 8)
ret i64 %2
}
int titleToNumber(char *s) {
  int ans = 0;
  while (*s) {
    ans = 26 * ans + (*s - 64);
    s++;
  }
  return ans;
}


x86 assembly (clang, -O0):
<titleToNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <titleToNumber+0x40>
imul   $0x1a,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x40,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <titleToNumber+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<titleToNumber>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <titleToNumber+0x2c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
add    $0xffffffc0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <titleToNumber+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @titleToNumber(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = mul nsw i32 %6, 26
%9 = sext i8 %5 to i32
%10 = add i32 %8, -64
%11 = add i32 %10, %9
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %16
}
void time_travel_set_timer_interval(unsigned long long interval) {}


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

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

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

LLVM IR (-O2):
define void @time_travel_set_timer_interval(i64 %0) {
ret void
}
unsigned int indexFor(unsigned int tablelength, unsigned int hashvalue) {
  return (hashvalue % tablelength);
}


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

x86 assembly (clang, -O2):
<indexFor>:
mov    %esi,%eax
xor    %edx,%edx
div    %edi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @indexFor(i32 %0, i32 %1) {
%3 = urem i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ MYSQL_RES;

/* Variables and functions */
int mysql_num_rows(int /*<<< orphan*/ *);
int num_rows(MYSQL_RES *res) { return mysql_num_rows(res); }


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

x86 assembly (clang, -O2):
<num_rows>:
jmp    1030 <mysql_num_rows@plt>

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

LLVM IR (-O2):
define i32 @num_rows(i32* %0) {
%2 = tail call i32 @mysql_num_rows(i32* %0)
ret i32 %2
}
int test3() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test3() {
ret i32 0
}
double dand(double x, double y) { return ((double)(x && y)); }


x86 assembly (clang, -O0):
<dand>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jne    1130 <dand+0x30>
jp     1130 <dand+0x30>
jmp    1147 <dand+0x47>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dand>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
setp   %al
setne  %cl
or     %al,%cl
ucomisd %xmm2,%xmm1
setp   %al
setne  %dl
or     %al,%dl
and    %cl,%dl
movzbl %dl,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @dand(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fcmp une double %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load double, double* %4
%9 = fcmp une double %8, 0.000000e+00
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = sitofp i32 %12 to double
ret double %13
}

LLVM IR (-O2):
define double @dand(double %0, double %1) {
%3 = fcmp une double %0, 0.000000e+00
%4 = fcmp une double %1, 0.000000e+00
%5 = and i1 %3, %4
%6 = uitofp i1 %5 to double
ret double %6
}
/* Variables and functions */
void fputs(void) {}


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

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

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

LLVM IR (-O2):
define void @fputs() {
ret void
}
/* Variables and functions */
int abs(int);
char _ms_closer(int *oneClock, int dif) {
  int oneDif = abs(*oneClock - dif);
  int zeroDif = abs((*oneClock * 2) - dif);
  char bit;
  if (oneDif < zeroDif) {
    *oneClock = dif;
    bit = '1';
  } else {
    *oneClock = dif / 2;
    bit = '0';
  }
  return bit;
}


x86 assembly (clang, -O0):
<_ms_closer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
sub    -0xc(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
shl    $0x1,%edi
sub    -0xc(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1162 <_ms_closer+0x52>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
movb   $0x31,-0x15(%rbp)
jmp    1179 <_ms_closer+0x69>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
movb   $0x30,-0x15(%rbp)
movsbl -0x15(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ms_closer>:
mov    (%rdi),%eax
mov    %eax,%ecx
sub    %esi,%ecx
mov    %ecx,%r8d
neg    %r8d
cmovs  %ecx,%r8d
add    %eax,%eax
sub    %esi,%eax
mov    %eax,%ecx
neg    %ecx
cmovs  %eax,%ecx
mov    %esi,%edx
shr    $0x1f,%edx
add    %esi,%edx
sar    %edx
cmp    %ecx,%r8d
setb   %al
cmovb  %esi,%edx
or     $0x30,%al
mov    %edx,(%rdi)
ret

LLVM IR (-O0):
define signext i8 @_ms_closer(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i32* %0, i32** %3
store i32 %1, i32* %4
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = call i32 @abs(i32 %11)
store i32 %12, i32* %5
%13 = load i32*, i32** %3
%14 = load i32, i32* %13
%15 = mul nsw i32 %14, 2
%16 = load i32, i32* %4
%17 = sub nsw i32 %15, %16
%18 = call i32 @abs(i32 %17)
store i32 %18, i32* %6
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %25
22: ; preds = %2
%23 = load i32, i32* %4
%24 = load i32*, i32** %3
store i32 %23, i32* %24
store i8 49, i8* %7
br label %29
25: ; preds = %2
%26 = load i32, i32* %4
%27 = sdiv i32 %26, 2
%28 = load i32*, i32** %3
store i32 %27, i32* %28
store i8 48, i8* %7
br label %29
29: ; preds = %25, %22
%30 = load i8, i8* %7
ret i8 %30
}

LLVM IR (-O2):
define signext i8 @_ms_closer(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = sub nsw i32 %3, %1
%5 = tail call i32 @llvm.abs.i32(i32 %4, i1 true)
%6 = shl nsw i32 %3, 1
%7 = sub nsw i32 %6, %1
%8 = tail call i32 @llvm.abs.i32(i32 %7, i1 true)
%9 = icmp ult i32 %5, %8
%10 = sdiv i32 %1, 2
%11 = select i1 %9, i32 %1, i32 %10
%12 = select i1 %9, i8 49, i8 48
store i32 %11, i32* %0
ret i8 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ get_line(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
char *get_date(char *d) {
  FILE *p = popen("date.sh", "r");
  get_line(d, p);
  pclose(p);
  return d;
}


x86 assembly (clang, -O0):
<get_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <get_line@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pclose@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_date>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
lea    0xec3(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <get_line@plt>
mov    %rbx,%rdi
call   1040 <pclose@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"date.sh\00"
@.str.1 = [2 x i8] c"r\00"
define i8* @get_date(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @popen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i8*, i8** %2
%6 = load i32*, i32** %3
%7 = call i32 @get_line(i8* %5, i32* %6)
%8 = load i32*, i32** %3
%9 = call i32 @pclose(i32* %8)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [8 x i8] c"date.sh\00"
@.str.1 = [2 x i8] c"r\00"
define i8* @get_date(i8* returned %0) {
%2 = tail call i32* @popen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @get_line(i8* %0, i32* %2)
%4 = tail call i32 @pclose(i32* %2)
ret i8* %0
}
void INT_Excep_RSCAN_COMFRXINT(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RSCAN_COMFRXINT() {
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
void ref_sub_int64_t(int64_t arg1, int64_t arg2, int64_t *result) {
  *result = arg1 - arg2;
}


x86 assembly (clang, -O0):
<ref_sub_int64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
sub    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ref_sub_int64_t>:
sub    %rsi,%rdi
mov    %rdi,(%rdx)
ret

LLVM IR (-O0):
define void @ref_sub_int64_t(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = sub nsw i64 %7, %8
%10 = load i64*, i64** %6
store i64 %9, i64* %10
ret void
}

LLVM IR (-O2):
define void @ref_sub_int64_t(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = sub nsw i64 %0, %1
store i64 %4, i64* %2
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ srandom(int);
int time(int /*<<< orphan*/ *);
void init_mm(void) {
  srandom(time(NULL) ^ getpid());
  return;
}


x86 assembly (clang, -O0):
<init_mm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    -0x4(%rbp),%edi
xor    %eax,%edi
call   1030 <srandom@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_mm>:
push   %rbx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <getpid@plt>
xor    %eax,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <srandom@plt>

LLVM IR (-O0):
define void @init_mm() {
%1 = call i32 @time(i32* null)
%2 = call i32 (...) @getpid()
%3 = xor i32 %1, %2
%4 = call i32 @srandom(i32 %3)
ret void
}

LLVM IR (-O2):
define void @init_mm() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 (...) @getpid()
%3 = xor i32 %2, %1
%4 = tail call i32 @srandom(i32 %3)
ret void
}
double getZero(int maxX, int minX, double maxY, double minY) {
  double slope = (minY - maxY) / ((double)(minX - maxX));
  double zeroPos = ((-1. * maxY) / slope) + maxX;
  return zeroPos;
}


x86 assembly (clang, -O0):
<getZero>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xec7(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getZero>:
subsd  %xmm0,%xmm1
sub    %edi,%esi
cvtsi2sd %esi,%xmm2
divsd  %xmm2,%xmm1
xorps  %xmm2,%xmm2
cvtsi2sd %edi,%xmm2
divsd  %xmm1,%xmm0
subsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @getZero(i32 %0, i32 %1, double %2, double %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store i32 %0, i32* %5
store i32 %1, i32* %6
store double %2, double* %7
store double %3, double* %8
%11 = load double, double* %8
%12 = load double, double* %7
%13 = fsub double %11, %12
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = sub nsw i32 %14, %15
%17 = sitofp i32 %16 to double
%18 = fdiv double %13, %17
store double %18, double* %9
%19 = load double, double* %7
%20 = fmul double -1.000000e+00, %19
%21 = load double, double* %9
%22 = fdiv double %20, %21
%23 = load i32, i32* %5
%24 = sitofp i32 %23 to double
%25 = fadd double %22, %24
store double %25, double* %10
%26 = load double, double* %10
ret double %26
}

LLVM IR (-O2):
define double @getZero(i32 %0, i32 %1, double %2, double %3) {
%5 = fsub double %3, %2
%6 = sub nsw i32 %1, %0
%7 = sitofp i32 %6 to double
%8 = fdiv double %5, %7
%9 = sitofp i32 %0 to double
%10 = fdiv double %2, %8
%11 = fsub double %9, %10
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ Reserved171_DriverIRQHandler();
__attribute__((weak)) void Reserved171_IRQHandler(void) {
  Reserved171_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @Reserved171_IRQHandler() {
%1 = call i32 (...) @Reserved171_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @Reserved171_IRQHandler() {
%1 = tail call i32 (...) @Reserved171_DriverIRQHandler()
ret void
}
/* Variables and functions */
char **extract_values(char *);
char *get_value(char const *);
char **get_values(const char *key) {
  char *value = get_value(key);
  return extract_values(value);
}


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

x86 assembly (clang, -O2):
<get_values>:
push   %rax
call   1030 <get_value@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <extract_values@plt>

LLVM IR (-O0):
define i8** @get_values(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @get_value(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i8** @extract_values(i8* %6)
ret i8** %7
}

LLVM IR (-O2):
define i8** @get_values(i8* %0) {
%2 = tail call i8* @get_value(i8* %0)
%3 = tail call i8** @extract_values(i8* %2)
ret i8** %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ tty_read(int /*<<< orphan*/ *, int, int);
uint8_t tty_read_byte(int timeout) {
  uint8_t c;
  tty_read(&c, 1, timeout);
  return c;
}


x86 assembly (clang, -O0):
<tty_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <tty_read@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_read_byte>:
push   %rax
mov    %edi,%edx
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
call   1030 <tty_read@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @tty_read_byte(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @tty_read(i32* %2, i32 1, i32 %0)
%5 = load i32, i32* %2
ret i32 %5
}
void g_ptr_array_sized_new() {}


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

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

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

LLVM IR (-O2):
define void @g_ptr_array_sized_new() {
ret void
}
int fun1214() { return 1214; }


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

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

LLVM IR (-O0):
define i32 @fun1214() {
ret i32 1214
}

LLVM IR (-O2):
define i32 @fun1214() {
ret i32 1214
}
/* Type definitions */
struct configuration {
  int dummy;
};
struct access {
  int dummy;
};

/* Variables and functions */
char const *config_acccl(struct configuration *, struct access **,
                         int /*<<< orphan*/);
const char *config_access(struct configuration *p, struct access **ls) {
  return config_acccl(p, ls, 0);
}


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

x86 assembly (clang, -O2):
<config_access>:
xor    %edx,%edx
jmp    1030 <config_acccl@plt>

LLVM IR (-O0):
%struct.configuration = type { i32 }
%struct.access = type { i32 }
define i8* @config_access(%struct.configuration* %0, %struct.access** %1) {
%3 = alloca %struct.configuration*
%4 = alloca %struct.access**
store %struct.configuration* %0, %struct.configuration** %3
store %struct.access** %1, %struct.access*** %4
%5 = load %struct.configuration*, %struct.configuration** %3
%6 = load %struct.access**, %struct.access*** %4
%7 = call i8* @config_acccl(%struct.configuration* %5, %struct.access** %6, i32 0)
ret i8* %7
}

LLVM IR (-O2):
%struct.configuration = type { i32 }
%struct.access = type { i32 }
define i8* @config_access(%struct.configuration* %0, %struct.access** %1) {
%3 = tail call i8* @config_acccl(%struct.configuration* %0, %struct.access** %1, i32 0)
ret i8* %3
}
int sum_of_digit(int n) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @sum_of_digit(i32 %0) {
ret i32 -1
}
/* Variables and functions */
unsigned long getpid();
scalar_t__ pthread_self();
scalar_t__ pthreads_available();
unsigned long pthr_self(void) {
  if (pthreads_available())
    return (unsigned long)pthread_self();
  return getpid();
}


x86 assembly (clang, -O0):
<pthr_self>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <pthreads_available@plt>
cmp    $0x0,%rax
je     1159 <pthr_self+0x29>
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %rax,-0x8(%rbp)
jmp    1164 <pthr_self+0x34>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthr_self>:
push   %rax
xor    %eax,%eax
call   1040 <pthreads_available@plt>
test   %rax,%rax
je     1145 <pthr_self+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1050 <pthread_self@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <getpid@plt>

LLVM IR (-O0):
define i64 @pthr_self() {
%1 = alloca i64
%2 = call i64 (...) @pthreads_available()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i64 (...) @pthread_self()
store i64 %5, i64* %1
br label %8
6: ; preds = %0
%7 = call i64 (...) @getpid()
store i64 %7, i64* %1
br label %8
8: ; preds = %6, %4
%9 = load i64, i64* %1
ret i64 %9
}

LLVM IR (-O2):
define i64 @pthr_self() {
%1 = tail call i64 (...) @pthreads_available()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i64 (...) @pthread_self()
br label %7
5: ; preds = %0
%6 = tail call i64 (...) @getpid()
br label %7
7: ; preds = %5, %3
%8 = phi i64 [ %4, %3 ], [ %6, %5 ]
ret i64 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ bswap_16(int /*<<< orphan*/);
uint16_t le16_to_cpu(uint16_t le_val) { return bswap_16(le_val); }


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

x86 assembly (clang, -O2):
<le16_to_cpu>:
jmp    1030 <bswap_16@plt>

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

LLVM IR (-O2):
define i32 @le16_to_cpu(i32 %0) {
%2 = tail call i32 @bswap_16(i32 %0)
ret i32 %2
}
void Timer5B_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<Timer5B_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Timer5B_Handler+0x9>
jmp    1109 <Timer5B_Handler+0x9>

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

LLVM IR (-O0):
define void @Timer5B_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Timer5B_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
unsigned int swab32(unsigned int val) {
  return (((val & 0xff000000) >> 24) | ((val & 0x00ff0000) >> 8) |
          ((val & 0x0000ff00) << 8) | ((val & 0x000000ff) << 24));
}


x86 assembly (clang, -O0):
<swab32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @swab32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16777216
%5 = lshr i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 16711680
%8 = lshr i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 65280
%12 = shl i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, 255
%16 = shl i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @swab32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
void __attribute__((weak)) dma1_stream1_isr() { debug_handler(__FUNCTION__); }


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

x86 assembly (clang, -O2):
<dma1_stream1_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.dma1_stream1_isr = [17 x i8] c"dma1_stream1_isr\00"
define weak void @dma1_stream1_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__FUNCTION__.dma1_stream1_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.dma1_stream1_isr = [17 x i8] c"dma1_stream1_isr\00"
define weak void @dma1_stream1_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__FUNCTION__.dma1_stream1_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *mkdtemp(char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *setup_tempdir(char *buf) {
  strcpy(buf, "/tmp/perfindex.XXXXXX");
  return mkdtemp(buf);
}


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

x86 assembly (clang, -O2):
<setup_tempdir>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <mkdtemp@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"/tmp/perfindex.XXXXXX\00"
define i8* @setup_tempdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i8* @mkdtemp(i8* %5)
ret i8* %6
}

LLVM IR (-O2):
@.str = [22 x i8] c"/tmp/perfindex.XXXXXX\00"
define i8* @setup_tempdir(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @mkdtemp(i8* %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ strcat(unsigned char *, unsigned char *);
int seed_gene(unsigned char *app, unsigned char *username,
              unsigned char *seed) {
  do {
  } while (0);
  strcat(seed, app);
  strcat(seed, username);
  return 0;
}


x86 assembly (clang, -O0):
<seed_gene>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
jmp    1129 <seed_gene+0x19>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcat@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcat@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @seed_gene(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strcat(i8* %2, i8* %0)
%5 = tail call i32 @strcat(i8* %2, i8* %1)
ret i32 0
}
char *mystrrchr(char *s, char c) {
  char *rtnval = 0;
  do {
    if (*s == c)
      rtnval = s;
  } while (*s++);
  return rtnval;
}


x86 assembly (clang, -O0):
<mystrrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1131 <mystrrchr+0x31>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1136 <mystrrchr+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    1116 <mystrrchr+0x16>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrrchr>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi),%ecx
cmp    %sil,%cl
cmove  %rdi,%rax
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <mystrrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @mystrrchr(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = phi i8* [ null, %2 ], [ %8, %3 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, %1
%8 = select i1 %7, i8* %4, i8* %5
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = icmp eq i8 %6, 0
br i1 %10, label %11, label %3
11: ; preds = %3
ret i8* %8
}
void SpinWait(int clocks) {
  int value = *(volatile int *)0x20000060 + clocks;
  while (*(volatile int *)0x20000060 - value < 0)
    ;
}


x86 assembly (clang, -O0):
<SpinWait>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x20000060,%eax
mov    (%rax),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x20000060,%eax
mov    (%rax),%eax
sub    -0x8(%rbp),%eax
cmp    $0x0,%eax
jge    112c <SpinWait+0x2c>
jmp    1114 <SpinWait+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SpinWait>:
add    0x20000060,%edi
nopw   0x0(%rax,%rax,1)
mov    0x20000060,%eax
cmp    %edi,%eax
jl     1110 <SpinWait+0x10>
ret

LLVM IR (-O0):
define void @SpinWait(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load volatile i32, i32* inttoptr (i64 536871008 to i32*)
%5 = load i32, i32* %2
%6 = add nsw i32 %4, %5
store i32 %6, i32* %3
br label %7
7: ; preds = %12, %1
%8 = load volatile i32, i32* inttoptr (i64 536871008 to i32*)
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %7
br label %7
13: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @SpinWait(i32 %0) {
%2 = load volatile i32, i32* inttoptr (i64 536871008 to i32*)
%3 = add nsw i32 %2, %0
br label %4
4: ; preds = %4, %1
%5 = load volatile i32, i32* inttoptr (i64 536871008 to i32*)
%6 = icmp slt i32 %5, %3
br i1 %6, label %4, label %7
7: ; preds = %4
ret void
}
unsigned int leading_zero_num9(unsigned int x) {
  union {
    unsigned int as_int;
    double as_float;
  } y;
  unsigned int nr;
  nr = 0;
  x = x & ~(x >> 1);
  y.as_float = (float)x + 0.5f;
  nr = 158 - (y.as_int >> 23);
  return nr;
}


x86 assembly (clang, -O0):
<leading_zero_num9>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
shr    %ecx
not    %ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xed4(%rip),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
shr    $0x17,%ecx
mov    $0x9e,%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leading_zero_num9>:
mov    %edi,%eax
shr    %eax
not    %eax
and    %edi,%eax
cvtsi2ss %rax,%xmm0
addss  0xeeb(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
movq   %xmm0,%rcx
shr    $0x17,%ecx
mov    $0x9e,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
%union.anon = type { double }
define i32 @leading_zero_num9(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = lshr i32 %6, 1
%8 = xor i32 %7, -1
%9 = and i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = uitofp i32 %10 to float
%12 = fadd float %11, 5.000000e-01
%13 = fpext float %12 to double
%14 = bitcast %union.anon* %3 to double*
store double %13, double* %14
%15 = bitcast %union.anon* %3 to i32*
%16 = load i32, i32* %15
%17 = lshr i32 %16, 23
%18 = sub i32 158, %17
store i32 %18, i32* %4
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @leading_zero_num9(i32 %0) {
%2 = lshr i32 %0, 1
%3 = xor i32 %2, -1
%4 = and i32 %3, %0
%5 = uitofp i32 %4 to float
%6 = fadd float %5, 5.000000e-01
%7 = fpext float %6 to double
%8 = bitcast double %7 to i64
%9 = trunc i64 %8 to i32
%10 = lshr i32 %9, 23
%11 = sub nsw i32 158, %10
ret i32 %11
}