xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x;
  for (x = 1; x <= 10; x++) {
    if (x == 5) {
      break;
    }
    printf("%d ", x);
  }
  printf("\nBroke out of loop at x == %d\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     115c <main+0x4c>
cmpl   $0x5,-0x8(%rbp)
jne    113f <main+0x2f>
jmp    115c <main+0x4c>
mov    -0x8(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x8(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
@.str.1 = [31 x i8] c"\0ABroke out of loop at x == %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ NRF24_Read_Reg(int /*<<< orphan*/);
int /*<<< orphan*/ NRF24_Write_Reg(int /*<<< orphan*/, int /*<<< orphan*/);
uint8_t NRF24_Reg_SetBit(uint8_t reg, uint8_t value) {
  uint8_t data;
  data = NRF24_Read_Reg(reg);
  data |= value;
  NRF24_Write_Reg(reg, data);
  return data;
}


x86 assembly (clang, -O0):
<NRF24_Reg_SetBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <NRF24_Read_Reg@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <NRF24_Write_Reg@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NRF24_Reg_SetBit>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
call   1030 <NRF24_Read_Reg@plt>
mov    %eax,%ebx
or     %r14d,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <NRF24_Write_Reg@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @NRF24_Reg_SetBit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @NRF24_Read_Reg(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = or i32 %9, %8
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = call i32 @NRF24_Write_Reg(i32 %11, i32 %12)
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @NRF24_Reg_SetBit(i32 %0, i32 %1) {
%3 = tail call i32 @NRF24_Read_Reg(i32 %0)
%4 = or i32 %3, %1
%5 = tail call i32 @NRF24_Write_Reg(i32 %0, i32 %4)
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void set_TCP_dst_port(uint8_t *tcp_packet, uint16_t port) {
  tcp_packet[2] = port >> 8;
  tcp_packet[3] = (uint8_t)port;
}


x86 assembly (clang, -O0):
<set_TCP_dst_port>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_TCP_dst_port>:
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @set_TCP_dst_port(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 = ashr i32 %5, 8
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 3
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @set_TCP_dst_port(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
%4 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %3, i32* %4
%5 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %1, i32* %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ui_field_navigate_left();
void switch_s2_left(const uint32_t repeat_count) {
  (void)repeat_count;
  ui_field_navigate_left();
}


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

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

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

LLVM IR (-O2):
define void @switch_s2_left(i32 %0) {
%2 = tail call i32 (...) @ui_field_navigate_left()
ret void
}
/* Type definitions */
struct libavl_allocator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(void *);
void rtrb_free(struct libavl_allocator *allocator, void *block) {
  assert(allocator != NULL && block != NULL);
  free(block);
}


x86 assembly (clang, -O0):
<rtrb_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     114b <rtrb_free+0x2b>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtrb_free>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.libavl_allocator = type { i32 }
define void @rtrb_free(%struct.libavl_allocator* %0, i8* %1) {
%3 = alloca %struct.libavl_allocator*
%4 = alloca i8*
store %struct.libavl_allocator* %0, %struct.libavl_allocator** %3
store i8* %1, i8** %4
%5 = load %struct.libavl_allocator*, %struct.libavl_allocator** %3
%6 = icmp ne %struct.libavl_allocator* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
%struct.libavl_allocator = type { i32 }
define void @rtrb_free(%struct.libavl_allocator* readnone %0, i8* %1) {
%3 = icmp ne %struct.libavl_allocator* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int PrintMyName() {
  printf("My name is Ivaylo\n");
  return (EXIT_SUCCESS);
}


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

x86 assembly (clang, -O2):
<PrintMyName>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"My name is Ivaylo\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @PrintMyName() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [18 x i8] c"My name is Ivaylo\00"
define i32 @PrintMyName() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
void ff_hevc_put_hevc_bi_w_epel_hv32_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_hv32_12_sse4() {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int cfxpmul_signed(int, int);
int cfxpsub(int, int);
uint64_t sincal(uint64_t a) {
  return cfxpsub(cfxpmul_signed((uint64_t)3 << 32, a),
                 cfxpmul_signed((uint64_t)4 << 32,
                                cfxpmul_signed(a, cfxpmul_signed(a, a))));
}


x86 assembly (clang, -O0):
<sincal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
call   1030 <cfxpmul_signed@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <cfxpmul_signed@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1030 <cfxpmul_signed@plt>
mov    %eax,%esi
call   1030 <cfxpmul_signed@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <cfxpsub@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sincal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cfxpmul_signed(i32 poison, i32 %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @cfxpmul_signed(i32 %6, i32 %7)
%9 = call i32 @cfxpmul_signed(i32 %5, i32 %8)
%10 = call i32 @cfxpmul_signed(i32 poison, i32 %9)
%11 = call i32 @cfxpsub(i32 %4, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @sincal(i32 %0) {
%2 = tail call i32 @cfxpmul_signed(i32 poison, i32 %0)
%3 = tail call i32 @cfxpmul_signed(i32 %0, i32 %0)
%4 = tail call i32 @cfxpmul_signed(i32 %0, i32 %3)
%5 = tail call i32 @cfxpmul_signed(i32 poison, i32 %4)
%6 = tail call i32 @cfxpsub(i32 %2, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) { printf("hello\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int STC3115_WriteByte(int, int);
int STC3115_AlarmClear(void) {
  int res;
  res = STC3115_WriteByte(0x01, 0x01);
  if (res != 0)
    return (res);
  return (res);
}


x86 assembly (clang, -O0):
<STC3115_AlarmClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <STC3115_WriteByte@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113c <STC3115_AlarmClear+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <STC3115_AlarmClear+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STC3115_AlarmClear>:
mov    $0x1,%edi
mov    $0x1,%esi
jmp    1030 <STC3115_WriteByte@plt>

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

LLVM IR (-O2):
define i32 @STC3115_AlarmClear() {
%1 = tail call i32 @STC3115_WriteByte(i32 1, i32 1)
ret i32 %1
}
/* Type definitions */
struct stack_st_OPENSSL_CSTRING {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
scalar_t__ OPENSSL_sk_value(int /*<<< orphan*/ const *, int);
const char *sk_OPENSSL_CSTRING_value(const struct stack_st_OPENSSL_CSTRING *sk,
                                     int idx) {
  return (const char *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);
}


x86 assembly (clang, -O0):
<sk_OPENSSL_CSTRING_value>:
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 <OPENSSL_sk_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sk_OPENSSL_CSTRING_value>:
jmp    1030 <OPENSSL_sk_value@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define i8* @sk_OPENSSL_CSTRING_value(%struct.stack_st_OPENSSL_CSTRING* %0, i32 %1) {
%3 = alloca %struct.stack_st_OPENSSL_CSTRING*
%4 = alloca i32
store %struct.stack_st_OPENSSL_CSTRING* %0, %struct.stack_st_OPENSSL_CSTRING** %3
store i32 %1, i32* %4
%5 = load %struct.stack_st_OPENSSL_CSTRING*, %struct.stack_st_OPENSSL_CSTRING** %3
%6 = bitcast %struct.stack_st_OPENSSL_CSTRING* %5 to i32*
%7 = load i32, i32* %4
%8 = call i64 @OPENSSL_sk_value(i32* %6, i32 %7)
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define i8* @sk_OPENSSL_CSTRING_value(%struct.stack_st_OPENSSL_CSTRING* %0, i32 %1) {
%3 = getelementptr %struct.stack_st_OPENSSL_CSTRING, %struct.stack_st_OPENSSL_CSTRING* %0, i64 0, i32 0
%4 = tail call i64 @OPENSSL_sk_value(i32* %3, i32 %1)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int _my_strncmp(char *, char *, int, int /*<<< orphan*/);
int my_strncmp(char *s1, char *s2, int n) { return _my_strncmp(s1, s2, n, 0); }


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

x86 assembly (clang, -O2):
<my_strncmp>:
xor    %ecx,%ecx
jmp    1030 <_my_strncmp@plt>

LLVM IR (-O0):
define i32 @my_strncmp(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @_my_strncmp(i8* %7, i8* %8, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @my_strncmp(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @_my_strncmp(i8* %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p256_set_one(uintptr_t);
void fiat_p256_set_one(uint32_t out1[8]) {
  internal_fiat_p256_set_one((uintptr_t)out1);
}


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

x86 assembly (clang, -O2):
<fiat_p256_set_one>:
jmp    1030 <internal_fiat_p256_set_one@plt>

LLVM IR (-O0):
define void @fiat_p256_set_one(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = ptrtoint i32* %3 to i64
%5 = call i32 @internal_fiat_p256_set_one(i64 %4)
ret void
}

LLVM IR (-O2):
define void @fiat_p256_set_one(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = tail call i32 @internal_fiat_p256_set_one(i64 %2)
ret void
}
float rad(float degrees) { return degrees * 3.14159265358979323846 / 180.0f; }


x86 assembly (clang, -O0):
<rad>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeee(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @rad(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 0x400921FB54442D18
%6 = fdiv double %5, 1.800000e+02
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @rad(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x400921FB54442D18
%4 = fdiv double %3, 1.800000e+02
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ panic();
void prefetch_abort_entry_arm7(unsigned int address) { panic(); }


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

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

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

LLVM IR (-O2):
define void @prefetch_abort_entry_arm7(i32 %0) {
%2 = tail call i32 (...) @panic()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int tempo, velocidade;
  float distancia;
  scanf("%d", &tempo);
  scanf("%d", &velocidade);
  distancia = (tempo * velocidade) / 12.0;
  printf("%.3f\n", distancia);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec2(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xe9e(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xedc(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
imul   0xc(%rsp),%eax
cvtsi2sd %eax,%xmm0
divsd  0xea5(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = mul nsw i32 %7, %8
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 1.200000e+01
%12 = fptrunc double %11 to float
store float %12, float* %4
%13 = load float, float* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, %7
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 1.200000e+01
%12 = fptrunc double %11 to float
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float %12)
ret i32 0
}
float check_discount(float fixed, float unit_price, int quantity) {
  return fixed + (unit_price * quantity);
}


x86 assembly (clang, -O0):
<check_discount>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_discount>:
cvtsi2ss %edi,%xmm2
mulss  %xmm1,%xmm2
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @check_discount(float %0, float %1, i32 %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca i32
store float %0, float* %4
store float %1, float* %5
store i32 %2, i32* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load i32, i32* %6
%10 = sitofp i32 %9 to float
%11 = call float @llvm.fmuladd.f32(float %8, float %10, float %7)
ret float %11
}

LLVM IR (-O2):
define float @check_discount(float %0, float %1, i32 %2) {
%4 = sitofp i32 %2 to float
%5 = tail call float @llvm.fmuladd.f32(float %1, float %4, float %0)
ret float %5
}
/* Variables and functions */
int __memcmp(void const *, void const *, size_t);
int memcmp(const void *s1, const void *s2, size_t n) {
  return __memcmp(s1, s2, n);
}


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

x86 assembly (clang, -O2):
<memcmp>:
jmp    1030 <__memcmp@plt>

LLVM IR (-O0):
define i32 @memcmp(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @__memcmp(i8* %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @memcmp(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @__memcmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
double Degrees(double arg) { return (arg / 1.74532925E-2); }


x86 assembly (clang, -O0):
<Degrees>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Degrees>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @Degrees(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 0x3F91DF46A1FAE711
ret double %4
}

LLVM IR (-O2):
define double @Degrees(double %0) {
%2 = fdiv double %0, 0x3F91DF46A1FAE711
ret double %2
}
int number_of_digits_in_integer(int num) {
  int digits = 0;
  while (num) {
    ++digits;
    num /= 10;
  }
  return (digits);
}


x86 assembly (clang, -O0):
<number_of_digits_in_integer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <number_of_digits_in_integer+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <number_of_digits_in_integer+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_of_digits_in_integer>:
xor    %eax,%eax
test   %edi,%edi
je     1132 <number_of_digits_in_integer+0x32>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <number_of_digits_in_integer+0x10>
ret

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

LLVM IR (-O2):
define i32 @number_of_digits_in_integer(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = sdiv i32 %5, 10
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dummy_firebird() { printf("\n"); }


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

x86 assembly (clang, -O2):
<dummy_firebird>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @dummy_firebird() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ set_rounding(int /*<<< orphan*/ const *);
double sqrt(double const);
void sqrt_d(const uint32_t *fcr31, const double *source, double *target) {
  set_rounding(fcr31);
  *target = sqrt(*source);
}


x86 assembly (clang, -O0):
<sqrt_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <set_rounding@plt>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <sqrt@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt_d>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1040 <set_rounding@plt>
movsd  (%rbx),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1143 <sqrt_d+0x23>
sqrtsd %xmm0,%xmm0
jmp    1148 <sqrt_d+0x28>
call   1030 <sqrt@plt>
movsd  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @sqrt_d(i32* %0, double* %1, double* %2) {
%4 = alloca i32*
%5 = alloca double*
%6 = alloca double*
store i32* %0, i32** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load i32*, i32** %4
%8 = call i32 @set_rounding(i32* %7)
%9 = load double*, double** %5
%10 = load double, double* %9
%11 = call double @sqrt(double %10)
%12 = load double*, double** %6
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @sqrt_d(i32* %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = tail call i32 @set_rounding(i32* %0)
%5 = load double, double* %1
%6 = tail call double @sqrt(double %5)
store double %6, double* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t const);
void Com_Memcpy(void *dest, const void *src, const size_t count) {
  memcpy(dest, src, count);
}


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

x86 assembly (clang, -O2):
<Com_Memcpy>:
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @Com_Memcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcpy(i8* %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @Com_Memcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
void g_slist_last() {}


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

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

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

LLVM IR (-O2):
define void @g_slist_last() {
ret void
}
/* Variables and functions */
int cpu_get_cpsr();
int /*<<< orphan*/ cpu_set_cpsr(int);
void enableirq(void) { cpu_set_cpsr(cpu_get_cpsr() & ~(1 << 7)); }


x86 assembly (clang, -O0):
<enableirq>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <cpu_get_cpsr@plt>
mov    %eax,%edi
and    $0xffffff7f,%edi
call   1030 <cpu_set_cpsr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<enableirq>:
push   %rax
xor    %eax,%eax
call   1040 <cpu_get_cpsr@plt>
and    $0xffffff7f,%eax
mov    %eax,%edi
pop    %rax
jmp    1030 <cpu_set_cpsr@plt>

LLVM IR (-O0):
define void @enableirq() {
%1 = call i32 (...) @cpu_get_cpsr()
%2 = and i32 %1, -129
%3 = call i32 @cpu_set_cpsr(i32 %2)
ret void
}

LLVM IR (-O2):
define void @enableirq() {
%1 = tail call i32 (...) @cpu_get_cpsr()
%2 = and i32 %1, -129
%3 = tail call i32 @cpu_set_cpsr(i32 %2)
ret void
}
void mbo_ap_sta_free(struct sta_info *sta) {}


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

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

LLVM IR (-O0):
%struct.sta_info = type opaque
define void @mbo_ap_sta_free(%struct.sta_info* %0) {
%2 = alloca %struct.sta_info*
store %struct.sta_info* %0, %struct.sta_info** %2
ret void
}

LLVM IR (-O2):
%struct.sta_info = type opaque
define void @mbo_ap_sta_free(%struct.sta_info* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char const *);
int /*<<< orphan*/ perror(char *);
FILE *fopen_or_die(char *filename, const char *mode) {
  FILE *retval;
  retval = fopen(filename, mode);
  if (retval == NULL) {
    perror(filename);
    exit(-1);
  }
  return retval;
}


x86 assembly (clang, -O0):
<fopen_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <fopen_or_die+0x3f>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopen_or_die>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fopen@plt>
test   %rax,%rax
je     1140 <fopen_or_die+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
define noalias i32* @fopen_or_die(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* %0)
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
ret i32* %3
}
void SumSquareErrorToPsnr() {}


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

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

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

LLVM IR (-O2):
define void @SumSquareErrorToPsnr() {
ret void
}
void inc1(int byval) { byval++; }


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

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

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

LLVM IR (-O2):
define void @inc1(i32 %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ strtoul(char const *, char **, int);
uint32_t validate_eid_str(const char *eid) {
  char *strtol_end;
  uint32_t rc = strtoul(eid, &strtol_end, 16);
  if (*strtol_end != '\0' || *eid == '\0')
    rc = 0;
  return rc;
}


x86 assembly (clang, -O0):
<validate_eid_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x10,%edx
call   1030 <strtoul@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1152 <validate_eid_str+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    115a <validate_eid_str+0x4a>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_eid_str>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
mov    $0x10,%edx
call   1030 <strtoul@plt>
mov    0x8(%rsp),%rcx
cmpb   $0x0,(%rcx)
jne    1136 <validate_eid_str+0x26>
cmpb   $0x0,(%rbx)
jne    1138 <validate_eid_str+0x28>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @validate_eid_str(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @strtoul(i8* %0, i8** %2, i32 16)
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8, i8* %0
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8, %1
br label %12
12: ; preds = %11, %8
%13 = phi i64 [ 0, %11 ], [ %4, %8 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ db_pos(double);
double psd_estimate_usemdct(double mdct_line, double cof) {
  double power;
  double psd;
  power = (mdct_line * mdct_line + 1) / cof;
  psd = 0 + db_pos(power);
  return psd;
}


x86 assembly (clang, -O0):
<psd_estimate_usemdct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec8(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <db_pos@plt>
add    $0x0,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psd_estimate_usemdct>:
push   %rax
mulsd  %xmm0,%xmm0
addsd  0xee3(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1030 <db_pos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @psd_estimate_usemdct(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %3
%9 = call double @llvm.fmuladd.f64(double %7, double %8, double 1.000000e+00)
%10 = load double, double* %4
%11 = fdiv double %9, %10
store double %11, double* %5
%12 = load double, double* %5
%13 = call i32 @db_pos(double %12)
%14 = add nsw i32 0, %13
%15 = sitofp i32 %14 to double
store double %15, double* %6
%16 = load double, double* %6
ret double %16
}

LLVM IR (-O2):
define double @psd_estimate_usemdct(double %0, double %1) {
%3 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 1.000000e+00)
%4 = fdiv double %3, %1
%5 = tail call i32 @db_pos(double %4)
%6 = sitofp i32 %5 to double
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
__attribute__((__always___)) void writeb(unsigned char b, volatile void *addr) {
  *(volatile unsigned char *)addr = b;
}


x86 assembly (clang, -O0):
<writeb>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeb>:
mov    %dil,(%rsi)
ret

LLVM IR (-O0):
define void @writeb(i8 zeroext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i8, i8* %3
%6 = load i8*, i8** %4
store volatile i8 %5, i8* %6
ret void
}

LLVM IR (-O2):
define void @writeb(i8 zeroext %0, i8* %1) {
store volatile i8 %0, i8* %1
ret void
}
int dotime() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @dotime() {
ret i32 1
}
void pthread_attr_setinheritsched() {}


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

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

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

LLVM IR (-O2):
define void @pthread_attr_setinheritsched() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_string(char *s) { printf("char*: %s\n", s); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"char*: %s\0A\00"
define void @print_string(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int _unlink() { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_unlink() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int strlen(char *);
int length_as_char(int number) {
  char numbuf[32];
  sprintf(numbuf, "%i", number);
  return strlen(numbuf);
}


x86 assembly (clang, -O0):
<length_as_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<length_as_char>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%edx
lea    0xed2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @length_as_char(i32 %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @strlen(i8* %3)
ret i32 %5
}
/* Type definitions */
typedef long off_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fseeko(int /*<<< orphan*/ *, long, int);
int fseek(FILE *fp, long offset, int whence) {
  off_t off = offset;
  return (fseeko(fp, off, whence));
}


x86 assembly (clang, -O0):
<fseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <fseeko@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fseek>:
jmp    1030 <fseeko@plt>

LLVM IR (-O0):
define i32 @fseek(i32* %0, i64 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i64
store i32* %0, i32** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%8 = load i64, i64* %5
store i64 %8, i64* %7
%9 = load i32*, i32** %4
%10 = load i64, i64* %7
%11 = load i32, i32* %6
%12 = call i32 @fseeko(i32* %9, i64 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @fseek(i32* nocapture %0, i64 %1, i32 %2) {
%4 = tail call i32 @fseeko(i32* %0, i64 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
union i2c_smbus_data {
  int byte;
};
typedef int __s32;

/* Variables and functions */
int /*<<< orphan*/ I2C_SMBUS_BYTE;
int /*<<< orphan*/ I2C_SMBUS_READ;
scalar_t__ i2c_smbus_access(int, int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/, union i2c_smbus_data *);
__s32 i2c_smbus_read_byte(int file) {
  union i2c_smbus_data data;
  if (i2c_smbus_access(file, I2C_SMBUS_READ, 0, I2C_SMBUS_BYTE, &data))
    return -1;
  else
    return 0x0FF & data.byte;
}


x86 assembly (clang, -O0):
<i2c_smbus_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
mov    0x2eba(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
lea    -0x10(%rbp),%r8
call   1030 <i2c_smbus_access@plt>
cmp    $0x0,%rax
je     1151 <i2c_smbus_read_byte+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <i2c_smbus_read_byte+0x4c>
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_smbus_read_byte>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2ec7(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%r8
xor    %edx,%edx
call   1030 <i2c_smbus_access@plt>
movzbl (%rsp),%ecx
neg    %rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%union.i2c_smbus_data = type { i32 }
@I2C_SMBUS_READ = global i32 0
@I2C_SMBUS_BYTE = global i32 0
define i32 @i2c_smbus_read_byte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %union.i2c_smbus_data
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @I2C_SMBUS_READ
%7 = load i32, i32* @I2C_SMBUS_BYTE
%8 = call i64 @i2c_smbus_access(i32 %5, i32 %6, i32 0, i32 %7, %union.i2c_smbus_data* %4)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %15
11: ; preds = %1
%12 = bitcast %union.i2c_smbus_data* %4 to i32*
%13 = load i32, i32* %12
%14 = and i32 255, %13
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%union.i2c_smbus_data = type { i32 }
@I2C_SMBUS_READ = global i32 0
@I2C_SMBUS_BYTE = global i32 0
define i32 @i2c_smbus_read_byte(i32 %0) {
%2 = alloca %union.i2c_smbus_data
%3 = bitcast %union.i2c_smbus_data* %2 to i8*
%4 = load i32, i32* @I2C_SMBUS_READ
%5 = load i32, i32* @I2C_SMBUS_BYTE
%6 = call i64 @i2c_smbus_access(i32 %0, i32 %4, i32 0, i32 %5, %union.i2c_smbus_data* %2)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds %union.i2c_smbus_data, %union.i2c_smbus_data* %2, i64 0, i32 0
%9 = load i32, i32* %8
%10 = and i32 %9, 255
%11 = select i1 %7, i32 %10, i32 -1
ret i32 %11
}
void DMA2_Stream1_IRQHandler() {}


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

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

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

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