xunge/DecIR huggingface dataset:
void foo794() {}


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

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

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

LLVM IR (-O2):
define void @foo794() {
ret void
}
void muoviOberon() {}


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

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

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

LLVM IR (-O2):
define void @muoviOberon() {
ret void
}
double ho_recognize_font_1_one(const double *array_in) {
  double return_value = 0.0;
  return return_value;
}


x86 assembly (clang, -O0):
<ho_recognize_font_1_one>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ho_recognize_font_1_one>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ho_recognize_font_1_one(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
store double 0.000000e+00, double* %3
%4 = load double, double* %3
ret double %4
}

LLVM IR (-O2):
define double @ho_recognize_font_1_one(double* nocapture readnone %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ io_printf(char *);
int hello_verilog(void) {
  io_printf("Hello\n");
  return 0;
}


x86 assembly (clang, -O0):
<hello_verilog>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <io_printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"Hello\0A\00"
define i32 @hello_verilog() {
%1 = call i32 @io_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"Hello\0A\00"
define i32 @hello_verilog() {
%1 = tail call i32 @io_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int intcmp(const void *a, const void *b) {
  int const *x = a;
  int const *y = b;
  return *x - *y;
}


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

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

LLVM IR (-O0):
define i32 @intcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @intcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
int BPQSerialIsCOMOpen(unsigned int hDevice, unsigned long *Count) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @BPQSerialIsCOMOpen(i32 %0, i64* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct dictionary {
  int dummy;
};

/* Variables and functions */
scalar_t__ counterName(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char, char);
struct dictionary *rawlookup(char *);
int /*<<< orphan*/ stderr;
struct dictionary *dlookup(char *name) {
  if (counterName(name))
    fprintf(stderr,
            "** <%s> cannot be used with '%c' (only use '%c' in %%define or "
            "%%generate commands)\n",
            name, '#', '#');
  return rawlookup(name);
}


x86 assembly (clang, -O0):
<dlookup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <counterName@plt>
cmp    $0x0,%rax
je     1171 <dlookup+0x41>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe9d(%rip),%rsi
mov    $0x23,%r8d
mov    %r8d,%ecx
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1050 <rawlookup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlookup>:
push   %rbx
mov    %rdi,%rbx
call   1030 <counterName@plt>
test   %rax,%rax
je     1161 <dlookup+0x31>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
mov    %rbx,%rdx
mov    $0x23,%ecx
mov    $0x23,%r8d
call   1040 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <rawlookup@plt>

LLVM IR (-O0):
%struct.dictionary = type { i32 }
@stderr = global i32 0
@.str = [85 x i8] c"** <%s> cannot be used with '%c' (only use '%c' in %%define or %%generate commands)\0A\00"
define %struct.dictionary* @dlookup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @counterName(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %2
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i8* %8, i8 signext 35, i8 signext 35)
br label %10
10: ; preds = %6, %1
%11 = load i8*, i8** %2
%12 = call %struct.dictionary* @rawlookup(i8* %11)
ret %struct.dictionary* %12
}

LLVM IR (-O2):
%struct.dictionary = type { i32 }
@stderr = global i32 0
@.str = [85 x i8] c"** <%s> cannot be used with '%c' (only use '%c' in %%define or %%generate commands)\0A\00"
define %struct.dictionary* @dlookup(i8* %0) {
%2 = tail call i64 @counterName(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i8* %0, i8 signext 35, i8 signext 35)
br label %7
7: ; preds = %4, %1
%8 = tail call %struct.dictionary* @rawlookup(i8* %0)
ret %struct.dictionary* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  for (;;) {
    printf("Hello, world!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <main+0xf>

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ get_gyro();
float gyro_ticks_to_degrees(int /*<<< orphan*/);
float get_gyro_degrees() { return gyro_ticks_to_degrees(get_gyro()); }


x86 assembly (clang, -O0):
<get_gyro_degrees>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <get_gyro@plt>
mov    %eax,%edi
call   1030 <gyro_ticks_to_degrees@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_gyro_degrees>:
push   %rax
xor    %eax,%eax
call   1040 <get_gyro@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <gyro_ticks_to_degrees@plt>

LLVM IR (-O0):
define float @get_gyro_degrees() {
%1 = call i32 (...) @get_gyro()
%2 = call float @gyro_ticks_to_degrees(i32 %1)
ret float %2
}

LLVM IR (-O2):
define float @get_gyro_degrees() {
%1 = tail call i32 (...) @get_gyro()
%2 = tail call float @gyro_ticks_to_degrees(i32 %1)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t counter_low(uint64_t counter) {
  return (uint32_t)counter;
}


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

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

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

LLVM IR (-O2):
define i32 @counter_low(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
print_write_send_error() {
  printf("Unable to send write request\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"Unable to send write request\0A\00"
define i32 @print_write_send_error() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [29 x i8] c"Unable to send write request\00"
define i32 @print_write_send_error() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
void free_convert_matrix(b, nrl, nrh, ncl, nch) float **b;
register int nrl, nrh, ncl, nch;
{ free((char *)(b + nrl)); }


x86 assembly (clang, -O0):
<free_convert_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_convert_matrix>:
movslq %esi,%rax
lea    (%rdi,%rax,8),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_convert_matrix(float** %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca float**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store float** %0, float*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load float**, float*** %6
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds float*, float** %11, i64 %13
%15 = bitcast float** %14 to i8*
ret void
}

LLVM IR (-O2):
define void @free_convert_matrix(float** nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds float*, float** %0, i64 %6
%8 = bitcast float** %7 to i8*
tail call void @free(i8* %8)
ret void
}
int encode_thumb_word_immediate(unsigned int v) {
  if ((v & 0xfffff000) == 0)
    return (((v & 0x800) << 15) | ((v & 0x700) << 4) | (v & 0xff));
  return (-1);
}


x86 assembly (clang, -O0):
<encode_thumb_word_immediate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xfffff000,%eax
cmp    $0x0,%eax
jne    1144 <encode_thumb_word_immediate+0x44>
mov    -0x8(%rbp),%eax
and    $0x800,%eax
shl    $0xf,%eax
mov    -0x8(%rbp),%ecx
and    $0x700,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    114b <encode_thumb_word_immediate+0x4b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_thumb_word_immediate>:
mov    $0xffffffff,%eax
cmp    $0xfff,%edi
ja     112b <encode_thumb_word_immediate+0x2b>
mov    %edi,%ecx
shl    $0xf,%ecx
and    $0x4000000,%ecx
mov    %edi,%edx
shl    $0x4,%edx
and    $0x7000,%edx
movzbl %dil,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @encode_thumb_word_immediate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, -4096
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %1
%8 = load i32, i32* %3
%9 = and i32 %8, 2048
%10 = shl i32 %9, 15
%11 = load i32, i32* %3
%12 = and i32 %11, 1792
%13 = shl i32 %12, 4
%14 = or i32 %10, %13
%15 = load i32, i32* %3
%16 = and i32 %15, 255
%17 = or i32 %14, %16
store i32 %17, i32* %2
br label %19
18: ; preds = %1
store i32 -1, i32* %2
br label %19
19: ; preds = %18, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @encode_thumb_word_immediate(i32 %0) {
%2 = icmp ult i32 %0, 4096
br i1 %2, label %3, label %11
3: ; preds = %1
%4 = shl nuw nsw i32 %0, 15
%5 = and i32 %4, 67108864
%6 = shl nuw nsw i32 %0, 4
%7 = and i32 %6, 28672
%8 = and i32 %0, 255
%9 = or i32 %7, %8
%10 = or i32 %9, %5
br label %11
11: ; preds = %1, %3
%12 = phi i32 [ %10, %3 ], [ -1, %1 ]
ret i32 %12
}
/* Type definitions */
struct nc_buff {
  int dummy;
};
struct atcp_protocol {
  int dummy;
};

/* Variables and functions */
int atcp_send_bit(struct atcp_protocol *, int);
int atcp_time_wait(struct atcp_protocol *tp,
                   struct nc_buff *ncb __attribute__((unused))) {
  return atcp_send_bit(tp, 0x2);
}


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

x86 assembly (clang, -O2):
<atcp_time_wait>:
mov    $0x2,%esi
jmp    1030 <atcp_send_bit@plt>

LLVM IR (-O0):
%struct.atcp_protocol = type { i32 }
%struct.nc_buff = type { i32 }
define i32 @atcp_time_wait(%struct.atcp_protocol* %0, %struct.nc_buff* %1) {
%3 = alloca %struct.atcp_protocol*
%4 = alloca %struct.nc_buff*
store %struct.atcp_protocol* %0, %struct.atcp_protocol** %3
store %struct.nc_buff* %1, %struct.nc_buff** %4
%5 = load %struct.atcp_protocol*, %struct.atcp_protocol** %3
%6 = call i32 @atcp_send_bit(%struct.atcp_protocol* %5, i32 2)
ret i32 %6
}

LLVM IR (-O2):
%struct.atcp_protocol = type { i32 }
%struct.nc_buff = type { i32 }
define i32 @atcp_time_wait(%struct.atcp_protocol* %0, %struct.nc_buff* nocapture readnone %1) {
%3 = tail call i32 @atcp_send_bit(%struct.atcp_protocol* %0, i32 2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ctor4() { printf("Create4!\n"); }


x86 assembly (clang, -O0):
<ctor4>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"Create4!\0A\00"
define void @ctor4() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"Create4!\00"
define void @ctor4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handle_out(int sockfd, uint8_t *body, uint32_t len) {
  printf("in handle_out\n");
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"in handle_out\0A\00"
define void @handle_out(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 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"in handle_out\00"
define void @handle_out(i32 %0, i32* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
int ctldev_handle(void) {
  log_debug(7, "in %s", __FUNCTION__);
  return 0;
}


x86 assembly (clang, -O0):
<ctldev_handle>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
lea    0xee0(%rip),%rsi
lea    0xedf(%rip),%rdx
mov    $0x0,%al
call   1030 <log_debug@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctldev_handle>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xee7(%rip),%rdx
mov    $0x7,%edi
xor    %eax,%eax
call   1030 <log_debug@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"in %s\00"
@__FUNCTION__.ctldev_handle = [14 x i8] c"ctldev_handle\00"
define i32 @ctldev_handle() {
%1 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @log_debug to i32 (i32, i8*, i8*, ...)*)(i32 7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__.ctldev_handle, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"in %s\00"
@__FUNCTION__.ctldev_handle = [14 x i8] c"ctldev_handle\00"
define i32 @ctldev_handle() {
%1 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @log_debug to i32 (i32, i8*, i8*, ...)*)(i32 7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__.ctldev_handle, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
float const fabs(float);
int fp_cmp(float a, float b) {
  static const float eps = 0.001;
  return (fabs(a - b) <= eps);
}


x86 assembly (clang, -O0):
<fp_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movss  0xec4(%rip),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_cmp>:
subss  %xmm1,%xmm0
andps  0xef5(%rip),%xmm0
movss  0xefd(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
@fp_cmp.eps = internal constant float 0x3F50624DE0000000
define i32 @fp_cmp(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
%8 = call float @fabs(float %7)
%9 = fcmp ole float %8, 0x3F50624DE0000000
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @fp_cmp(float %0, float %1) {
%3 = fsub float %0, %1
%4 = tail call float @llvm.fabs.f32(float %3)
%5 = fcmp ole float %4, 0x3F50624DE0000000
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ file_center(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ print_file(int /*<<< orphan*/ *);
int main(void) {
  FILE *file = fopen("fseek_test_1.asc", "r");
  file_center(file);
  print_file(file);
  fclose(file);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xeb4(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <file_center@plt>
mov    -0x10(%rbp),%rdi
call   1040 <print_file@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <file_center@plt>
mov    %rbx,%rdi
call   1040 <print_file@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"fseek_test_1.asc\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @file_center(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @print_file(i32* %6)
%8 = load i32*, i32** %2
%9 = call i32 @fclose(i32* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"fseek_test_1.asc\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @file_center(i32* %1)
%3 = tail call i32 @print_file(i32* %1)
%4 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __itt_thread_ignore_init_3_0();
void __itt_thr_ignore_init_3_0(void) { __itt_thread_ignore_init_3_0(); }


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

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

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

LLVM IR (-O2):
define void @__itt_thr_ignore_init_3_0() {
%1 = tail call i32 (...) @__itt_thread_ignore_init_3_0()
ret void
}
void dj_mix(void) {}


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

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

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

LLVM IR (-O2):
define void @dj_mix() {
ret void
}
signed char f7(signed char arg) { return arg; }


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @f7(i8 returned signext %0) {
ret i8 %0
}
/* Variables and functions */
char const *SSL_alert_desc_string_long(int);
const char *print_alert(int alert) {
  return alert ? SSL_alert_desc_string_long(alert) : "no alert";
}


x86 assembly (clang, -O0):
<print_alert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1136 <print_alert+0x26>
mov    -0x4(%rbp),%edi
call   1030 <SSL_alert_desc_string_long@plt>
mov    %rax,-0x10(%rbp)
jmp    1146 <print_alert+0x36>
lea    0xec3(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1146 <print_alert+0x36>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_alert>:
test   %edi,%edi
je     1119 <print_alert+0x9>
jmp    1030 <SSL_alert_desc_string_long@plt>
lea    0xee0(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"no alert\00"
define i8* @print_alert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i8* @SSL_alert_desc_string_long(i32 %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i8* [ %7, %5 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %8 ]
ret i8* %10
}

LLVM IR (-O2):
@.str = [9 x i8] c"no alert\00"
define i8* @print_alert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @SSL_alert_desc_string_long(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}
/* Variables and functions */
size_t iexp2(size_t num) {
  size_t exp = 0;
  while (num > 1) {
    num >>= 1;
    exp++;
  }
  return exp;
}


x86 assembly (clang, -O0):
<iexp2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x1,-0x8(%rbp)
jbe    1138 <iexp2+0x38>
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <iexp2+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iexp2>:
xor    %eax,%eax
cmp    $0x2,%rdi
jb     1120 <iexp2+0x20>
mov    %rdi,%rcx
nopl   0x0(%rax,%rax,1)
shr    %rcx
add    $0x1,%rax
cmp    $0x3,%rdi
mov    %rcx,%rdi
ja     1110 <iexp2+0x10>
ret

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

LLVM IR (-O2):
define i64 @iexp2(i64 %0) {
%2 = icmp ugt i64 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i64 %5, 1
%7 = add nuw nsw i64 %4, 1
%8 = icmp ugt i64 %5, 3
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %7, %3 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char **argv) {
  fprintf(stderr,
          "%s [-n max-args] [-s max-chars] [command [initial-arguments]]\n",
          argv[0]);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%rdx
lea    0xecc(%rip),%rsi
mov    %eax,%edi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [63 x i8] c"%s [-n max-args] [-s max-chars] [command [initial-arguments]]\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [63 x i8] c"%s [-n max-args] [-s max-chars] [command [initial-arguments]]\0A\00"
define void @usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
void rop3_255_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = 255;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_255_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movb   $0xff,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_255_1_0>:
not    %sil
or     %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_255_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
store i8 -1, i8* %7
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = and i32 %9, %12
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = or i32 %13, %19
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %4
store i8 %21, i8* %22
ret void
}

LLVM IR (-O2):
define void @rop3_255_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
store i8 %6, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fscanf(int /*<<< orphan*/ *, char *, char *);
const char *fetch_read_word(FILE *f) {
  static char word[1024];
  if (fscanf(f, " %1023s ", word) != 1)
    return (NULL);
  return (word);
}


x86 assembly (clang, -O0):
<fetch_read_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0x2f12(%rip),%rdx
call   1030 <fscanf@plt>
cmp    $0x1,%eax
je     1149 <fetch_read_word+0x39>
movq   $0x0,-0x8(%rbp)
jmp    1154 <fetch_read_word+0x44>
lea    0x2ef0(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetch_read_word>:
push   %rbx
lea    0xee8(%rip),%rsi
lea    0x2f21(%rip),%rbx
mov    %rbx,%rdx
call   1030 <fscanf@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@fetch_read_word.word = internal global [1024 x i8] zeroinitializer
@.str = [9 x i8] c" %1023s \00"
define i8* @fetch_read_word(i32* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @fetch_read_word.word, i64 0, i64 0))
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @fetch_read_word.word, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@fetch_read_word.word = internal global [1024 x i8] zeroinitializer
@.str = [9 x i8] c" %1023s \00"
define i8* @fetch_read_word(i32* nocapture %0) {
%2 = tail call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @fetch_read_word.word, i64 0, i64 0))
%3 = icmp eq i32 %2, 1
%4 = select i1 %3, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @fetch_read_word.word, i64 0, i64 0), i8* null
ret i8* %4
}
int type_and_void(int *i, void *v) {
  double n = *(double *)v;
  *i += n;
  return *(double *)v;
}


x86 assembly (clang, -O0):
<type_and_void>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
mov    -0x8(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cvttsd2si (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<type_and_void>:
cvtsi2sdl (%rdi),%xmm0
movsd  (%rsi),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,(%rdi)
cvttsd2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @type_and_void(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca double
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
store double %8, double* %5
%9 = load double, double* %5
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = sitofp i32 %11 to double
%13 = fadd double %12, %9
%14 = fptosi double %13 to i32
store i32 %14, i32* %10
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to double*
%17 = load double, double* %16
%18 = fptosi double %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @type_and_void(i32* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to double*
%4 = load double, double* %3
%5 = load i32, i32* %0
%6 = sitofp i32 %5 to double
%7 = fadd double %4, %6
%8 = fptosi double %7 to i32
store i32 %8, i32* %0
%9 = fptosi double %4 to i32
ret i32 %9
}
/* Variables and functions */
unsigned char constant_time_eq_8(unsigned int, unsigned int);
unsigned char constant_time_eq_int_8(int a, int b) {
  return constant_time_eq_8((unsigned)(a), (unsigned)(b));
}


x86 assembly (clang, -O0):
<constant_time_eq_int_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <constant_time_eq_8@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<constant_time_eq_int_8>:
jmp    1030 <constant_time_eq_8@plt>

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

LLVM IR (-O2):
define zeroext i8 @constant_time_eq_int_8(i32 %0, i32 %1) {
%3 = tail call zeroext i8 @constant_time_eq_8(i32 %0, i32 %1)
ret i8 %3
}
char rotate_by(char c, int x) { return (char)('A' + (((c - 'A') + x) % 26)); }


x86 assembly (clang, -O0):
<rotate_by>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    -0x8(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x41,%edx
mov    %dl,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_by>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffbf,%eax
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x41,%al
ret

LLVM IR (-O0):
define signext i8 @rotate_by(i8 signext %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 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 65
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = srem i32 %9, 26
%11 = add nsw i32 65, %10
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @rotate_by(i8 signext %0, i32 %1) {
%3 = sext i8 %0 to i32
%4 = add nsw i32 %3, -65
%5 = add nsw i32 %4, %1
%6 = srem i32 %5, 26
%7 = trunc i32 %6 to i8
%8 = add nsw i8 %7, 65
ret i8 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ ASN1_ITEM_rptr(int /*<<< orphan*/);
int ASN1_item_i2d_bio(int /*<<< orphan*/, int /*<<< orphan*/ *,
                      int /*<<< orphan*/ *);
int /*<<< orphan*/ RSAPublicKey;
int i2d_RSAPublicKey_bio(BIO *bp, RSA *rsa) {
  return ASN1_item_i2d_bio(ASN1_ITEM_rptr(RSAPublicKey), bp, rsa);
}


x86 assembly (clang, -O0):
<i2d_RSAPublicKey_bio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <ASN1_ITEM_rptr@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <ASN1_item_i2d_bio@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_RSAPublicKey_bio>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
call   1030 <ASN1_ITEM_rptr@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ASN1_item_i2d_bio@plt>

LLVM IR (-O0):
@RSAPublicKey = global i32 0
define i32 @i2d_RSAPublicKey_bio(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32, i32* @RSAPublicKey
%6 = call i32 @ASN1_ITEM_rptr(i32 %5)
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
%9 = call i32 @ASN1_item_i2d_bio(i32 %6, i32* %7, i32* %8)
ret i32 %9
}

LLVM IR (-O2):
@RSAPublicKey = global i32 0
define i32 @i2d_RSAPublicKey_bio(i32* %0, i32* %1) {
%3 = load i32, i32* @RSAPublicKey
%4 = tail call i32 @ASN1_ITEM_rptr(i32 %3)
%5 = tail call i32 @ASN1_item_i2d_bio(i32 %4, i32* %0, i32* %1)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int mvwscanw(int /*<<< orphan*/ *, int, int, char *, long *);
int l_mvwscanw(WINDOW *win, int y, int x, char *fmt, long *i) {
  return (mvwscanw(win, y, x, fmt, i));
}


x86 assembly (clang, -O0):
<l_mvwscanw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <mvwscanw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l_mvwscanw>:
jmp    1030 <mvwscanw@plt>

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

LLVM IR (-O2):
define i32 @l_mvwscanw(i32* %0, i32 %1, i32 %2, i8* %3, i64* %4) {
%6 = tail call i32 @mvwscanw(i32* %0, i32 %1, i32 %2, i8* %3, i64* %4)
ret i32 %6
}
/* Type definitions */
typedef int int32_t;
typedef int int16_t;

/* Variables and functions */
int32_t mulAdd(int16_t in, int16_t v, int32_t a) { return a + in * (int32_t)v; }


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

x86 assembly (clang, -O2):
<mulAdd>:
imul   %esi,%edi
lea    (%rdi,%rdx,1),%eax
ret

LLVM IR (-O0):
define i32 @mulAdd(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* %4
%9 = load i32, i32* %5
%10 = mul nsw i32 %8, %9
%11 = add nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @mulAdd(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(
      stderr,
      "\nUsage: sudo keylog [-k eventX] [-m eventY] [-s keymap.txt] [-t]\n\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [67 x i8] c"\0AUsage: sudo keylog [-k eventX] [-m eventY] [-s keymap.txt] [-t]\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [67 x i8] c"\0AUsage: sudo keylog [-k eventX] [-m eventY] [-s keymap.txt] [-t]\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
void gtk_tree_model_sort_convert_child_iter_to_iter() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_model_sort_convert_child_iter_to_iter() {
ret void
}
unsigned short int f69(unsigned short int x, int y) {
  return (x << y) + (x >> ((-y) & (8 * 2 - 1)));
}


x86 assembly (clang, -O0):
<f69>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0xf,%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f69>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
and    $0xf,%cl
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f69(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = load i32, i32* %4
%12 = sub nsw i32 0, %11
%13 = and i32 %12, 15
%14 = ashr i32 %10, %13
%15 = add nsw i32 %8, %14
%16 = trunc i32 %15 to i16
ret i16 %16
}

LLVM IR (-O2):
define zeroext i16 @f69(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = shl i32 %3, %1
%5 = sub nsw i32 0, %1
%6 = and i32 %5, 15
%7 = lshr i32 %3, %6
%8 = add nsw i32 %7, %4
%9 = trunc i32 %8 to i16
ret i16 %9
}
int dd_neq(const double *a, const double *b) {
  return ((a[0] != b[0]) || (a[1] != b[1])) ? 1 : 0;
}


x86 assembly (clang, -O0):
<dd_neq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rcx
mov    $0x1,%al
ucomisd (%rcx),%xmm0
mov    %al,-0x11(%rbp)
jne    114a <dd_neq+0x4a>
jp     114a <dd_neq+0x4a>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd 0x8(%rax),%xmm0
setne  %al
setp   %cl
or     %cl,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_neq>:
movsd  (%rdi),%xmm0
mov    $0x1,%eax
ucomisd (%rsi),%xmm0
jne    1111 <dd_neq+0x11>
jnp    1112 <dd_neq+0x12>
ret
movsd  0x8(%rsi),%xmm0
cmpneqsd 0x8(%rdi),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @dd_neq(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 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fcmp une double %7, %10
br i1 %11, label %20, label %12
12: ; preds = %2
%13 = load double*, double** %3
%14 = getelementptr inbounds double, double* %13, i64 1
%15 = load double, double* %14
%16 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = fcmp une double %15, %18
br label %20
20: ; preds = %12, %2
%21 = phi i1 [ true, %2 ], [ %19, %12 ]
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 1, i32 0
ret i32 %23
}

LLVM IR (-O2):
define i32 @dd_neq(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp une double %3, %4
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = fcmp une double %8, %10
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %6, %2
%14 = phi i32 [ 1, %2 ], [ %12, %6 ]
ret i32 %14
}
void arm() {}


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

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

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

LLVM IR (-O2):
define void @arm() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void thread(void) {
  printf("Thread is start.......\n");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<thread>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
jmp    1120 <thread+0x10>

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

LLVM IR (-O0):
@.str = [24 x i8] c"Thread is start.......\0A\00"
define void @thread() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@str = [23 x i8] c"Thread is start.......\00"
define void @thread() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
unsigned int hash_string_function(const char *s) {
  unsigned int h = 0;
  while (*s)
    h = h * 101 + (unsigned char)*s++;
  return h;
}


x86 assembly (clang, -O0):
<hash_string_function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113c <hash_string_function+0x3c>
imul   $0x65,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash_string_function+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string_function>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <hash_string_function+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
imul   $0x65,%eax,%edx
movzbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_string_function+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hash_string_function(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 %16
8: ; preds = %4
%9 = load i32, i32* %3
%10 = mul i32 %9, 101
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i8, i8* %11
%14 = zext i8 %13 to i32
%15 = add i32 %10, %14
store i32 %15, i32* %3
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
ret i32 %17
}

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