xunge/DecIR huggingface dataset:
void lc_word(ptr) char *ptr;
{
  while (*ptr) {
    *ptr = mklow(*ptr);
    ptr++;
  }
}


x86 assembly (clang, -O0):
<lc_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1150 <lc_word+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <mklow@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <lc_word+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lc_word>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1138 <lc_word+0x28>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
xor    %eax,%eax
call   1030 <mklow@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <lc_word+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @lc_word(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @mklow to i32 (i32, ...)*)(i32 %7)
%9 = trunc i32 %8 to i8
store i8 %9, i8* %6
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
void *GetHunkMemory(unsigned long);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, unsigned long);
void *GetClearedHunkMemory(unsigned long size) {
  void *ptr;
  ptr = GetHunkMemory(size);
  memset(ptr, 0, size);
  return ptr;
}


x86 assembly (clang, -O0):
<GetClearedHunkMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <GetHunkMemory@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetClearedHunkMemory>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <GetHunkMemory@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @GetClearedHunkMemory(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @GetHunkMemory(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @GetClearedHunkMemory(i64 %0) {
%2 = tail call i8* @GetHunkMemory(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void batadc_reset() {
  mbus_remote_register_write(0x6, 0x3B,
                             ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) |
                              (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7) |
                              (1 << 8) | (1 << 9) | (1 << 10) | (0 << 11) |
                              (0 << 12) | (1 << 13) | (1 << 14) | (1 << 15) |
                              (1 << 16) | (1 << 17) | (1 << 18) | (1 << 19)));
  delay(100);
}


x86 assembly (clang, -O0):
<batadc_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x3b,%esi
mov    $0xfe7ff,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<batadc_reset>:
push   %rax
mov    $0x6,%edi
mov    $0x3b,%esi
mov    $0xfe7ff,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @batadc_reset() {
%1 = call i32 @mbus_remote_register_write(i32 6, i32 59, i32 1042431)
%2 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @batadc_reset() {
%1 = tail call i32 @mbus_remote_register_write(i32 6, i32 59, i32 1042431)
%2 = tail call i32 @delay(i32 100)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_secp256k1_sub(uintptr_t, uintptr_t, uintptr_t);
void fiat_secp256k1_sub(uint64_t out1[4], const uint64_t arg1[4],
                        const uint64_t arg2[4]) {
  internal_fiat_secp256k1_sub((uintptr_t)out1, (uintptr_t)arg1,
                              (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_secp256k1_sub>:
jmp    1030 <internal_fiat_secp256k1_sub@plt>

LLVM IR (-O0):
define void @fiat_secp256k1_sub(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** %4
%8 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_secp256k1_sub(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_secp256k1_sub(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_secp256k1_sub(i64 %4, i64 %5, i64 %6)
ret void
}
void UART2_TX_intr(void) {}


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

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

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

LLVM IR (-O2):
define void @UART2_TX_intr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ random_between(int /*<<< orphan*/, int);
bool random_bool(void) { return (bool)random_between(0, 2); }


x86 assembly (clang, -O0):
<random_bool>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x2,%esi
call   1030 <random_between@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_bool>:
xor    %edi,%edi
mov    $0x2,%esi
jmp    1030 <random_between@plt>

LLVM IR (-O0):
define i32 @random_bool() {
%1 = call i32 @random_between(i32 0, i32 2)
ret i32 %1
}

LLVM IR (-O2):
define i32 @random_bool() {
%1 = tail call i32 @random_between(i32 0, i32 2)
ret i32 %1
}
/* Variables and functions */
int PAPI_read(int, long long *);
void papif_read(int *EventSet, long long *values, int *check) {
  *check = PAPI_read(*EventSet, values);
}


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

x86 assembly (clang, -O2):
<papif_read>:
push   %rbx
mov    %rdx,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_read@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_read(i32* nocapture %0, i64* %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = tail call i32 @PAPI_read(i32 %4, i64* %1)
store i32 %5, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ grid_sleep(int);
int /*<<< orphan*/ grid_term();
void routine2(__attribute__((unused)) void *arg) {
  grid_sleep(10);
  grid_term();
}


x86 assembly (clang, -O0):
<routine2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xa,%edi
call   1040 <grid_sleep@plt>
mov    $0x0,%al
call   1030 <grid_term@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<routine2>:
push   %rax
mov    $0xa,%edi
call   1040 <grid_sleep@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <grid_term@plt>

LLVM IR (-O0):
define void @routine2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @grid_sleep(i32 10)
%4 = call i32 (...) @grid_term()
ret void
}

LLVM IR (-O2):
define void @routine2(i8* nocapture readnone %0) {
%2 = tail call i32 @grid_sleep(i32 10)
%3 = tail call i32 (...) @grid_term()
ret void
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
u_int32_t RL(u_int32_t n, u_int32_t s) { return (n << s) | (n >> (32 - s)); }


x86 assembly (clang, -O0):
<RL>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RL>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @RL(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @RL(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
int __attribute((unit("m*m")))
square_with_unit(int __attribute((unit("m"))) x) {
  return x * x;
}


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

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

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

LLVM IR (-O2):
define i32 @square_with_unit(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ testforty_state_push(char *, void *);
void testforty_state_push_one(void *context) {
  testforty_state_push("ONE", context);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"ONE\00"
define void @testforty_state_push_one(i8* %0) {
%2 = tail call i32 @testforty_state_push(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handleTurnOn() { printf(" ----- <TurnOn> -----> "); }


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

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

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

LLVM IR (-O2):
@.str = [24 x i8] c" ----- <TurnOn> -----> \00"
define void @handleTurnOn() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int get_num(char const *, char const *);
scalar_t__ strncmp(char *, char const *, int);
int get_maxlen(const char *start, const char *end) {
  if (strncmp("unlimited", start, (end - start)) == 0) {
    return 0;
  }
  return get_num(start, end);
}


x86 assembly (clang, -O0):
<get_maxlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
lea    0xeb8(%rip),%rdi
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1163 <get_maxlen+0x43>
movl   $0x0,-0x4(%rbp)
jmp    1173 <get_maxlen+0x53>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <get_num@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_maxlen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %r14d,%edx
sub    %ebx,%edx
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strncmp@plt>
test   %rax,%rax
je     1155 <get_maxlen+0x35>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <get_num@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"unlimited\00"
define i32 @get_maxlen(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %7 to i64
%10 = ptrtoint i8* %8 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
%13 = call i64 @strncmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 0, i32* %3
br label %20
16: ; preds = %2
%17 = load i8*, i8** %4
%18 = load i8*, i8** %5
%19 = call i32 @get_num(i8* %17, i8* %18)
store i32 %19, i32* %3
br label %20
20: ; preds = %16, %15
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [10 x i8] c"unlimited\00"
define i32 @get_maxlen(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = tail call i64 @strncmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = tail call i32 @get_num(i8* %0, i8* %1)
br label %11
11: ; preds = %2, %9
%12 = phi i32 [ %10, %9 ], [ 0, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ setRGBColor(short, short, short, short);
void ledOnEffect(short ledNumber, short *data) {
  setRGBColor(ledNumber, data[0], data[1], data[2]);
}


x86 assembly (clang, -O0):
<ledOnEffect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x2(%rbp),%si
mov    -0x10(%rbp),%rax
mov    (%rax),%dx
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cx
mov    -0x10(%rbp),%rax
movswl %si,%edi
movswl %dx,%esi
movswl %cx,%edx
movswl 0x4(%rax),%ecx
call   1030 <setRGBColor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ledOnEffect>:
movswl (%rsi),%eax
movswl 0x2(%rsi),%edx
movswl 0x4(%rsi),%ecx
mov    %eax,%esi
jmp    1030 <setRGBColor@plt>

LLVM IR (-O0):
define void @ledOnEffect(i16 signext %0, i16* %1) {
%3 = alloca i16
%4 = alloca i16*
store i16 %0, i16* %3
store i16* %1, i16** %4
%5 = load i16, i16* %3
%6 = load i16*, i16** %4
%7 = getelementptr inbounds i16, i16* %6, i64 0
%8 = load i16, i16* %7
%9 = load i16*, i16** %4
%10 = getelementptr inbounds i16, i16* %9, i64 1
%11 = load i16, i16* %10
%12 = load i16*, i16** %4
%13 = getelementptr inbounds i16, i16* %12, i64 2
%14 = load i16, i16* %13
%15 = call i32 @setRGBColor(i16 signext %5, i16 signext %8, i16 signext %11, i16 signext %14)
ret void
}

LLVM IR (-O2):
define void @ledOnEffect(i16 signext %0, i16* nocapture %1) {
%3 = load i16, i16* %1
%4 = getelementptr inbounds i16, i16* %1, i64 1
%5 = load i16, i16* %4
%6 = getelementptr inbounds i16, i16* %1, i64 2
%7 = load i16, i16* %6
%8 = tail call i32 @setRGBColor(i16 signext %0, i16 signext %3, i16 signext %5, i16 signext %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ CheckedCommand(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  char *, int);
int /*<<< orphan*/ printf(char *);
void DeleteImage(FILE *p_cmd, FILE *p_res, int i_overlay) {
  printf("Removing image...");
  CheckedCommand(p_cmd, p_res, "DeleteImage %d\n", i_overlay);
  printf(" done\n");
}


x86 assembly (clang, -O0):
<DeleteImage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
lea    0xec1(%rip),%rdx
call   1040 <CheckedCommand@plt>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DeleteImage>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
lea    0xec2(%rip),%rdx
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%ecx
call   1050 <CheckedCommand@plt>
lea    0xebd(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Removing image...\00"
@.str.1 = [16 x i8] c"DeleteImage %d\0A\00"
@.str.2 = [7 x i8] c" done\0A\00"
define void @DeleteImage(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 ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%8 = load i32*, i32** %4
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = call i32 @CheckedCommand(i32* %8, i32* %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Removing image...\00"
@.str.1 = [16 x i8] c"DeleteImage %d\0A\00"
@str = [6 x i8] c" done\00"
define void @DeleteImage(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @CheckedCommand(i32* %0, i32* %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
int *func(int n) { return &n; }


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

x86 assembly (clang, -O2):
<func>:
lea    -0x4(%rsp),%rax
ret

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

LLVM IR (-O2):
define noalias i32* @func(i32 %0) {
%2 = alloca i32
ret i32* %2
}
void slideTapNoop(float x) {}


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

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

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

LLVM IR (-O2):
define void @slideTapNoop(float %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ R_OK;
int /*<<< orphan*/ access(char *, int /*<<< orphan*/);
int perf_supported(void) {
  return !access("/proc/sys/kernel/perf_event_paranoid", R_OK);
}


x86 assembly (clang, -O0):
<perf_supported>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <access@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<perf_supported>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"/proc/sys/kernel/perf_event_paranoid\00"
@R_OK = global i32 0
define i32 @perf_supported() {
%1 = load i32, i32* @R_OK
%2 = call i32 @access(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
@.str = [37 x i8] c"/proc/sys/kernel/perf_event_paranoid\00"
@R_OK = global i32 0
define i32 @perf_supported() {
%1 = load i32, i32* @R_OK
%2 = tail call i32 @access(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int dup(int oldd) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @dup(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ SetSeed(int, int, int);
void ResetSeed(void) { SetSeed(101, 1001, 10001); }


x86 assembly (clang, -O0):
<ResetSeed>:
push   %rbp
mov    %rsp,%rbp
mov    $0x65,%edi
mov    $0x3e9,%esi
mov    $0x2711,%edx
call   1030 <SetSeed@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ResetSeed>:
mov    $0x65,%edi
mov    $0x3e9,%esi
mov    $0x2711,%edx
jmp    1030 <SetSeed@plt>

LLVM IR (-O0):
define void @ResetSeed() {
%1 = call i32 @SetSeed(i32 101, i32 1001, i32 10001)
ret void
}

LLVM IR (-O2):
define void @ResetSeed() {
%1 = tail call i32 @SetSeed(i32 101, i32 1001, i32 10001)
ret void
}
/* Variables and functions */
scalar_t__ hwI2CReadReg(int, int);
unsigned short sii164GetVendorID(void) {
  unsigned short vendorID;
  vendorID = ((unsigned short)hwI2CReadReg(0x70, 0x01) << 8) |
             (unsigned short)hwI2CReadReg(0x70, 0x00);
  return vendorID;
}


x86 assembly (clang, -O0):
<sii164GetVendorID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x70,%edi
mov    $0x1,%esi
call   1030 <hwI2CReadReg@plt>
movzwl %ax,%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    $0x70,%edi
xor    %esi,%esi
call   1030 <hwI2CReadReg@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%eax
movzwl %cx,%ecx
or     %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sii164GetVendorID>:
push   %rbx
mov    $0x70,%edi
mov    $0x1,%esi
call   1030 <hwI2CReadReg@plt>
mov    %rax,%rbx
shl    $0x8,%ebx
mov    $0x70,%edi
xor    %esi,%esi
call   1030 <hwI2CReadReg@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @sii164GetVendorID() {
%1 = alloca i16
%2 = call i64 @hwI2CReadReg(i32 112, i32 1)
%3 = trunc i64 %2 to i16
%4 = zext i16 %3 to i32
%5 = shl i32 %4, 8
%6 = call i64 @hwI2CReadReg(i32 112, i32 0)
%7 = trunc i64 %6 to i16
%8 = zext i16 %7 to i32
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i16
store i16 %10, i16* %1
%11 = load i16, i16* %1
ret i16 %11
}

LLVM IR (-O2):
define zeroext i16 @sii164GetVendorID() {
%1 = tail call i64 @hwI2CReadReg(i32 112, i32 1)
%2 = trunc i64 %1 to i16
%3 = shl i16 %2, 8
%4 = tail call i64 @hwI2CReadReg(i32 112, i32 0)
%5 = trunc i64 %4 to i16
%6 = or i16 %3, %5
ret i16 %6
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t hash_32(uint32_t val) { return (val * 0x9e370001UL) >> 24; }


x86 assembly (clang, -O0):
<hash_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0x9e370001,%rcx
imul   %rcx,%rax
shr    $0x18,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_32>:
movslq %edi,%rcx
mov    $0x9e370001,%eax
imul   %rcx,%rax
shr    $0x18,%rax
ret

LLVM IR (-O0):
define i32 @hash_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = mul i64 %4, 2654404609
%6 = lshr i64 %5, 24
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @hash_32(i32 %0) {
%2 = sext i32 %0 to i64
%3 = mul nsw i64 %2, 2654404609
%4 = lshr i64 %3, 24
%5 = trunc i64 %4 to i32
ret i32 %5
}
void enable_interrupts() { asm("sti"); }


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

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

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

LLVM IR (-O2):
define void @enable_interrupts() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int test_imm_86int32_reg(int val) { return ((val) & (0x86 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_86int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x86,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_86int32_reg>:
test   $0x86,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_86int32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 134
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_86int32_reg(i32 %0) {
%2 = and i32 %0, 134
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ file_close();
void reader_txt_close(void) { file_close(); }


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

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

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

LLVM IR (-O2):
define void @reader_txt_close() {
%1 = tail call i32 (...) @file_close()
ret void
}
volatile char *build_mfence(volatile char *tgt_addr) {
  (*(short *)tgt_addr) = 0xae0f;
  tgt_addr += 0x2;
  (*tgt_addr++) = 0xf0;
  return (tgt_addr);
}


x86 assembly (clang, -O0):
<build_mfence>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movw   $0xae0f,(%rax)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0xf0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_mfence>:
movw   $0xae0f,(%rdi)
movb   $0xf0,0x2(%rdi)
lea    0x3(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @build_mfence(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i16*
store i16 -20977, i16* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 2
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %2
store volatile i8 -16, i8* %7
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
define i8* @build_mfence(i8* %0) {
%2 = bitcast i8* %0 to i16*
store i16 -20977, i16* %2
%3 = getelementptr inbounds i8, i8* %0, i64 2
%4 = getelementptr inbounds i8, i8* %0, i64 3
store volatile i8 -16, i8* %3
ret i8* %4
}
int linear_search(int *a, int n, int key) {
  int i;
  for (i = 0; i < n; i++) {
    if (*(a + i) == key)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<linear_search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <linear_search+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <linear_search+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <linear_search+0x5a>
jmp    1145 <linear_search+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <linear_search+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_search>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <linear_search+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <linear_search+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <linear_search+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @linear_search(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
OP(op, d6) { SUB(ARG()); }


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

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <ARG@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <SUB@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @ARG()
%7 = call i32 (i32, ...) bitcast (i32 (...)* @SUB to i32 (i32, ...)*)(i32 %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @ARG()
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @SUB to i32 (i32, ...)*)(i32 %3)
ret i32 undef
}
__attribute__((always_)) void flush_dcache_page(struct page *page) {}


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define void @flush_dcache_page(%struct.page* nocapture %0) {
ret void
}
/* Variables and functions */
double atof(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
void main() {
  char a[10];
  char *s = a;
  printf("Enter the string to be converted to float.\n");
  scanf("%s", s);
  double x = atof(s);
  printf("\n%f\n", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0xa(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xed3(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xeb7(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rdi
lea    0x6(%rsp),%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1040 <atof@plt>
lea    0xe8f(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Enter the string to be converted to float.\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [5 x i8] c"\0A%f\0A\00"
define void @main() {
%1 = alloca [10 x i8]
%2 = alloca i8*
%3 = alloca double
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
store i8* %4, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %2
%9 = call double @atof(i8* %8)
store double %9, double* %3
%10 = load double, double* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %10)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [5 x i8] c"\0A%f\0A\00"
@str = [43 x i8] c"Enter the string to be converted to float.\00"
define void @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call double @atof(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %5)
ret void
}
int main(void) {
  int *p;
  if (1) {
    int a[10];
    p = a;
  }
  p[0] = 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = alloca [10 x i32]
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = getelementptr inbounds i32, i32* %4, i64 0
store i32 1, i32* %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ set_random_matrix();
int main(void) {
  set_random_matrix();
  printf("\n");
  exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <set_random_matrix@plt>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <set_random_matrix@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @set_random_matrix()
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void VP8LEncDspInitMIPSdspR2(void) {}


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

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

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

LLVM IR (-O2):
define void @VP8LEncDspInitMIPSdspR2() {
ret void
}
/* Variables and functions */
scalar_t__ round(double);
unsigned long long test1(double x) { return (unsigned long long)round(x); }


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

x86 assembly (clang, -O2):
<test1>:
jmp    1030 <round@plt>

LLVM IR (-O0):
define i64 @test1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @round(double %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @test1(double %0) {
%2 = tail call i64 @round(double %0)
ret i64 %2
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t my_bswap64(uint64_t x) {
  uint64_t result = 0;
  int shift;
  for (shift = 0; shift < 8 * sizeof(uint64_t); shift += 8) {
    result <<= 8;
    result |= (x >> shift) & 0xff;
  }
  return result;
}


x86 assembly (clang, -O0):
<my_bswap64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x20,%rax
jae    114d <my_bswap64+0x4d>
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
and    $0xff,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <my_bswap64+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @my_bswap64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %18, %1
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = icmp ult i64 %7, 32
br i1 %8, label %9, label %21
9: ; preds = %5
%10 = load i32, i32* %3
%11 = shl i32 %10, 8
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %4
%14 = ashr i32 %12, %13
%15 = and i32 %14, 255
%16 = load i32, i32* %3
%17 = or i32 %16, %15
store i32 %17, i32* %3
br label %18
18: ; preds = %9
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 8
store i32 %20, i32* %4
br label %5
21: ; preds = %5
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @my_bswap64(i32 %0) {
%2 = call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
int band(int a, int b) { return a & b; }


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

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

LLVM IR (-O0):
define i32 @band(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 = and i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @band(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
unsigned char port_io_read_byte(unsigned short port) {
  unsigned char data = 0;
  __asm__("in %%dx, %%al" : "=a"(data) : "d"(port));
  return data;
}


x86 assembly (clang, -O0):
<port_io_read_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movb   $0x0,-0x3(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<port_io_read_byte>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @port_io_read_byte(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
store i8 0, i8* %3
%4 = load i16, i16* %2
%5 = call i8 asm "in %dx, %al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @port_io_read_byte(i16 zeroext %0) {
%2 = tail call i8 asm "in %dx, %al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
int gcd(int i, int j) { return j ? gcd(j, i % j) : i; }


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1141 <gcd+0x31>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0xc(%rbp)
jmp    1147 <gcd+0x37>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gcd(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = srem i32 %9, %10
%12 = call i32 @gcd(i32 %8, i32 %11)
br label %15
13: ; preds = %2
%14 = load i32, i32* %3
br label %15
15: ; preds = %13, %7
%16 = phi i32 [ %12, %7 ], [ %14, %13 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ _asm(char *);
char OS_DI(void) {
  _asm("  push    CC  ");
  _asm("  sim         ");
  _asm("  pop     A   ");
}


x86 assembly (clang, -O0):
<OS_DI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <_asm@plt>
lea    0xee4(%rip),%rdi
call   1030 <_asm@plt>
lea    0xee7(%rip),%rdi
call   1030 <_asm@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OS_DI>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <_asm@plt>
lea    0xeeb(%rip),%rdi
call   1030 <_asm@plt>
lea    0xeee(%rip),%rdi
pop    %rax
jmp    1030 <_asm@plt>

LLVM IR (-O0):
@.str = [15 x i8] c" push CC \00"
@.str.1 = [15 x i8] c" sim \00"
@.str.2 = [15 x i8] c" pop A \00"
define signext i8 @OS_DI() {
%1 = alloca i8
%2 = call i32 @_asm(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @_asm(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @_asm(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%5 = load i8, i8* %1
ret i8 %5
}

LLVM IR (-O2):
@.str = [15 x i8] c" push CC \00"
@.str.1 = [15 x i8] c" sim \00"
@.str.2 = [15 x i8] c" pop A \00"
define signext i8 @OS_DI() {
%1 = tail call i32 @_asm(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @_asm(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @_asm(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret i8 undef
}
int do_751() { return 751; }


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

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

LLVM IR (-O0):
define i32 @do_751() {
ret i32 751
}

LLVM IR (-O2):
define i32 @do_751() {
ret i32 751
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun5ab1() {
  printf("func5ab1 is called!\n");
  printf("func5ab1 is ended.\n");
}


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

x86 assembly (clang, -O2):
<fun5ab1>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [20 x i8] c"func5ab1 is called!\00"
@str.2 = [19 x i8] c"func5ab1 is ended.\00"
define void @fun5ab1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wait(int /*<<< orphan*/);
waiter() { wait(0); }


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

x86 assembly (clang, -O2):
<waiter>:
xor    %edi,%edi
jmp    1030 <wait@plt>

LLVM IR (-O0):
define i32 @waiter() {
%1 = alloca i32
%2 = call i32 @wait(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @waiter() {
%1 = tail call i32 @wait(i32 0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Atom;

/* Variables and functions */
int /*<<< orphan*/ XA_CARDINAL;
int x_set_property(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                   int, unsigned long const *, int);
int x_set_cardinal_property(Window window, Atom property,
                            const unsigned long *prop, int nr) {
  return x_set_property(window, XA_CARDINAL, property, 32, prop, nr);
}


x86 assembly (clang, -O0):
<x_set_cardinal_property>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%r8
mov    -0x14(%rbp),%r9d
mov    $0x20,%ecx
call   1030 <x_set_property@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_set_cardinal_property>:
mov    %ecx,%r9d
mov    %rdx,%r8
mov    %esi,%edx
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    $0x20,%ecx
jmp    1030 <x_set_property@plt>

LLVM IR (-O0):
@XA_CARDINAL = global i32 0
define i32 @x_set_cardinal_property(i32 %0, i32 %1, i64* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i64* %2, i64** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* @XA_CARDINAL
%11 = load i32, i32* %6
%12 = load i64*, i64** %7
%13 = load i32, i32* %8
%14 = call i32 @x_set_property(i32 %9, i32 %10, i32 %11, i32 32, i64* %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
@XA_CARDINAL = global i32 0
define i32 @x_set_cardinal_property(i32 %0, i32 %1, i64* %2, i32 %3) {
%5 = load i32, i32* @XA_CARDINAL
%6 = tail call i32 @x_set_property(i32 %0, i32 %5, i32 %1, i32 32, i64* %2, i32 %3)
ret i32 %6
}