xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
scalar_t__ jenkins_hash_pair(int /*<<< orphan*/, int /*<<< orphan*/, int);
uint32_t hash_select(uint32_t k, int32_t x) {
  return jenkins_hash_pair((int32_t)k, x, 0x13dae100);
}


x86 assembly (clang, -O0):
<hash_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
mov    -0xc(%rbp),%esi
mov    $0x13dae100,%edx
call   1030 <jenkins_hash_pair@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_select>:
mov    $0x13dae100,%edx
jmp    1030 <jenkins_hash_pair@plt>

LLVM IR (-O0):
define i64 @hash_select(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = load i32, i32* %4
%8 = call i64 @jenkins_hash_pair(i32 %6, i32 %7, i32 333111552)
ret i64 %8
}

LLVM IR (-O2):
define i64 @hash_select(i64 %0, i32 %1) {
%3 = trunc i64 %0 to i32
%4 = tail call i64 @jenkins_hash_pair(i32 %3, i32 %1, i32 333111552)
ret i64 %4
}
/* Type definitions */
struct client {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ client_clear(struct client *);
int do_stuff(struct client *);
int /*<<< orphan*/ free(struct client *);
void client_handle(struct client *c) {
  if (do_stuff(c) == -1) {
    client_clear(c);
    free(c);
  }
}


x86 assembly (clang, -O0):
<client_handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <do_stuff@plt>
cmp    $0xffffffff,%eax
jne    1160 <client_handle+0x30>
mov    -0x8(%rbp),%rdi
call   1040 <client_clear@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<client_handle>:
push   %rbx
mov    %rdi,%rbx
call   1050 <do_stuff@plt>
cmp    $0xffffffff,%eax
je     1140 <client_handle+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <client_clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.client = type { i32 }
define void @client_handle(%struct.client* %0) {
%2 = alloca %struct.client*
store %struct.client* %0, %struct.client** %2
%3 = load %struct.client*, %struct.client** %2
%4 = call i32 @do_stuff(%struct.client* %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load %struct.client*, %struct.client** %2
%8 = call i32 @client_clear(%struct.client* %7)
%9 = load %struct.client*, %struct.client** %2
%10 = call i32 @free(%struct.client* %9)
br label %11
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.client = type { i32 }
define void @client_handle(%struct.client* %0) {
%2 = tail call i32 @do_stuff(%struct.client* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @client_clear(%struct.client* %0)
%6 = tail call i32 @free(%struct.client* %0)
br label %7
7: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_reverse_2(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char string_from_user[80];
  printf("Give me a word to reverse: (80 char. max)");
  scanf("%79s", string_from_user);
  print_reverse_2(string_from_user);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xed4(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x60(%rbp),%rdi
call   1050 <print_reverse_2@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1050 <print_reverse_2@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Give me a word to reverse: (80 char. max)\00"
@.str.1 = [5 x i8] c"%79s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%7 = call i32 @print_reverse_2(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [42 x i8] c"Give me a word to reverse: (80 char. max)\00"
@.str.1 = [5 x i8] c"%79s\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @print_reverse_2(i8* %2)
ret i32 0
}
main() {
  _Static_assert(1, "3");
  int i;
  _Static_assert(1, "4");
  f();
  _Static_assert(1, "5");
  int j;
  _Static_assert(1, "6");
  g();
  _Static_assert(1, "7");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x0,%al
call   1040 <g@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
call   1040 <g@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @f()
%4 = call i32 (...) @g()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 (...) @g()
ret i32 0
}
int start_soil() {}


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

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

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

LLVM IR (-O2):
define i32 @start_soil() {
ret i32 undef
}
void f1() {
  int a[10];
  int *p = a;
  ++p;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x38(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f1() {
ret void
}
int main() {
  15;
  15u;
  15l;
  15ul;
  15ll;
  15ull;
  0xf;
  0xf;
  0xfu;
  0xfl;
  0xful;
  15ll;
  15ull;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void *rutina2(void *arg) {
  for (int i = 0; i < 30; i++) {
    printf("Hola %d del hilo%d\n", i, (int *)arg);
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<rutina2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1e,-0x14(%rbp)
jge    116c <rutina2+0x4c>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <sleep@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <rutina2+0x13>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rutina2>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
xor    %ebp,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <sleep@plt>
add    $0x1,%ebp
cmp    $0x1e,%ebp
jne    1130 <rutina2+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Hola %d del hilo%d\0A\00"
define i8* @rutina2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %14, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 30
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %4
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to i32*
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %9, i32* %11)
%13 = call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
br label %14
14: ; preds = %8
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %5
17: ; preds = %5
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [20 x i8] c"Hola %d del hilo%d\0A\00"
define i8* @rutina2(i8* %0) {
br label %3
2: ; preds = %3
ret i8* undef
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %7, %3 ]
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %0)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, 30
br i1 %8, label %2, label %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ *display;
};
struct TYPE_4__ {
  TYPE_1__ xmap;
};
typedef TYPE_2__ XEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XEvent_xmap_display(void *_p, void *_v) {
  ((XEvent *)_p)->xmap.display = (Display *)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32* }
define void @set_XEvent_xmap_display(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_4__*
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %8, i32 0, i32 0
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 0
store i32* %6, i32** %10
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xmap_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
int test_imm_23uint32_mem(unsigned int *val) {
  return ((*val) & (0x23 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_23uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x23,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_23uint32_mem>:
testb  $0x23,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_23uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 35
%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_23uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 35
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void foo557() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ libewf_fatal_print(char *);
scalar_t__ malloc(int);
char *libewf_header_value_string_alloc(uint32_t amount) {
  char *header_value_string = (char *)malloc(sizeof(char) * amount);
  if (header_value_string == NULL) {
    libewf_fatal_print("libewf_header_value_string_alloc: unable to allocate "
                       "header value string\n");
  }
  return (header_value_string);
}


x86 assembly (clang, -O0):
<libewf_header_value_string_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <libewf_header_value_string_alloc+0x35>
lea    0xeb0(%rip),%rdi
call   1030 <libewf_fatal_print@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libewf_header_value_string_alloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <libewf_header_value_string_alloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <libewf_fatal_print@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [74 x i8] c"libewf_header_value_string_alloc: unable to allocate header value string\0A\00"
define i8* @libewf_header_value_string_alloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 1, %5
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = call i32 @libewf_fatal_print(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [74 x i8] c"libewf_header_value_string_alloc: unable to allocate header value string\0A\00"
define i8* @libewf_header_value_string_alloc(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @libewf_fatal_print(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i8*
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x8b() {
  Assert_real((isgraph(139) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              700, ("isgraph should be 0 for 0x8b"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x8b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8b,%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2bc,%edx
lea    0xf5b(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x8b>:
push   %rax
mov    $0x8b,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2bc,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x8b\00"
define void @t_isgraph_0x8b() {
%1 = call i64 @isgraph(i32 139)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 700, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x8b\00"
define void @t_isgraph_0x8b() {
%1 = tail call i64 @isgraph(i32 139)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 700, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cfg_get(char *);
int file_load_from_dir(int /*<<< orphan*/, char const *);
int file_load_from_save_dir(const char *fname) {
  return file_load_from_dir(cfg_get("saved-games-dirname"), fname);
}


x86 assembly (clang, -O0):
<file_load_from_save_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <cfg_get@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <file_load_from_dir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_load_from_save_dir>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <cfg_get@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <file_load_from_dir@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"saved-games-dirname\00"
define i32 @file_load_from_save_dir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @cfg_get(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @file_load_from_dir(i32 %3, i8* %4)
ret i32 %5
}

LLVM IR (-O2):
@.str = [20 x i8] c"saved-games-dirname\00"
define i32 @file_load_from_save_dir(i8* %0) {
%2 = tail call i32 @cfg_get(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @file_load_from_dir(i32 %2, i8* %0)
ret i32 %3
}
void putch(char c) {
  __asm__ volatile("movb $0x0E,%ah");
  __asm__ volatile("movb %0,%%al" ::"r"(c) : "%al");
  __asm__ volatile("xorb %bh,%bh");
  __asm__ volatile("int $0x10");
}


x86 assembly (clang, -O0):
<putch>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xe,%ah
mov    -0x1(%rbp),%cl
mov    %cl,%al
xor    %bh,%bh
int    $0x10
pop    %rbp
ret

x86 assembly (clang, -O2):
<putch>:
mov    $0xe,%ah
mov    %dil,%al
xor    %bh,%bh
int    $0x10
ret

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

LLVM IR (-O2):
define void @putch(i8 signext %0) {
tail call void asm sideeffect "movb $$0x0E,%ah", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "movb $0,%al", "r,~{al},~{dirflag},~{fpsr},~{flags}"(i8 %0)
tail call void asm sideeffect "xorb %bh,%bh", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "int $$0x10", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
double AbsF(double X) {
  if (X < 0)
    return -X;
  else
    return X;
}


x86 assembly (clang, -O0):
<AbsF>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113d <AbsF+0x3d>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1147 <AbsF+0x47>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<AbsF>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @AbsF(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
store double %8, double* %2
br label %11
9: ; preds = %1
%10 = load double, double* %3
store double %10, double* %2
br label %11
11: ; preds = %9, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @AbsF(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void foo() {
  static int x = 1;
  x *= x + 1;
  printf("%d", x);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0e(%rip),%eax
add    $0x1,%eax
imul   0x2f04(%rip),%eax
mov    %eax,0x2efe(%rip)
mov    0x2ef8(%rip),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    0x2f12(%rip),%eax
lea    0x1(%rax),%esi
imul   %eax,%esi
mov    %esi,0x2f06(%rip)
lea    0xed7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@foo.x = internal global i32 1
@.str = [3 x i8] c"%d\00"
define void @foo() {
%1 = load i32, i32* @foo.x
%2 = add nsw i32 %1, 1
%3 = load i32, i32* @foo.x
%4 = mul nsw i32 %3, %2
store i32 %4, i32* @foo.x
%5 = load i32, i32* @foo.x
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@foo.x = internal unnamed_addr global i32 1
@.str = [3 x i8] c"%d\00"
define void @foo() {
%1 = load i32, i32* @foo.x
%2 = add nsw i32 %1, 1
%3 = mul nsw i32 %2, %1
store i32 %3, i32* @foo.x
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delayMicroseconds(int);
void zero() { delayMicroseconds(288); }


x86 assembly (clang, -O0):
<zero>:
push   %rbp
mov    %rsp,%rbp
mov    $0x120,%edi
call   1030 <delayMicroseconds@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero>:
mov    $0x120,%edi
jmp    1030 <delayMicroseconds@plt>

LLVM IR (-O0):
define void @zero() {
%1 = call i32 @delayMicroseconds(i32 288)
ret void
}

LLVM IR (-O2):
define void @zero() {
%1 = tail call i32 @delayMicroseconds(i32 288)
ret void
}
/* Variables and functions */
double const MT_rand();
double MT_randExc(const double *n) { return MT_rand() * *n; }


x86 assembly (clang, -O0):
<MT_randExc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <MT_rand@plt>
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MT_randExc>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <MT_rand@plt>
mulsd  (%rbx),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @MT_randExc(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = call double (...) @MT_rand()
%4 = load double*, double** %2
%5 = load double, double* %4
%6 = fmul double %3, %5
ret double %6
}

LLVM IR (-O2):
define double @MT_randExc(double* nocapture %0) {
%2 = tail call double (...) @MT_rand()
%3 = load double, double* %0
%4 = fmul double %2, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) { printf("This is a simple C program\n"); }


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

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

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

LLVM IR (-O2):
@str = [27 x i8] c"This is a simple C program\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int /*<<< orphan*/);
void strncpy_zero(char *src) {
  char dst[] = "123";
  strncpy(dst, src, 0);
}


x86 assembly (clang, -O0):
<strncpy_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xede(%rip),%eax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rsi
xor    %edx,%edx
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy_zero>:
push   %rax
mov    %rdi,%rsi
movl   $0x333231,0x4(%rsp)
lea    0x4(%rsp),%rdi
xor    %edx,%edx
call   1030 <strncpy@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.strncpy_zero.dst = [4 x i8] c"123\00"
define void @strncpy_zero(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = bitcast [4 x i8]* %3 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @strncpy(i8* %5, i8* %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @strncpy_zero(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 3355185, i32* %2
%4 = call i32 @strncpy(i8* %3, i8* %0, i32 0)
ret void
}
void g_datalist_init() {}


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

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

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

LLVM IR (-O2):
define void @g_datalist_init() {
ret void
}
int main(int argc, char *argv[]) {
  int count = 0;
  printf("count before = %d\n", count);
  asm("INCL %0" : "=r"(count) : "0"(count));
  asm("INCL %0" : "=r"(count) : "0"(count));
  asm("INCL %0" : "=r"(count) : "0"(count));
  asm("INCL %0" : "=r"(count) : "0"(count));
  printf("count after  = %d\n", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
inc    %eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
inc    %eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
inc    %eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
inc    %eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"count before = %d\0A\00"
@.str.1 = [19 x i8] c"count after = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %6
%10 = call i32 asm "INCL $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = call i32 asm "INCL $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = call i32 asm "INCL $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %13)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = call i32 asm "INCL $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %15)
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"count before = %d\0A\00"
@.str.1 = [19 x i8] c"count after = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i32 asm "INCL $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 0)
%5 = tail call i32 asm "INCL $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %4)
%6 = tail call i32 asm "INCL $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %5)
%7 = tail call i32 asm "INCL $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %6)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Type definitions */
struct NODE {
  int dummy;
};

/* Variables and functions */
scalar_t__ malloc(int);
struct NODE **newNodeArray(int arraySize) {
  if (arraySize > 0) {
    return (struct NODE **)malloc(arraySize * sizeof(struct NODE *));
  } else {
    return NULL;
  }
}


x86 assembly (clang, -O0):
<newNodeArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    113d <newNodeArray+0x2d>
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
jmp    1145 <newNodeArray+0x35>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newNodeArray>:
test   %edi,%edi
jle    1122 <newNodeArray+0x12>
push   %rax
shl    $0x3,%edi
call   1030 <malloc@plt>
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.NODE = type { i32 }
define %struct.NODE** @newNodeArray(i32 %0) {
%2 = alloca %struct.NODE**
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 8
%10 = trunc i64 %9 to i32
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to %struct.NODE**
store %struct.NODE** %12, %struct.NODE*** %2
br label %14
13: ; preds = %1
store %struct.NODE** null, %struct.NODE*** %2
br label %14
14: ; preds = %13, %6
%15 = load %struct.NODE**, %struct.NODE*** %2
ret %struct.NODE** %15
}

LLVM IR (-O2):
%struct.NODE = type { i32 }
define %struct.NODE** @newNodeArray(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = shl i32 %0, 3
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to %struct.NODE**
br label %7
7: ; preds = %1, %3
%8 = phi %struct.NODE** [ %6, %3 ], [ null, %1 ]
ret %struct.NODE** %8
}
openplotfile(pf) char *pf;
{
  mkstemp(pf);
  strcat(pf, ".pf");
  openpl();
}


x86 assembly (clang, -O0):
<openplotfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <mkstemp@plt>
mov    -0x10(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1040 <strcat@plt>
mov    $0x0,%al
call   1050 <openpl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openplotfile>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <mkstemp@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
movl   $0x66702e,(%rbx,%rax,1)
xor    %eax,%eax
pop    %rbx
jmp    1050 <openpl@plt>

LLVM IR (-O0):
@.str = [4 x i8] c".pf\00"
define i32 @openplotfile(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @mkstemp to i32 (i8*, ...)*)(i8* %4)
%6 = load i8*, i8** %3
%7 = call i8* @strcat(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @openpl()
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @openplotfile(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @mkstemp to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = getelementptr i8, i8* %0, i64 %3
%5 = bitcast i8* %4 to i32*
store i32 6713390, i32* %5
%6 = tail call i32 (...) @openpl()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ called_by_test_5b();
void test_5b(void) { called_by_test_5b(); }


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

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

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

LLVM IR (-O2):
define void @test_5b() {
%1 = tail call i32 (...) @called_by_test_5b()
ret void
}
void _cscout_dummy2(void) { _cscout_dummy2(); }


x86 assembly (clang, -O0):
<_cscout_dummy2>:
push   %rbp
mov    %rsp,%rbp
call   1030 <_cscout_dummy2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cscout_dummy2>:
jmp    1100 <_cscout_dummy2>

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

LLVM IR (-O2):
define void @_cscout_dummy2() {
br label %1
1: ; preds = %1, %0
br label %1
}
void gtk_combo_box_get_focus_on_click() {}


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

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

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

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


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

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

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

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


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

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

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

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

/* Variables and functions */
uint32_t hash(char *str) {
  uint32_t h = 0;
  while (*str) {
    h = (h << 5) + h + *str;
    str++;
  }
  return h;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <hash+0x42>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <hash+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 33
%9 = sext i8 %5 to i32
%10 = add nsw i32 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ mvaddstr(int, int, char *);
int /*<<< orphan*/ refresh();
void drawui() {
  mvaddstr(2, 2, "[    ]+[    ]=[    ]");
  refresh();
}


x86 assembly (clang, -O0):
<drawui>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%esi
lea    0xed0(%rip),%rdx
mov    %esi,%edi
call   1040 <mvaddstr@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawui>:
push   %rax
lea    0xed8(%rip),%rdx
mov    $0x2,%edi
mov    $0x2,%esi
call   1040 <mvaddstr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <refresh@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"[ ]+[ ]=[ ]\00"
define void @drawui() {
%1 = tail call i32 @mvaddstr(i32 2, i32 2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @refresh()
ret void
}
int fun1036() { return 1036; }


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

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

LLVM IR (-O0):
define i32 @fun1036() {
ret i32 1036
}

LLVM IR (-O2):
define i32 @fun1036() {
ret i32 1036
}
/* Variables and functions */
int /*<<< orphan*/ RamAccFixMod_OFILM(int);
int /*<<< orphan*/ RamWriteA_Ofilm(int, unsigned short);
void LopPar_OFILM(unsigned char UcDirSel_OFILM) {
  unsigned short UsLopGan_OFILM;
  RamAccFixMod_OFILM(0x01);
  if (!UcDirSel_OFILM) {
    UsLopGan_OFILM = 0x3000;
    RamWriteA_Ofilm(0x10D3, UsLopGan_OFILM);
  } else {
    UsLopGan_OFILM = 0x3000;
    RamWriteA_Ofilm(0x11D3, UsLopGan_OFILM);
  }
  RamAccFixMod_OFILM(0x00);
}


x86 assembly (clang, -O0):
<LopPar_OFILM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
call   1040 <RamAccFixMod_OFILM@plt>
cmpb   $0x0,-0x1(%rbp)
jne    115b <LopPar_OFILM+0x3b>
movw   $0x3000,-0x4(%rbp)
mov    $0x10d3,%edi
movzwl -0x4(%rbp),%esi
call   1030 <RamWriteA_Ofilm@plt>
jmp    116f <LopPar_OFILM+0x4f>
movw   $0x3000,-0x4(%rbp)
mov    $0x11d3,%edi
movzwl -0x4(%rbp),%esi
call   1030 <RamWriteA_Ofilm@plt>
xor    %edi,%edi
call   1040 <RamAccFixMod_OFILM@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LopPar_OFILM>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1040 <RamAccFixMod_OFILM@plt>
xor    %edi,%edi
test   %ebx,%ebx
setne  %dil
shl    $0x8,%edi
or     $0x10d3,%edi
mov    $0x3000,%esi
call   1030 <RamWriteA_Ofilm@plt>
xor    %edi,%edi
pop    %rbx
jmp    1040 <RamAccFixMod_OFILM@plt>

LLVM IR (-O0):
define void @LopPar_OFILM(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i16
store i8 %0, i8* %2
%4 = call i32 @RamAccFixMod_OFILM(i32 1)
%5 = load i8, i8* %2
%6 = icmp ne i8 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
store i16 12288, i16* %3
%8 = load i16, i16* %3
%9 = call i32 @RamWriteA_Ofilm(i32 4307, i16 zeroext %8)
br label %13
10: ; preds = %1
store i16 12288, i16* %3
%11 = load i16, i16* %3
%12 = call i32 @RamWriteA_Ofilm(i32 4563, i16 zeroext %11)
br label %13
13: ; preds = %10, %7
%14 = call i32 @RamAccFixMod_OFILM(i32 0)
ret void
}

LLVM IR (-O2):
define void @LopPar_OFILM(i8 zeroext %0) {
%2 = tail call i32 @RamAccFixMod_OFILM(i32 1)
%3 = icmp eq i8 %0, 0
%4 = select i1 %3, i32 4307, i32 4563
%5 = tail call i32 @RamWriteA_Ofilm(i32 %4, i16 zeroext 12288)
%6 = tail call i32 @RamAccFixMod_OFILM(i32 0)
ret void
}
int test_imm_9Aint64_lowword_mem(long long *val) {
  return ((*val) & (0x9A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Aint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0x9a,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Aint64_lowword_mem>:
testb  $0x9a,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Aint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 154
%6 = icmp ne i64 %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_9Aint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 154
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void __attribute__((weak, no))
AnnotateCondVarWait(const char *file, int line, const volatile void *cv,
                    const volatile void *lock) {
  asm("");
}


x86 assembly (clang, -O0):
<AnnotateCondVarWait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define weak void @AnnotateCondVarWait(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret void
}

LLVM IR (-O2):
define weak void @AnnotateCondVarWait(i8* %0, i32 %1, i8* %2, i8* %3) {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void gtk_text_view_get_buffer() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_get_buffer() {
ret void
}
/* Type definitions */
typedef unsigned long long const uint8_t;
typedef unsigned long long uint64_t;

/* Variables and functions */
uint64_t test(const uint64_t *set, unsigned long long pos) {
  uint8_t testbit = pos % (sizeof(uint64_t) * 8);
  unsigned long int offset = pos / (sizeof(uint64_t) * 8);
  return set[offset] & 1ULL << testbit;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x3f,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x6,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    %rsi,%rcx
mov    $0x1,%eax
shl    %cl,%rax
shr    $0x6,%rcx
and    (%rdi,%rcx,8),%rax
ret

LLVM IR (-O0):
define i64 @test(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%7 = load i64, i64* %4
%8 = urem i64 %7, 64
store i64 %8, i64* %5
%9 = load i64, i64* %4
%10 = udiv i64 %9, 64
store i64 %10, i64* %6
%11 = load i64*, i64** %3
%12 = load i64, i64* %6
%13 = getelementptr inbounds i64, i64* %11, i64 %12
%14 = load i64, i64* %13
%15 = load i64, i64* %5
%16 = shl i64 1, %15
%17 = and i64 %14, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @test(i64* nocapture %0, i64 %1) {
%3 = and i64 %1, 63
%4 = lshr i64 %1, 6
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
%7 = shl nuw i64 1, %3
%8 = and i64 %6, %7
ret i64 %8
}
int func1() {}


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

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

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

LLVM IR (-O2):
define i32 @func1() {
ret i32 undef
}
/* Variables and functions */
int isMatch(char const *, char const *);
int /*<<< orphan*/ printf(char *, ...);
void test_case(const char *string, const char *pattern) {
  printf("==============================\n");
  printf("str=%s pat=%s match=%d\n", string, pattern, isMatch(string, pattern));
}


x86 assembly (clang, -O0):
<test_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <isMatch@plt>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_case>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <isMatch@plt>
lea    0xea8(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"==============================\0A\00"
@.str.1 = [24 x i8] c"str=%s pat=%s match=%d\0A\00"
define void @test_case(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @isMatch(i8* %8, i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %7, i32 %10)
ret void
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"str=%s pat=%s match=%d\0A\00"
@str = [31 x i8] c"==============================\00"
define void @test_case(i8* %0, i8* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @isMatch(i8* %0, i8* %1)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1, i32 %4)
ret void
}
void RTDbgAsModuleLinkSeg(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgAsModuleLinkSeg() {
ret void
}
/* Variables and functions */
int getNewCoordinates();
int /*<<< orphan*/ insertIntoArray(int, int);
void makeRobots(int max) {
  int i;
  int point;
  for (i = 0; i < max; i++) {
    do {
      point = getNewCoordinates();
    } while (!insertIntoArray(point, i));
  }
}


x86 assembly (clang, -O0):
<makeRobots>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    117b <makeRobots+0x5b>
jmp    1143 <makeRobots+0x23>
mov    $0x0,%al
call   1040 <getNewCoordinates@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <insertIntoArray@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1143 <makeRobots+0x23>
jmp    116d <makeRobots+0x4d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <makeRobots+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeRobots>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    114b <makeRobots+0x2b>
mov    %edi,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getNewCoordinates@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   1030 <insertIntoArray@plt>
test   %eax,%eax
je     1130 <makeRobots+0x10>
add    $0x1,%ebp
cmp    %ebx,%ebp
jne    1130 <makeRobots+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @makeRobots(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %19, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %22
9: ; preds = %5
br label %10
10: ; preds = %12, %9
%11 = call i32 (...) @getNewCoordinates()
store i32 %11, i32* %4
br label %12
12: ; preds = %10
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = call i32 @insertIntoArray(i32 %13, i32 %14)
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
br i1 %17, label %10, label %18
18: ; preds = %12
br label %19
19: ; preds = %18
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %5
22: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @makeRobots(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %12
3: ; preds = %1, %9
%4 = phi i32 [ %10, %9 ], [ 0, %1 ]
br label %5
5: ; preds = %3, %5
%6 = tail call i32 (...) @getNewCoordinates()
%7 = tail call i32 @insertIntoArray(i32 %6, i32 %4)
%8 = icmp eq i32 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5
%10 = add nuw nsw i32 %4, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %12, label %3
12: ; preds = %9, %1
ret void
}