xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ ofl_message_type_print(int /*<<< orphan*/ *,
                                          int /*<<< orphan*/);
int /*<<< orphan*/ *open_memstream(char **, size_t *);
char *ofl_message_type_to_string(uint16_t type) {
  char *str;
  size_t str_size;
  FILE *stream = open_memstream(&str, &str_size);
  ofl_message_type_print(stream, type);
  fclose(stream);
  return str;
}


x86 assembly (clang, -O0):
<ofl_message_type_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <open_memstream@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1050 <ofl_message_type_print@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ofl_message_type_to_string>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebp
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <open_memstream@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1050 <ofl_message_type_print@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x8(%rsp),%rax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @ofl_message_type_to_string(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32*
store i32 %0, i32* %2
%6 = call i32* @open_memstream(i8** %3, i64* %4)
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = load i32, i32* %2
%9 = call i32 @ofl_message_type_print(i32* %7, i32 %8)
%10 = load i32*, i32** %5
%11 = call i32 @fclose(i32* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @ofl_message_type_to_string(i32 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = bitcast i8** %2 to i8*
%5 = bitcast i64* %3 to i8*
%6 = call i32* @open_memstream(i8** %2, i64* %3)
%7 = call i32 @ofl_message_type_print(i32* %6, i32 %0)
%8 = call i32 @fclose(i32* %6)
%9 = load i8*, i8** %2
ret i8* %9
}
/* Variables and functions */
int f2(int *);
int f3(int *p) { return f2(p); }


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

x86 assembly (clang, -O2):
<f3>:
jmp    1030 <f2@plt>

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

LLVM IR (-O2):
define i32 @f3(i32* %0) {
%2 = tail call i32 @f2(i32* %0)
ret i32 %2
}
/* Variables and functions */
char *strstr(char *, char *);
int indeks_slowa(char *slowo, char *linia) {
  char *addr = strstr(linia, slowo);
  if (addr == NULL)
    return -1;
  else
    return addr - linia;
}


x86 assembly (clang, -O0):
<indeks_slowa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1148 <indeks_slowa+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <indeks_slowa+0x46>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indeks_slowa>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @indeks_slowa(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = call i8* @strstr(i8* %7, i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %20
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = load i8*, i8** %5
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
store i32 %19, i32* %3
br label %20
20: ; preds = %13, %12
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @indeks_slowa(i8* nocapture %0, i8* %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %1, i8* dereferenceable(1) %0)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %1 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
int fromHexDigit(char c) {
  if ('a' < c)
    return c - 'a' + 10;
  else if ('A' < c)
    return c - 'A' + 10;
  else if ('0' < c)
    return c - '0';
  else
    return -1;
}


x86 assembly (clang, -O0):
<fromHexDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jge    112d <fromHexDigit+0x2d>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <fromHexDigit+0x77>
movsbl -0x5(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jge    1150 <fromHexDigit+0x50>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <fromHexDigit+0x77>
movsbl -0x5(%rbp),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jge    1170 <fromHexDigit+0x70>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <fromHexDigit+0x77>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fromHexDigit>:
mov    %edi,%eax
cmp    $0x62,%al
jl     110a <fromHexDigit+0xa>
add    $0xffffffa9,%eax
ret
cmp    $0x42,%al
jl     1112 <fromHexDigit+0x12>
add    $0xffffffc9,%eax
ret
mov    %eax,%ecx
add    $0xffffffd0,%ecx
cmp    $0x31,%al
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @fromHexDigit(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = icmp sgt i8 %0, 97
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = add nsw i32 %2, -87
br label %14
6: ; preds = %1
%7 = icmp sgt i8 %0, 65
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = add nsw i32 %2, -55
br label %14
10: ; preds = %6
%11 = icmp sgt i8 %0, 48
%12 = add nsw i32 %2, -48
%13 = select i1 %11, i32 %12, i32 -1
br label %14
14: ; preds = %10, %8, %4
%15 = phi i32 [ %5, %4 ], [ %9, %8 ], [ %13, %10 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ crack_wpa(char *);
int /*<<< orphan*/ print_usage(char *);
int main(int argc, char **argv) {
  if (argc == 2)
    crack_wpa(argv[1]);
  else
    print_usage(argv[0]);
  return 0;
}


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)
cmpl   $0x2,-0x8(%rbp)
jne    1152 <main+0x32>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <crack_wpa@plt>
jmp    115e <main+0x3e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <print_usage@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1131 <main+0x11>
mov    0x8(%rsi),%rdi
call   1030 <crack_wpa@plt>
jmp    1139 <main+0x19>
mov    (%rsi),%rdi
call   1040 <print_usage@plt>
xor    %eax,%eax
pop    %rcx
ret

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 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @crack_wpa(i8* %11)
br label %18
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = call i32 @print_usage(i8* %16)
br label %18
18: ; preds = %13, %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @crack_wpa(i8* %6)
br label %11
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = tail call i32 @print_usage(i8* %9)
br label %11
11: ; preds = %8, %4
ret i32 0
}
/* Variables and functions */
int g0();
int g1(int);
int g2(int, int);
int g3(int, int, int);
int g4(int, int, int, int);
int main(void) {
  return g0() + g1(1) + g2(1, 2) + g3(1, 2, 3) + g4(1, 2, 3, 4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <g0@plt>
mov    %eax,-0x14(%rbp)
mov    $0x1,%edi
call   1030 <g1@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1070 <g2@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <g3@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1050 <g4@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <g0@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <g1@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x1,%edi
mov    $0x2,%esi
call   1070 <g2@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <g3@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1050 <g4@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @g0()
%3 = call i32 @g1(i32 1)
%4 = add nsw i32 %2, %3
%5 = call i32 @g2(i32 1, i32 2)
%6 = add nsw i32 %4, %5
%7 = call i32 @g3(i32 1, i32 2, i32 3)
%8 = add nsw i32 %6, %7
%9 = call i32 @g4(i32 1, i32 2, i32 3, i32 4)
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @g0()
%2 = tail call i32 @g1(i32 1)
%3 = add nsw i32 %2, %1
%4 = tail call i32 @g2(i32 1, i32 2)
%5 = add nsw i32 %3, %4
%6 = tail call i32 @g3(i32 1, i32 2, i32 3)
%7 = add nsw i32 %5, %6
%8 = tail call i32 @g4(i32 1, i32 2, i32 3, i32 4)
%9 = add nsw i32 %7, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ box_unsigned_cell(int /*<<< orphan*/);
int /*<<< orphan*/ dpop();
int /*<<< orphan*/ object_size(int /*<<< orphan*/);
void primitive_size_impl(void) { box_unsigned_cell(object_size(dpop())); }


x86 assembly (clang, -O0):
<primitive_size_impl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <dpop@plt>
mov    %eax,%edi
call   1040 <object_size@plt>
mov    %eax,%edi
call   1030 <box_unsigned_cell@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_size_impl>:
push   %rax
xor    %eax,%eax
call   1050 <dpop@plt>
mov    %eax,%edi
call   1040 <object_size@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <box_unsigned_cell@plt>

LLVM IR (-O0):
define void @primitive_size_impl() {
%1 = call i32 (...) @dpop()
%2 = call i32 @object_size(i32 %1)
%3 = call i32 @box_unsigned_cell(i32 %2)
ret void
}

LLVM IR (-O2):
define void @primitive_size_impl() {
%1 = tail call i32 (...) @dpop()
%2 = tail call i32 @object_size(i32 %1)
%3 = tail call i32 @box_unsigned_cell(i32 %2)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ result;

/* Variables and functions */
uint32_t char_array_to_value(char *buffer) {
  uint32_t result = 0;
  for (int i = 0; i < sizeof(result); ++i)
    result |= ((((uint32_t)(buffer[i])) & (0xFF)) << (i * 8));
  return result;
}


x86 assembly (clang, -O0):
<char_array_to_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movslq -0x10(%rbp),%rax
cmp    $0x4,%rax
jae    1151 <char_array_to_value+0x51>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
and    $0xff,%eax
mov    -0x10(%rbp),%ecx
shl    $0x3,%ecx
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <char_array_to_value+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @char_array_to_value(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %12, %8
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %17, %13
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dhf(void *b) { printf("Unknown digest received\n"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Unknown digest received\0A\00"
define void @dhf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"Unknown digest received\00"
define void @dhf(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct semaphore {
  int dummy;
};

/* Variables and functions */
int futex_down_timeout_fairness(struct semaphore *, int /*<<< orphan*/ *, int);
int futex_down_fair(struct semaphore *sem) {
  return futex_down_timeout_fairness(sem, NULL, 1);
}


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

x86 assembly (clang, -O2):
<futex_down_fair>:
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <futex_down_timeout_fairness@plt>

LLVM IR (-O0):
%struct.semaphore = type { i32 }
define i32 @futex_down_fair(%struct.semaphore* %0) {
%2 = alloca %struct.semaphore*
store %struct.semaphore* %0, %struct.semaphore** %2
%3 = load %struct.semaphore*, %struct.semaphore** %2
%4 = call i32 @futex_down_timeout_fairness(%struct.semaphore* %3, i32* null, i32 1)
ret i32 %4
}

LLVM IR (-O2):
%struct.semaphore = type { i32 }
define i32 @futex_down_fair(%struct.semaphore* %0) {
%2 = tail call i32 @futex_down_timeout_fairness(%struct.semaphore* %0, i32* null, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int A, B;
  scanf("%d %d", &A, &B);
  printf("A=%d\nB=%d\nA/B=%d.4\n", A, B, A / B);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%ecx
mov    %esi,%eax
cltd
idiv   %ecx
lea    0xebe(%rip),%rdi
mov    %ecx,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [20 x i8] c"A=%d\0AB=%d\0AA/B=%d.4\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = sdiv i32 %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [20 x i8] c"A=%d\0AB=%d\0AA/B=%d.4\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = sdiv i32 %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int sprintf(char *, char *, float);
char *float2s(char buffer[], float value) {
  if (sprintf(buffer, "%g", value) < 1)
    return ((char *)NULL);
  return (buffer);
}


x86 assembly (clang, -O0):
<float2s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
movss  -0x14(%rbp),%xmm0
lea    0xecf(%rip),%rsi
call   1030 <sprintf@plt>
cmp    $0x1,%eax
jge    114c <float2s+0x3c>
movq   $0x0,-0x8(%rbp)
jmp    1154 <float2s+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float2s>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <sprintf@plt>
xor    %ecx,%ecx
test   %eax,%eax
cmovg  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%g\00"
define i8* @float2s(i8* writeonly %0, float %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %1)
%4 = icmp slt i32 %3, 1
%5 = select i1 %4, i8* null, i8* %0
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void exitfunc2(void) {
  printf("Executing exitfunc2.\n");
  exit(0);
}


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"Executing exitfunc2.\00"
define void @exitfunc2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int bits_per_byte(void) {
  unsigned char c = 1;
  int i = 0;
  while (c) {
    c <<= 1;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<bits_per_byte>:
push   %rbp
mov    %rsp,%rbp
movb   $0x1,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1131 <bits_per_byte+0x31>
movzbl -0x1(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x1(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110f <bits_per_byte+0xf>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @bits_per_byte() {
ret i32 8
}
/* Variables and functions */
char *malloc(int);
int strlen(char *);
void testOffsetPassedToStrlen() {
  char *string = malloc(sizeof(char) * 10);
  string += 1;
  int length = strlen(string);
}


x86 assembly (clang, -O0):
<testOffsetPassedToStrlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testOffsetPassedToStrlen>:
push   %rax
mov    $0xa,%edi
call   1040 <malloc@plt>
lea    0x1(%rax),%rdi
pop    %rax
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define void @testOffsetPassedToStrlen() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i8* @malloc(i32 10)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %2
ret void
}

LLVM IR (-O2):
define void @testOffsetPassedToStrlen() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = getelementptr inbounds i8, i8* %1, i64 1
%3 = tail call i32 @strlen(i8* %2)
ret void
}
int test_imm_ECint16_reg(short val) {
  return ((val) & (-0xEC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ECint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff14,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_ECint16_reg(i16 signext %0) {
%2 = and i16 %0, -236
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *);
main() {
  int i = 1;
  while ((getchar() != 27) && (i != 50)) {
    printf("\a");
    i++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1b,%ecx
mov    %al,-0x9(%rbp)
je     1157 <main+0x37>
cmpl   $0x32,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1167 <main+0x47>
jmp    1181 <main+0x61>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x1b,%eax
je     1160 <main+0x40>
mov    $0x30,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x7,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0xffffffff,%ebx
setb   %cl
cmp    $0x1b,%eax
je     1160 <main+0x40>
test   %cl,%cl
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\07\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %11, %0
%4 = call i32 (...) @getchar()
%5 = icmp ne i32 %4, 27
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 50
br label %9
9: ; preds = %6, %3
%10 = phi i1 [ false, %3 ], [ %8, %6 ]
br i1 %10, label %11, label %15
11: ; preds = %9
%12 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %3
15: ; preds = %9
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = icmp eq i32 %1, 27
br i1 %2, label %11, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ 1, %0 ]
%5 = tail call i32 @putchar(i32 7)
%6 = add nuw nsw i32 %4, 1
%7 = tail call i32 (...) @getchar()
%8 = icmp ne i32 %7, 27
%9 = icmp ne i32 %6, 50
%10 = select i1 %8, i1 %9, i1 false
br i1 %10, label %3, label %11
11: ; preds = %3, %0
ret i32 0
}
int Cobj(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Cobj() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glutSwapBuffers();
void InternalCB() {
  glClear(GL_COLOR_BUFFER_BIT);
  glutSwapBuffers();
}


x86 assembly (clang, -O0):
<InternalCB>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1040 <glutSwapBuffers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<InternalCB>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glutSwapBuffers@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @InternalCB() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = call i32 @glClear(i32 %1)
%3 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @InternalCB() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
%3 = tail call i32 (...) @glutSwapBuffers()
ret void
}
void RTAvllU32RemoveBestFit(void) {}


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

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

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

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


x86 assembly (clang, -O0):
<trace_glLoadIdentity>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <glLoadIdentity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_glLoadIdentity>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec7(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glLoadIdentity@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%20s(\00"
@.str.1 = [15 x i8] c"glLoadIdentity\00"
@.str.2 = [4 x i8] c");\0A\00"
define void @trace_glLoadIdentity() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (...) @glLoadIdentity()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%20s(\00"
@.str.1 = [15 x i8] c"glLoadIdentity\00"
@str = [3 x i8] c");\00"
define void @trace_glLoadIdentity() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @glLoadIdentity()
ret void
}
/* Variables and functions */
int my_strcmp(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char *str1 = "shivek\0", *str2 = "shivek\0";
  int match;
  match = my_strcmp(str1, str2);
  printf((match == 0) ? "Match" : "No match. err : %d", match);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xebf(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <my_strcmp@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
lea    0xeaf(%rip),%rdi
lea    0xea2(%rip),%rax
cmp    $0x0,%ecx
cmove  %rax,%rdi
mov    -0x1c(%rbp),%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rdi,%rsi
call   1030 <my_strcmp@plt>
test   %eax,%eax
lea    0xecf(%rip),%rcx
lea    0xece(%rip),%rdi
cmove  %rcx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"shivek\00\00"
@.str.1 = [6 x i8] c"Match\00"
@.str.2 = [19 x i8] c"No match. err : %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = load i8*, i8** %2
%6 = load i8*, i8** %3
%7 = call i32 @my_strcmp(i8* %5, i8* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0)
%12 = load i32, i32* %4
%13 = call i32 @printf(i8* %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"shivek\00\00"
@.str.1 = [6 x i8] c"Match\00"
@.str.2 = [19 x i8] c"No match. err : %d\00"
define i32 @main() {
%1 = tail call i32 @my_strcmp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0)
%4 = tail call i32 @printf(i8* %3, i32 %1)
ret i32 0
}
/* Type definitions */
typedef int uint;

/* Variables and functions */
int khash_fit_capacity(uint capacity) {
  uint newcap = 1;
  while (newcap < capacity) {
    newcap <<= 1;
  }
  return newcap;
}


x86 assembly (clang, -O0):
<khash_fit_capacity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1128 <khash_fit_capacity+0x28>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <khash_fit_capacity+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<khash_fit_capacity>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%eax
lea    (%rax,%rax,1),%ecx
cmp    %edi,%eax
jl     1110 <khash_fit_capacity+0x10>
ret

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

LLVM IR (-O2):
define i32 @khash_fit_capacity(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %5, %2 ]
%4 = icmp slt i32 %3, %0
%5 = shl i32 %3, 1
br i1 %4, label %2, label %6
6: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void aug_exit(int exit_code) {
  ;
  ;
  exit(exit_code);
}


x86 assembly (clang, -O0):
<aug_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<aug_exit>:
push   %rax
call   1030 <exit@plt>

LLVM IR (-O0):
define void @aug_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @aug_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int murmur3_32(void const *, int /*<<< orphan*/, int);
int row_num(const void *key, uint32_t key_size, int num) {
  return murmur3_32(key, key_size, 37) % num;
}


x86 assembly (clang, -O0):
<row_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x25,%edx
call   1030 <murmur3_32@plt>
cltd
idivl  -0x10(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<row_num>:
push   %rbx
mov    %edx,%ebx
mov    $0x25,%edx
call   1030 <murmur3_32@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @row_num(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @murmur3_32(i8* %0, i32 %1, i32 37)
%5 = srem i32 %4, %2
ret i32 %5
}
double *getBufferEl(double *buffer, int k, int l, int i, int n_k) {
  return buffer + 5 * (l * n_k + k) + i;
}


x86 assembly (clang, -O0):
<getBufferEl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x18(%rbp),%ecx
add    -0xc(%rbp),%ecx
imul   $0x5,%ecx,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBufferEl>:
imul   %r8d,%edx
add    %esi,%edx
lea    (%rdx,%rdx,4),%eax
cltq
lea    (%rdi,%rax,8),%rax
movslq %ecx,%rcx
lea    (%rax,%rcx,8),%rax
ret

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

LLVM IR (-O2):
define double* @getBufferEl(double* readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = mul nsw i32 %4, %2
%7 = add nsw i32 %6, %1
%8 = mul nsw i32 %7, 5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds double, double* %0, i64 %9
%11 = sext i32 %3 to i64
%12 = getelementptr inbounds double, double* %10, i64 %11
ret double* %12
}
/* Variables and functions */
int /*<<< orphan*/ ENOTSUP;
int /*<<< orphan*/ errno;
int _kill(int pid, int sig) {
  errno = ENOTSUP;
  return -1;
}


x86 assembly (clang, -O0):
<_kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ed7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebe(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_kill>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOTSUP
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_kill(i32 %0, i32 %1) {
%3 = load i32, i32* @ENOTSUP
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *getLine(int /*<<< orphan*/ *);
int /*<<< orphan*/ parseLine(char const *);
int parseConfigFile(FILE *file) {
  const char *s;
  while ((s = getLine(file)) != 0) {
    parseLine(s);
  }
  return 0;
}


x86 assembly (clang, -O0):
<parseConfigFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getLine@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1151 <parseConfigFile+0x31>
mov    -0x10(%rbp),%rdi
call   1040 <parseLine@plt>
jmp    112c <parseConfigFile+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseConfigFile>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <getLine@plt>
test   %rax,%rax
je     1147 <parseConfigFile+0x27>
mov    %rax,%rdi
call   1040 <parseLine@plt>
mov    %rbx,%rdi
jmp    1130 <parseConfigFile+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @parseConfigFile(i32* %0) {
%2 = tail call i8* @getLine(i32* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 @parseLine(i8* %5)
%7 = tail call i8* @getLine(i32* %0)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret i32 0
}
unsigned int random(unsigned int *r) { return *r = 1103515245 * *r + 12345; }


x86 assembly (clang, -O0):
<random>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x41c64e6d,(%rax),%eax
add    $0x3039,%eax
mov    -0x8(%rbp),%rcx
mov    %eax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<random>:
imul   $0x41c64e6d,(%rdi),%eax
add    $0x3039,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @random(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = mul i32 1103515245, %4
%6 = add i32 %5, 12345
%7 = load i32*, i32** %2
store i32 %6, i32* %7
ret i32 %6
}

LLVM IR (-O2):
define i32 @random(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul i32 %2, 1103515245
%4 = add i32 %3, 12345
store i32 %4, i32* %0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
int get_char(FILE *fp) {
  int c = fgetc(fp);
  if (c == '\r') {
    int c2 = fgetc(fp);
    if (c2 != '\n')
      ungetc(c2, fp);
    c = '\n';
  }
  return c;
}


x86 assembly (clang, -O0):
<get_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xd,-0xc(%rbp)
jne    116b <get_char+0x4b>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
je     1164 <get_char+0x44>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <ungetc@plt>
movl   $0xa,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    %eax,%ebp
cmp    $0xd,%eax
jne    114e <get_char+0x2e>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    $0xa,%ebp
cmp    $0xa,%eax
je     114e <get_char+0x2e>
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <ungetc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @get_char(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = icmp eq i32 %2, 13
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 @fgetc(i32* %0)
%6 = icmp eq i32 %5, 10
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @ungetc(i32 %5, i32* %0)
br label %9
9: ; preds = %4, %7, %1
%10 = phi i32 [ %2, %1 ], [ 10, %7 ], [ 10, %4 ]
ret i32 %10
}
/* Type definitions */
struct dump_pa {
  int dummy;
};

/* Variables and functions */
struct dump_pa *dumpsys_gen_pa_next(struct dump_pa *);
struct dump_pa *dumpsys_pa_next(struct dump_pa *p) {
  return (dumpsys_gen_pa_next(p));
}


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

x86 assembly (clang, -O2):
<dumpsys_pa_next>:
jmp    1030 <dumpsys_gen_pa_next@plt>

LLVM IR (-O0):
%struct.dump_pa = type { i32 }
define %struct.dump_pa* @dumpsys_pa_next(%struct.dump_pa* %0) {
%2 = alloca %struct.dump_pa*
store %struct.dump_pa* %0, %struct.dump_pa** %2
%3 = load %struct.dump_pa*, %struct.dump_pa** %2
%4 = call %struct.dump_pa* @dumpsys_gen_pa_next(%struct.dump_pa* %3)
ret %struct.dump_pa* %4
}

LLVM IR (-O2):
%struct.dump_pa = type { i32 }
define %struct.dump_pa* @dumpsys_pa_next(%struct.dump_pa* %0) {
%2 = tail call %struct.dump_pa* @dumpsys_gen_pa_next(%struct.dump_pa* %0)
ret %struct.dump_pa* %2
}
/* Variables and functions */
double pow(double, double);
double Mu(double A_mu, double B_mu, double T) {
  return A_mu * pow(T, 1.5) / (B_mu + T);
}


x86 assembly (clang, -O0):
<Mu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xec2(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mu>:
sub    $0x18,%rsp
movsd  %xmm2,(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movsd  0xed3(%rip),%xmm1
movapd %xmm2,%xmm0
call   1030 <pow@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
addsd  (%rsp),%xmm1
divsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @Mu(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = call double @pow(double %8, double 1.500000e+00)
%10 = fmul double %7, %9
%11 = load double, double* %5
%12 = load double, double* %6
%13 = fadd double %11, %12
%14 = fdiv double %10, %13
ret double %14
}

LLVM IR (-O2):
define double @Mu(double %0, double %1, double %2) {
%4 = tail call double @pow(double %2, double 1.500000e+00)
%5 = fmul double %4, %0
%6 = fadd double %1, %2
%7 = fdiv double %5, %6
ret double %7
}
void gdk_wm_decoration_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_wm_decoration_get_type() {
ret void
}
/* Variables and functions */
scalar_t__ rand();
int my_random(int max) {
  unsigned long temp;
  temp = (unsigned long)rand();
  temp *= (unsigned long)max;
  temp >>= 15;
  return (int)temp;
}


x86 assembly (clang, -O0):
<my_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,-0x10(%rbp)
movslq -0x4(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0xf,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_random>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
movslq %ebx,%rcx
imul   %rcx,%rax
shr    $0xf,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @my_random(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = call i64 (...) @rand()
store i64 %4, i64* %3
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = load i64, i64* %3
%8 = mul i64 %7, %6
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = lshr i64 %9, 15
store i64 %10, i64* %3
%11 = load i64, i64* %3
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @my_random(i32 %0) {
%2 = tail call i64 (...) @rand()
%3 = sext i32 %0 to i64
%4 = mul i64 %2, %3
%5 = lshr i64 %4, 15
%6 = trunc i64 %5 to i32
ret i32 %6
}