xunge/DecIR huggingface dataset:
void initButtons() {
  unsigned int *dir = ((unsigned int *)0x50038000);
  *dir = 0x0;
}


x86 assembly (clang, -O0):
<initButtons>:
push   %rbp
mov    %rsp,%rbp
mov    $0x50038000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initButtons>:
movl   $0x0,0x50038000
ret

LLVM IR (-O0):
define void @initButtons() {
%1 = alloca i32*
store i32* inttoptr (i64 1342406656 to i32*), i32** %1
%2 = load i32*, i32** %1
store i32 0, i32* %2
ret void
}

LLVM IR (-O2):
define void @initButtons() {
store i32 0, i32* inttoptr (i64 1342406656 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void acsii_art_wds(void) {
  print("       _.-;;-._\n'-..-'|   ||   |\n'-..-'|_.-;;-._|\n'-..-'|   ||   "
        "|\n'-..-'|_.-''-._|\n");
}


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

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

LLVM IR (-O0):
@.str = [85 x i8] c" _.-;;-._\0A'-..-'| || |\0A'-..-'|_.-;;-._|\0A'-..-'| || |\0A'-..-'|_.-''-._|\0A\00"
define void @acsii_art_wds() {
%1 = call i32 @print(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [85 x i8] c" _.-;;-._\0A'-..-'| || |\0A'-..-'|_.-;;-._|\0A'-..-'| || |\0A'-..-'|_.-''-._|\0A\00"
define void @acsii_art_wds() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0))
ret void
}
int s(int a, int b) { return -b; }


x86 assembly (clang, -O0):

:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):

:
mov    %esi,%eax
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @s(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %1
ret i32 %3
}
/* Variables and functions */
int yyparse();
int main(int argc, char *argv[]) { return yyparse(); }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @yyparse()
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @yyparse()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, int, size_t, int);
int strerror_r(int, char *, size_t);
char *str_error_r(int errnum, char *buf, size_t buflen) {
  int err = strerror_r(errnum, buf, buflen);
  if (err)
    snprintf(buf, buflen, "INTERNAL ERROR: strerror_r(%d, [buf], %zd)=%d",
             errnum, buflen, err);
  return buf;
}


x86 assembly (clang, -O0):
<str_error_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <strerror_r@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     116f <str_error_r+0x4f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x4(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
lea    0xe96(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_error_r>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <strerror_r@plt>
test   %eax,%eax
je     114f <str_error_r+0x2f>
lea    0xec4(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%ecx
mov    %r14,%r8
mov    %eax,%r9d
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [46 x i8] c"INTERNAL ERROR: strerror_r(%d, [buf], %zd)=%d\00"
define i8* @str_error_r(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @strerror_r(i32 %8, i8* %9, i64 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = load i32, i32* %4
%18 = load i64, i64* %6
%19 = load i32, i32* %7
%20 = call i32 @snprintf(i8* %15, i64 %16, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %17, i64 %18, i32 %19)
br label %21
21: ; preds = %14, %3
%22 = load i8*, i8** %5
ret i8* %22
}

LLVM IR (-O2):
@.str = [46 x i8] c"INTERNAL ERROR: strerror_r(%d, [buf], %zd)=%d\00"
define i8* @str_error_r(i32 %0, i8* returned %1, i64 %2) {
%4 = tail call i32 @strerror_r(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @snprintf(i8* %1, i64 %2, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %0, i64 %2, i32 %4)
br label %8
8: ; preds = %6, %3
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __get_FPSCR(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @__get_FPSCR() {
ret i32 0
}
int get_minor_version(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @get_minor_version() {
ret i32 2
}

LLVM IR (-O2):
define i32 @get_minor_version() {
ret i32 2
}
void gtk_container_add() {}


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

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

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

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

/* Variables and functions */
uint16_t gffi_get_uint_16_swapped(uint8_t *location, int offset) {
  uint8_t buf[2];
  buf[1] = location[offset];
  buf[0] = location[offset + 1];
  return *(uint16_t *)buf;
}


x86 assembly (clang, -O0):
<gffi_get_uint_16_swapped>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gffi_get_uint_16_swapped>:
movslq %esi,%rax
mov    0x4(%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @gffi_get_uint_16_swapped(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca [2 x i32]
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = load i32, i32* %9
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %10, i32* %11
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %12, i64 %15
%17 = load i32, i32* %16
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %17, i32* %18
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%20 = load i32, i32* %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @gffi_get_uint_16_swapped(i32* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ port_byte_out(int, unsigned char);
void screen_cursor_to(unsigned int row, unsigned int col) {
  unsigned short position = (row * 80) + col;
  port_byte_out(0x3D4, 0x0F);
  port_byte_out(0x3D5, (unsigned char)(position & 0xFF));
  port_byte_out(0x3D4, 0x0E);
  port_byte_out(0x3D5, (unsigned char)((position >> 8) & 0xFF));
}


x86 assembly (clang, -O0):
<screen_cursor_to>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x50,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %ax,-0xa(%rbp)
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <port_byte_out@plt>
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <port_byte_out@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <port_byte_out@plt>
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <port_byte_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_cursor_to>:
push   %rbx
lea    (%rdi,%rdi,4),%ebx
shl    $0x4,%ebx
add    %esi,%ebx
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <port_byte_out@plt>
movzbl %bl,%esi
mov    $0x3d5,%edi
call   1030 <port_byte_out@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <port_byte_out@plt>
movzbl %bh,%esi
mov    $0x3d5,%edi
pop    %rbx
jmp    1030 <port_byte_out@plt>

LLVM IR (-O0):
define void @screen_cursor_to(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul i32 %6, 80
%8 = load i32, i32* %4
%9 = add i32 %7, %8
%10 = trunc i32 %9 to i16
store i16 %10, i16* %5
%11 = call i32 @port_byte_out(i32 980, i8 zeroext 15)
%12 = load i16, i16* %5
%13 = zext i16 %12 to i32
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = call i32 @port_byte_out(i32 981, i8 zeroext %15)
%17 = call i32 @port_byte_out(i32 980, i8 zeroext 14)
%18 = load i16, i16* %5
%19 = zext i16 %18 to i32
%20 = ashr i32 %19, 8
%21 = and i32 %20, 255
%22 = trunc i32 %21 to i8
%23 = call i32 @port_byte_out(i32 981, i8 zeroext %22)
ret void
}

LLVM IR (-O2):
define void @screen_cursor_to(i32 %0, i32 %1) {
%3 = mul i32 %0, 80
%4 = add i32 %3, %1
%5 = tail call i32 @port_byte_out(i32 980, i8 zeroext 15)
%6 = trunc i32 %4 to i8
%7 = tail call i32 @port_byte_out(i32 981, i8 zeroext %6)
%8 = tail call i32 @port_byte_out(i32 980, i8 zeroext 14)
%9 = lshr i32 %4, 8
%10 = trunc i32 %9 to i8
%11 = tail call i32 @port_byte_out(i32 981, i8 zeroext %10)
ret void
}
void nl2sp(char *p) {
  while (*p != 0) {
    if (*p == '\n' || *p == '\r')
      *p = ' ';
    p++;
  }
}


x86 assembly (clang, -O0):
<nl2sp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1150 <nl2sp+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1138 <nl2sp+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    113f <nl2sp+0x3f>
mov    -0x8(%rbp),%rax
movb   $0x20,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <nl2sp+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nl2sp>:
jmp    1117 <nl2sp+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x20,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0xa,%al
je     1110 <nl2sp+0x10>
cmp    $0xd,%al
je     1110 <nl2sp+0x10>
test   %al,%al
jne    1113 <nl2sp+0x13>
ret

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

LLVM IR (-O2):
define void @nl2sp(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 10, label %5
i8 13, label %5
]
5: ; preds = %2, %2
store i8 32, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
int string_array_len(const char *array[]) {
  int i = 0;
  if (array) {
    while (array[i])
      ++i;
  }
  return i;
}


x86 assembly (clang, -O0):
<string_array_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1145 <string_array_len+0x45>
jmp    111f <string_array_len+0x1f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1140 <string_array_len+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <string_array_len+0x1f>
jmp    1145 <string_array_len+0x45>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_array_len>:
test   %rdi,%rdi
je     111e <string_array_len+0x1e>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <string_array_len+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @string_array_len(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
long long transfer_diff(long long new, long long old) { return new - old; }


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

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

LLVM IR (-O0):
define i64 @transfer_diff(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @transfer_diff(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
ret i64 %3
}
const char *__malidrv_build_info(void) {
  return "malidrv:  CONFIG=aml-meson-m400-2 USING_OS_MEMORY=1 API_VERSION=14 "
         "REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Wed "
         "Aug 15 19:35:59 CST 2012 BUILD=DEBUG CPU= USING_UMP=1 "
         "USING_MALI200=0 USING_MALI400=7 USING_MALI400_L2_CACHE=2 USING_GP2=0 "
         "KDIR= MALI_PLATFORM_FILE=platform/meson_platform/mali_platform.c "
         "platform/meson_platform/mali_fix.c "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=6 USING_PROFILING=0 "
         "USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=";
}


x86 assembly (clang, -O0):
<__malidrv_build_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__malidrv_build_info>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [461 x i8] c"malidrv: CONFIG=aml-meson-m400-2 USING_OS_MEMORY=1 API_VERSION=14 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Wed Aug 15 19:35:59 CST 2012 BUILD=DEBUG CPU= USING_UMP=1 USING_MALI200=0 USING_MALI400=7 USING_MALI400_L2_CACHE=2 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/meson_platform/mali_platform.c platform/meson_platform/mali_fix.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=6 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([461 x i8], [461 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [461 x i8] c"malidrv: CONFIG=aml-meson-m400-2 USING_OS_MEMORY=1 API_VERSION=14 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Wed Aug 15 19:35:59 CST 2012 BUILD=DEBUG CPU= USING_UMP=1 USING_MALI200=0 USING_MALI400=7 USING_MALI400_L2_CACHE=2 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/meson_platform/mali_platform.c platform/meson_platform/mali_fix.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=6 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([461 x i8], [461 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
bool isin(const char c, const char *set) {
  int i = -1;
  while (set[++i] != '\0')
    if (c == set[i])
      return true;
  return false;
}


x86 assembly (clang, -O0):
<isin>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115b <isin+0x5b>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1156 <isin+0x56>
movl   $0x1,-0x4(%rbp)
jmp    1162 <isin+0x62>
jmp    1115 <isin+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isin>:
movzbl (%rsi),%eax
test   %al,%al
je     1116 <isin+0x16>
add    $0x1,%rsi
cmp    %dil,%al
jne    1100 <isin>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isin(i8 signext %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i64 [ %5, %9 ], [ -1, %2 ]
%5 = add nsw i64 %4, 1
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = icmp eq i8 %7, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %9
%12 = phi i32 [ 1, %9 ], [ 0, %3 ]
ret i32 %12
}
/* Variables and functions */
long Driver(long, long);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, long *, long *);
int main(void) {
  long a, b, c;
  printf("Enter two ints\n");
  scanf("%ld%ld", &a, &b);
  c = Driver(a, b);
  printf("The sum is %ld\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <Driver@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xecc(%rip),%rdi
call   1040 <puts@plt>
lea    0xea9(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1060 <scanf@plt>
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
call   1030 <Driver@plt>
lea    0xe8b(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter two ints\0A\00"
@.str.1 = [7 x i8] c"%ld%ld\00"
@.str.2 = [16 x i8] c"The sum is %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64* %2, i64* %3)
%7 = load i64, i64* %2
%8 = load i64, i64* %3
%9 = call i64 @Driver(i64 %7, i64 %8)
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i64 %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%ld%ld\00"
@.str.2 = [16 x i8] c"The sum is %ld\0A\00"
@str = [15 x i8] c"Enter two ints\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64* %1, i64* %2)
%7 = load i64, i64* %1
%8 = load i64, i64* %2
%9 = call i64 @Driver(i64 %7, i64 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i64 %9)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int current_time_monotonic();
uint64_t get_monotime_sec(void) { return current_time_monotonic() / 1000; }


x86 assembly (clang, -O0):
<get_monotime_sec>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <current_time_monotonic@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_monotime_sec>:
push   %rax
xor    %eax,%eax
call   1030 <current_time_monotonic@plt>
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_monotime_sec() {
%1 = call i32 (...) @current_time_monotonic()
%2 = sdiv i32 %1, 1000
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_monotime_sec() {
%1 = tail call i32 (...) @current_time_monotonic()
%2 = sdiv i32 %1, 1000
ret i32 %2
}
int sumatoria(int j) {
  if (j == 0) {
    return j;
  } else {
    return j + sumatoria(j - 1);
  }
}


x86 assembly (clang, -O0):
<sumatoria>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1130 <sumatoria+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <sumatoria+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <sumatoria@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumatoria>:
test   %edi,%edi
je     1119 <sumatoria+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sumatoria(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ rul__msg_print(char *, char *);
void rul__startup(void) {
  rul__msg_print("OBSOLFEAT W Obsolete feature %s",
                 "OPS_STARTUP, replace with call to ENTRY-BLOCK");
}


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

x86 assembly (clang, -O2):
<rul__startup>:
lea    0xee9(%rip),%rdi
lea    0xf02(%rip),%rsi
jmp    1030 <rul__msg_print@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"OBSOLFEAT W Obsolete feature %s\00"
@.str.1 = [46 x i8] c"OPS_STARTUP, replace with call to ENTRY-BLOCK\00"
define void @rul__startup() {
%1 = call i32 @rul__msg_print(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"OBSOLFEAT W Obsolete feature %s\00"
@.str.1 = [46 x i8] c"OPS_STARTUP, replace with call to ENTRY-BLOCK\00"
define void @rul__startup() {
%1 = tail call i32 @rul__msg_print(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int sysfs_create_dir(struct kobject *k) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.kobject = type opaque
define i32 @sysfs_create_dir(%struct.kobject* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ shmat(int, void *, int /*<<< orphan*/);
void *allocate_share_mem(int shmid) {
  int rv = (int)shmat(shmid, (void *)0, 0);
  if (rv == -1) {
    printf("share memory attach fail\n");
    return 0;
  }
  return (void *)rv;
}


x86 assembly (clang, -O0):
<allocate_share_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <shmat@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    115f <allocate_share_mem+0x3f>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x8(%rbp)
jmp    1167 <allocate_share_mem+0x47>
movslq -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate_share_mem>:
push   %rax
xor    %esi,%esi
xor    %edx,%edx
call   1040 <shmat@plt>
cmp    $0xffffffff,%eax
je     1133 <allocate_share_mem+0x13>
cltq
pop    %rcx
ret
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"share memory attach fail\0A\00"
define i8* @allocate_share_mem(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i64 @shmat(i32 %5, i8* null, i32 0)
%7 = trunc i64 %6 to i32
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %2
br label %16
12: ; preds = %1
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %2
br label %16
16: ; preds = %12, %10
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@str = [25 x i8] c"share memory attach fail\00"
define i8* @allocate_share_mem(i32 %0) {
%2 = tail call i64 @shmat(i32 %0, i8* null, i32 0)
%3 = trunc i64 %2 to i32
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %11
7: ; preds = %1
%8 = shl i64 %2, 32
%9 = ashr exact i64 %8, 32
%10 = inttoptr i64 %9 to i8*
br label %11
11: ; preds = %7, %5
%12 = phi i8* [ null, %5 ], [ %10, %7 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ dump(unsigned char *, int);
int /*<<< orphan*/ printf(char *, float);
void test_float(float f) {
  int *fp = (int *)(&f);
  dump((unsigned char *)fp, 4);
  printf(" %f\n", f);
}


x86 assembly (clang, -O0):
<test_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1040 <dump@plt>
movss  -0x4(%rbp),%xmm0
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_float>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1040 <dump@plt>
movss  0x4(%rsp),%xmm0
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c" %f\0A\00"
define void @test_float(float %0) {
%2 = alloca float
%3 = alloca i32*
store float %0, float* %2
%4 = bitcast float* %2 to i32*
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = bitcast i32* %5 to i8*
%7 = call i32 @dump(i8* %6, i32 4)
%8 = load float, float* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %8)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" %f\0A\00"
define void @test_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = bitcast float* %2 to i8*
%4 = call i32 @dump(i8* %3, i32 4)
%5 = load float, float* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %5)
ret void
}
int main() {
  float f1, f2;
  f1 = divide_by_10("hello");
  f2 = divide_by_10(31);
  printf("f1=%f; f2=%f\n", f1, f2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <divide_by_10@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    $0x1f,%edi
mov    $0x0,%al
call   1040 <divide_by_10@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe92(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <divide_by_10@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x4(%rsp)
mov    $0x1f,%edi
xor    %eax,%eax
call   1040 <divide_by_10@plt>
cvtsi2ss %eax,%xmm1
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
lea    0xea8(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [14 x i8] c"f1=%f; f2=%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @divide_by_10 to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = sitofp i32 %4 to float
store float %5, float* %2
%6 = call i32 (i32, ...) bitcast (i32 (...)* @divide_by_10 to i32 (i32, ...)*)(i32 31)
%7 = sitofp i32 %6 to float
store float %7, float* %3
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %9, double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [14 x i8] c"f1=%f; f2=%f\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @divide_by_10 to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = sitofp i32 %1 to float
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @divide_by_10 to i32 (i32, ...)*)(i32 31)
%4 = sitofp i32 %3 to float
%5 = fpext float %2 to double
%6 = fpext float %4 to double
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %5, double %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ w;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fwrite(char const *, int, int, int /*<<< orphan*/ *);
int putw(int w, register FILE *fp) {
  if (fwrite((const char *)&w, sizeof(w), 1, fp) != 1)
    return EOF;
  return 0;
}


x86 assembly (clang, -O0):
<putw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
cmp    $0x1,%eax
je     1150 <putw+0x40>
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <putw+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putw>:
push   %rax
mov    %rsi,%rcx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
je     113e <putw+0x2e>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @putw(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = bitcast i32* %4 to i8*
%7 = load i32*, i32** %5
%8 = call i32 @fwrite(i8* %6, i32 4, i32 1, i32* %7)
%9 = icmp ne i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* @EOF
store i32 %11, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @putw(i32 %0, i32* nocapture %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = bitcast i32* %3 to i8*
%5 = call i32 @fwrite(i8* %4, i32 4, i32 1, i32* %1)
%6 = icmp eq i32 %5, 1
%7 = load i32, i32* @EOF
%8 = select i1 %6, i32 0, i32 %7
ret i32 %8
}
unsigned int uart1_getc(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @uart1_getc() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fatal(char *, int /*<<< orphan*/);
void *realloc(void *, size_t);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void *cli_realloc(void *ptr, size_t len) {
  void *nptr;
  if ((nptr = realloc(ptr, len)) == NULL)
    fatal("realloc: %s", strerror(errno));
  return (nptr);
}


x86 assembly (clang, -O0):
<cli_realloc>:
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 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1177 <cli_realloc+0x47>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    %eax,%esi
lea    0xe8e(%rip),%rdi
call   1050 <fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_realloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115a <cli_realloc+0x2a>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1050 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"realloc: %s\00"
@errno = global i32 0
define i8* @cli_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* @errno
%12 = call i32 @strerror(i32 %11)
%13 = call i32 @fatal(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %10, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [12 x i8] c"realloc: %s\00"
@errno = global i32 0
define noalias i8* @cli_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i32 @strerror(i32 %6)
%8 = tail call i32 @fatal(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %5, %2
ret i8* %3
}
unsigned int hashmap_hash(const char *str) {
  int i;
  unsigned int result = 5381;
  for (i = 0; str[i] != '\0'; i++) {
    result = result * 33 + str[i];
  }
  result = result ^ (result >> 16);
  return result % 10007;
}


x86 assembly (clang, -O0):
<hashmap_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114e <hashmap_hash+0x4e>
imul   $0x21,-0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <hashmap_hash+0x16>
mov    -0x10(%rbp),%eax
mov    -0x10(%rbp),%ecx
shr    $0x10,%ecx
xor    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x2717,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashmap_hash>:
mov    (%rdi),%al
test   %al,%al
je     1139 <hashmap_hash+0x39>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%eax
shl    $0x5,%ecx
add    %edx,%ecx
add    %eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
mov    %ecx,%edx
test   %al,%al
jne    1120 <hashmap_hash+0x20>
jmp    113e <hashmap_hash+0x3e>
mov    $0x1505,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
xor    %ecx,%eax
imul   $0x68c8c4ad,%rax,%rcx
shr    $0x2c,%rcx
imul   $0x2717,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hashmap_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 5381, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %23, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %26
13: ; preds = %5
%14 = load i32, i32* %4
%15 = mul i32 %14, 33
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = add i32 %15, %21
store i32 %22, i32* %4
br label %23
23: ; preds = %13
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %5
26: ; preds = %5
%27 = load i32, i32* %4
%28 = load i32, i32* %4
%29 = lshr i32 %28, 16
%30 = xor i32 %27, %29
store i32 %30, i32* %4
%31 = load i32, i32* %4
%32 = urem i32 %31, 10007
ret i32 %32
}

LLVM IR (-O2):
define i32 @hashmap_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 5381, %1 ]
%8 = sext i8 %6 to i32
%9 = mul i32 %7, 33
%10 = add i32 %9, %8
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 5381, %1 ], [ %10, %4 ]
%17 = lshr i32 %16, 16
%18 = xor i32 %17, %16
%19 = urem i32 %18, 10007
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ CtpForwardingEngineP__0__UnicastNameFreeRouting__noRoute();
void CtpRoutingEngineP__0__Routing__noRoute(void) {
  CtpForwardingEngineP__0__UnicastNameFreeRouting__noRoute();
}


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

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

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

LLVM IR (-O2):
define void @CtpRoutingEngineP__0__Routing__noRoute() {
%1 = tail call i32 (...) @CtpForwardingEngineP__0__UnicastNameFreeRouting__noRoute()
ret void
}
int anyEvenBit(int x) {
  int y = 0x55555555;
  return !!(x & y);
}


x86 assembly (clang, -O0):
<anyEvenBit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x55555555,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<anyEvenBit>:
xor    %eax,%eax
test   $0x55555555,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @anyEvenBit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1431655765, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = and i32 %4, %5
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @anyEvenBit(i32 %0) {
%2 = and i32 %0, 1431655765
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ begin();
int start(void) {
  begin();
  return (1000);
}


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

x86 assembly (clang, -O2):
<start>:
push   %rax
xor    %eax,%eax
call   1030 <begin@plt>
mov    $0x3e8,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @start() {
%1 = call i32 (...) @begin()
ret i32 1000
}

LLVM IR (-O2):
define i32 @start() {
%1 = tail call i32 (...) @begin()
ret i32 1000
}
/* Type definitions */
struct item {
  int dummy;
};

/* Variables and functions */
int is_empty(struct item *it) {
  if (it == NULL)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <is_empty+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1126 <is_empty+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
%struct.item = type { i32 }
define i32 @is_empty(%struct.item* %0) {
%2 = alloca i32
%3 = alloca %struct.item*
store %struct.item* %0, %struct.item** %3
%4 = load %struct.item*, %struct.item** %3
%5 = icmp eq %struct.item* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
%struct.item = type { i32 }
define i32 @is_empty(%struct.item* readnone %0) {
%2 = icmp eq %struct.item* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
unsigned char inportb(unsigned int);
unsigned char inb(unsigned int port) { return inportb(port); }


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

x86 assembly (clang, -O2):
<inb>:
jmp    1030 <inportb@plt>

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

LLVM IR (-O2):
define zeroext i8 @inb(i32 %0) {
%2 = tail call zeroext i8 @inportb(i32 %0)
ret i8 %2
}
/* Variables and functions */
scalar_t__ _get_sysfs_numeric(char *, char *, int *);
int get_sysfs_int(char *sysfs_attr) {
  int number = -1;
  if (_get_sysfs_numeric(sysfs_attr, "%d", &number) == 0)
    return number;
  else
    return ((int)-1);
}


x86 assembly (clang, -O0):
<get_sysfs_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed2(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <_get_sysfs_numeric@plt>
cmp    $0x0,%rax
jne    114c <get_sysfs_int+0x3c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <get_sysfs_int+0x43>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sysfs_int>:
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
lea    0xee0(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <_get_sysfs_numeric@plt>
neg    %rax
sbb    %eax,%eax
or     0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @get_sysfs_int(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 -1, i32* %2
%4 = call i64 @_get_sysfs_numeric(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = icmp eq i64 %4, 0
%6 = load i32, i32* %2
%7 = select i1 %5, i32 %6, i32 -1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, unsigned int);
void *copy_return_next(void *dst, void *src, unsigned int src_len) {
  memcpy(dst, src, src_len);
  dst = (char *)dst + src_len;
  return dst;
}


x86 assembly (clang, -O0):
<copy_return_next>:
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
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_return_next>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rdi,%r14
call   1030 <memcpy@plt>
mov    %ebx,%eax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @copy_return_next(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 @memcpy(i8* %7, i8* %8, i32 %9)
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8* %14, i8** %4
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @copy_return_next(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
%5 = zext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
ret i8* %6
}