xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int x;
  srand(time(NULL));
  x = rand() % 6 + 1;
  printf("Congrats, you rolled a %d.\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1,%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Congrats, you rolled a %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
%6 = srem i32 %5, 6
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Congrats, you rolled a %d.\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 6
%5 = add nsw i32 %4, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void WatchdogStallDisable(uint32_t ui32Base) {
  ASSERT((ui32Base == 0x40000000) || (ui32Base == 0x40001000));
  (*((volatile uint32_t *)(ui32Base + 0x00000418))) &= ~(0x00000100);
}


x86 assembly (clang, -O0):
<WatchdogStallDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x40000000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113a <WatchdogStallDisable+0x2a>
cmpl   $0x40001000,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x418,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffeff,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogStallDisable>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40000000,%eax
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
andl   $0xfffffeff,0x418(%rax)
fe ff ff
pop    %rbx
ret

LLVM IR (-O0):
define void @WatchdogStallDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1073741824
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1073745920
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @ASSERT(i32 %10)
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1048
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = and i32 %16, -257
store volatile i32 %17, i32* %15
ret void
}

LLVM IR (-O2):
define void @WatchdogStallDisable(i32 %0) {
%2 = and i32 %0, -4097
%3 = icmp eq i32 %2, 1073741824
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = add nsw i32 %0, 1048
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -257
store volatile i32 %10, i32* %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void fmt_convert_s8_to_s8(void *dest_v, void *src_v, int n) {
  memcpy(dest_v, src_v, n * sizeof(int8_t));
}


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

x86 assembly (clang, -O2):
<fmt_convert_s8_to_s8>:
shl    $0x2,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @fmt_convert_s8_to_s8(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i32 @memcpy(i8* %7, i8* %8, i32 %12)
ret void
}

LLVM IR (-O2):
define void @fmt_convert_s8_to_s8(i8* %0, i8* %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %4)
ret void
}
/* Variables and functions */
int rand(void) { return 4; }


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

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

LLVM IR (-O0):
define i32 @rand() {
ret i32 4
}

LLVM IR (-O2):
define i32 @rand() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int main(int argc, char **argv) {
  int i;
  i = 0;
  argc = 0;
  while (argv[0][i])
    ft_putchar(argv[0][i++]);
  ft_putchar('\n');
  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)
movl   $0x0,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     116c <main+0x5c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_putchar@plt>
jmp    1134 <main+0x24>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    (%rsi),%rax
mov    (%rax),%al
test   %al,%al
je     1147 <main+0x37>
mov    %rsi,%r14
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <ft_putchar@plt>
mov    (%r14),%rax
movzbl (%rax,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <main+0x20>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
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
store i32 0, i32* %4
br label %7
7: ; preds = %16, %2
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
br i1 %15, label %16, label %26
16: ; preds = %7
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
%22 = sext i32 %20 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
%24 = load i8, i8* %23
%25 = call i32 @ft_putchar(i8 signext %24)
br label %7
26: ; preds = %7
%27 = call i32 @ft_putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %2, %6
%7 = phi i64 [ %9, %6 ], [ 0, %2 ]
%8 = phi i8 [ %13, %6 ], [ %4, %2 ]
%9 = add nuw i64 %7, 1
%10 = tail call i32 @ft_putchar(i8 signext %8)
%11 = load i8*, i8** %1
%12 = getelementptr inbounds i8, i8* %11, i64 %9
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %2
%16 = tail call i32 @ft_putchar(i8 signext 10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ get_string(char *, char *, int);
int /*<<< orphan*/ my_strcpy(char *, char *, int);
int /*<<< orphan*/ process_pref_file_command(char *);
void do_cmd_pref(void) {
  char tmp[80];
  my_strcpy(tmp, "", sizeof(tmp));
  if (!get_string("Pref: ", tmp, sizeof(tmp)))
    return;
  (void)process_pref_file_command(tmp);
}


x86 assembly (clang, -O0):
<do_cmd_pref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xec3(%rip),%rsi
mov    $0x50,%edx
call   1030 <my_strcpy@plt>
lea    -0x50(%rbp),%rsi
lea    0xea8(%rip),%rdi
mov    $0x50,%edx
call   1040 <get_string@plt>
cmp    $0x0,%eax
jne    1170 <do_cmd_pref+0x40>
jmp    1179 <do_cmd_pref+0x49>
lea    -0x50(%rbp),%rdi
call   1050 <process_pref_file_command@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cmd_pref>:
push   %rbx
sub    $0x50,%rsp
lea    0xeca(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%edx
call   1030 <my_strcpy@plt>
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
mov    $0x50,%edx
call   1040 <get_string@plt>
test   %eax,%eax
je     116c <do_cmd_pref+0x3c>
mov    %rsp,%rdi
call   1050 <process_pref_file_command@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [7 x i8] c"Pref: \00"
define void @do_cmd_pref() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @my_strcpy(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 80)
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%5 = call i32 @get_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 80)
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %0
br label %11
8: ; preds = %0
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%10 = call i32 @process_pref_file_command(i8* %9)
br label %11
11: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [7 x i8] c"Pref: \00"
define void @do_cmd_pref() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @my_strcpy(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 80)
%4 = call i32 @get_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 80)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @process_pref_file_command(i8* %2)
br label %8
8: ; preds = %0, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void Key(unsigned char key, int x, int y) {
  switch (key) {
  case 27:
    exit(1);
  }
}


x86 assembly (clang, -O0):
<Key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    113e <Key+0x2e>
jmp    1134 <Key+0x24>
mov    $0x1,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Key>:
cmp    $0x1b,%dil
je     1117 <Key+0x7>
ret
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @Key(i8 zeroext %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 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @Key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *, int,
                                          int /*<<< orphan*/);
void wl_pointer_send_axis_source(struct wl_resource *resource_,
                                 uint32_t axis_source) {
  wl_resource_post_event(resource_, 6, axis_source);
}


x86 assembly (clang, -O0):
<wl_pointer_send_axis_source>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x6,%esi
call   1030 <wl_resource_post_event@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_pointer_send_axis_source>:
mov    %esi,%edx
mov    $0x6,%esi
jmp    1030 <wl_resource_post_event@plt>

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_pointer_send_axis_source(%struct.wl_resource* %0, i32 %1) {
%3 = alloca %struct.wl_resource*
%4 = alloca i32
store %struct.wl_resource* %0, %struct.wl_resource** %3
store i32 %1, i32* %4
%5 = load %struct.wl_resource*, %struct.wl_resource** %3
%6 = load i32, i32* %4
%7 = call i32 @wl_resource_post_event(%struct.wl_resource* %5, i32 6, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_pointer_send_axis_source(%struct.wl_resource* %0, i32 %1) {
%3 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 6, i32 %1)
ret void
}
/* Type definitions */
struct Var {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pA(char *, char const *, char const *);
void __func_invert_ptr(struct Var *avar, const char *areg, const char *lreg,
                       const char *rreg) {
  pA("%s = %s ^ (-1);", areg, lreg);
}


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

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

LLVM IR (-O0):
%struct.Var = type { i32 }
@.str = [16 x i8] c"%s = %s ^ (-1);\00"
define void @__func_invert_ptr(%struct.Var* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.Var*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store %struct.Var* %0, %struct.Var** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = call i32 @pA(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.Var = type { i32 }
@.str = [16 x i8] c"%s = %s ^ (-1);\00"
define void @__func_invert_ptr(%struct.Var* nocapture readnone %0, i8* %1, i8* %2, i8* nocapture readnone %3) {
%5 = tail call i32 @pA(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}
/* Type definitions */
struct mylist_elem {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_MYLIST_HEAD(struct mylist_elem *);
int /*<<< orphan*/ mylist_replace(struct mylist_elem *, struct mylist_elem *);
void mylist_replace_init(struct mylist_elem *old, struct mylist_elem *new) {
  mylist_replace(old, new);
  INIT_MYLIST_HEAD(old);
}


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

x86 assembly (clang, -O2):
<mylist_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <mylist_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <INIT_MYLIST_HEAD@plt>

LLVM IR (-O0):
%struct.mylist_elem = type { i32 }
define void @mylist_replace_init(%struct.mylist_elem* %0, %struct.mylist_elem* %1) {
%3 = alloca %struct.mylist_elem*
%4 = alloca %struct.mylist_elem*
store %struct.mylist_elem* %0, %struct.mylist_elem** %3
store %struct.mylist_elem* %1, %struct.mylist_elem** %4
%5 = load %struct.mylist_elem*, %struct.mylist_elem** %3
%6 = load %struct.mylist_elem*, %struct.mylist_elem** %4
%7 = call i32 @mylist_replace(%struct.mylist_elem* %5, %struct.mylist_elem* %6)
%8 = load %struct.mylist_elem*, %struct.mylist_elem** %3
%9 = call i32 @INIT_MYLIST_HEAD(%struct.mylist_elem* %8)
ret void
}

LLVM IR (-O2):
%struct.mylist_elem = type { i32 }
define void @mylist_replace_init(%struct.mylist_elem* %0, %struct.mylist_elem* %1) {
%3 = tail call i32 @mylist_replace(%struct.mylist_elem* %0, %struct.mylist_elem* %1)
%4 = tail call i32 @INIT_MYLIST_HEAD(%struct.mylist_elem* %0)
ret void
}
int isPrime(int n) {
  int i, lim;
  lim = n / 2;
  for (i = 2; i <= lim; i++) {
    if ((n % i) == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1157 <isPrime+0x57>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1144 <isPrime+0x44>
movl   $0x0,-0x4(%rbp)
jmp    115e <isPrime+0x5e>
jmp    1149 <isPrime+0x49>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111c <isPrime+0x1c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
mov    $0x1,%r8d
cmp    $0x4,%edi
jl     1137 <isPrime+0x37>
mov    %edi,%esi
shr    %esi
neg    %esi
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     113b <isPrime+0x3b>
lea    (%rsi,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
cmp    $0x1,%eax
jne    1120 <isPrime+0x20>
mov    %r8d,%eax
ret
xor    %r8d,%r8d
mov    %r8d,%eax
ret

LLVM IR (-O0):
define i32 @isPrime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = sdiv i32 %6, 2
store i32 %7, i32* %5
store i32 2, i32* %4
br label %8
8: ; preds = %19, %1
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = srem i32 %13, %14
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12
store i32 0, i32* %2
br label %23
18: ; preds = %12
br label %19
19: ; preds = %18
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %8
22: ; preds = %8
store i32 1, i32* %2
br label %23
23: ; preds = %22, %17
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 1
br label %8
5: ; preds = %8
%6 = add nuw nsw i32 %9, 1
%7 = icmp eq i32 %9, %4
br i1 %7, label %12, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %6, %5 ], [ 2, %3 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %8, %5, %1
%13 = phi i32 [ 1, %1 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %13
}
/* Variables and functions */
void hello_test() {
  int *s = NULL;
  *s = 42;
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @hello_test() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
store i32 42, i32* %2
ret void
}

LLVM IR (-O2):
/* Variables and functions */
long _tfstell(int);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
long mon_tfstell(int fd) {
  long ret;
  monLock();
  ret = _tfstell(fd);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_tfstell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <monLock@plt>
mov    -0x4(%rbp),%edi
call   1050 <_tfstell@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <monUnlock@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_tfstell>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <monLock@plt>
mov    %ebx,%edi
call   1050 <_tfstell@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <monUnlock@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @mon_tfstell(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = call i32 (...) @monLock()
%5 = load i32, i32* %2
%6 = call i64 @_tfstell(i32 %5)
store i64 %6, i64* %3
%7 = call i32 (...) @monUnlock()
%8 = load i64, i64* %3
ret i64 %8
}

LLVM IR (-O2):
define i64 @mon_tfstell(i32 %0) {
%2 = tail call i32 (...) @monLock()
%3 = tail call i64 @_tfstell(i32 %0)
%4 = tail call i32 (...) @monUnlock()
ret i64 %3
}
void i2d_PKCS7(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ PTHREAD_MUTEX_INITIALIZER;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ puts(char *);
void *tf(void *arg) {
  pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
  pthread_mutex_lock(&m);
  pthread_mutex_lock(&m);
  puts("tf: mutex_lock returned");
  exit(1);
}


x86 assembly (clang, -O0):
<tf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <pthread_mutex_lock@plt>
lea    -0xc(%rbp),%rdi
call   1050 <pthread_mutex_lock@plt>
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<tf>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <pthread_mutex_lock@plt>
mov    %rbx,%rdi
call   1050 <pthread_mutex_lock@plt>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@PTHREAD_MUTEX_INITIALIZER = global i32 0
@.str = [24 x i8] c"tf: mutex_lock returned\00"
define i8* @tf(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @PTHREAD_MUTEX_INITIALIZER
store i32 %4, i32* %3
%5 = call i32 @pthread_mutex_lock(i32* %3)
%6 = call i32 @pthread_mutex_lock(i32* %3)
%7 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@PTHREAD_MUTEX_INITIALIZER = global i32 0
@.str = [24 x i8] c"tf: mutex_lock returned\00"
define noalias i8* @tf(i8* nocapture readnone %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @PTHREAD_MUTEX_INITIALIZER
store i32 %4, i32* %2
%5 = call i32 @pthread_mutex_lock(i32* %2)
%6 = call i32 @pthread_mutex_lock(i32* %2)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int ai_pathfinding_move_to(int, int, int, int, int);
int ai_pathfinding_move_to_length(int start_x, int start_y, int end_x,
                                  int end_y, int ignore_simulated) {
  return ai_pathfinding_move_to(start_x, start_y, end_x, end_y,
                                ignore_simulated);
}


x86 assembly (clang, -O0):
<ai_pathfinding_move_to_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1030 <ai_pathfinding_move_to@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ai_pathfinding_move_to_length>:
jmp    1030 <ai_pathfinding_move_to@plt>

LLVM IR (-O0):
define i32 @ai_pathfinding_move_to_length(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @ai_pathfinding_move_to(i32 %11, i32 %12, i32 %13, i32 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @ai_pathfinding_move_to_length(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @ai_pathfinding_move_to(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strindex(char *, char *);
int main() {
  printf("strindex(\"abcabc\", \"ab\") -> %d\n", strindex("abcabc", "ab"));
  printf("strindex(\"abcabc\", \"def\") -> %d\n", strindex("abcabc", "def"));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rdi
lea    0xef5(%rip),%rsi
call   1040 <strindex@plt>
mov    %eax,%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    0xef8(%rip),%rsi
call   1040 <strindex@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef8(%rip),%rbx
lea    0xef8(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strindex@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xeff(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strindex@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"strindex(\22abcabc\22, \22ab\22) -> %d\0A\00"
@.str.1 = [7 x i8] c"abcabc\00"
@.str.2 = [3 x i8] c"ab\00"
@.str.3 = [33 x i8] c"strindex(\22abcabc\22, \22def\22) -> %d\0A\00"
@.str.4 = [4 x i8] c"def\00"
define i32 @main() {
%1 = call i32 @strindex(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @strindex(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"strindex(\22abcabc\22, \22ab\22) -> %d\0A\00"
@.str.1 = [7 x i8] c"abcabc\00"
@.str.2 = [3 x i8] c"ab\00"
@.str.3 = [33 x i8] c"strindex(\22abcabc\22, \22def\22) -> %d\0A\00"
@.str.4 = [4 x i8] c"def\00"
define i32 @main() {
%1 = tail call i32 @strindex(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @strindex(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ decelerate(int);
void move_descer() {
  decelerate(0);
  decelerate(1);
  decelerate(2);
  decelerate(3);
}


x86 assembly (clang, -O0):
<move_descer>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <decelerate@plt>
mov    $0x1,%edi
call   1030 <decelerate@plt>
mov    $0x2,%edi
call   1030 <decelerate@plt>
mov    $0x3,%edi
call   1030 <decelerate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_descer>:
push   %rax
xor    %edi,%edi
call   1030 <decelerate@plt>
mov    $0x1,%edi
call   1030 <decelerate@plt>
mov    $0x2,%edi
call   1030 <decelerate@plt>
mov    $0x3,%edi
pop    %rax
jmp    1030 <decelerate@plt>

LLVM IR (-O0):
define void @move_descer() {
%1 = call i32 @decelerate(i32 0)
%2 = call i32 @decelerate(i32 1)
%3 = call i32 @decelerate(i32 2)
%4 = call i32 @decelerate(i32 3)
ret void
}

LLVM IR (-O2):
define void @move_descer() {
%1 = tail call i32 @decelerate(i32 0)
%2 = tail call i32 @decelerate(i32 1)
%3 = tail call i32 @decelerate(i32 2)
%4 = tail call i32 @decelerate(i32 3)
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
scalar_t__ alloca(int);
int /*<<< orphan*/ strlen_rec(char *);
int main() {
  int length1 = __VERIFIER_nondet_int();
  if (length1 < 1) {
    length1 = 1;
  }
  char *nondetString1 = (char *)alloca(length1 * sizeof(char));
  nondetString1[length1 - 1] = '\0';
  strlen_rec(nondetString1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    115a <main+0x2a>
movl   $0x1,-0x8(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <alloca@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rdi
call   1030 <strlen_rec@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
mov    $0x1,%ebx
cmovg  %eax,%ebx
mov    %ebx,%edi
call   1040 <alloca@plt>
add    $0xffffffff,%ebx
movb   $0x0,(%rax,%rbx,1)
mov    %rax,%rdi
call   1030 <strlen_rec@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 1, i32* %2
br label %8
8: ; preds = %7, %0
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 1
%12 = trunc i64 %11 to i32
%13 = call i64 @alloca(i32 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %3
%15 = load i8*, i8** %3
%16 = load i32, i32* %2
%17 = sub nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %15, i64 %18
store i8 0, i8* %19
%20 = load i8*, i8** %3
%21 = call i32 @strlen_rec(i8* %20)
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, 1
%3 = select i1 %2, i32 %1, i32 1
%4 = tail call i64 @alloca(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = add nsw i32 %3, -1
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
%9 = tail call i32 @strlen_rec(i8* %5)
ret i32 0
}
int bonus_for_stat(int stat_val) { return (stat_val / 2) - 5; }


x86 assembly (clang, -O0):
<bonus_for_stat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bonus_for_stat>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
add    $0xfffffffb,%eax
ret

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

LLVM IR (-O2):
define i32 @bonus_for_stat(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = add nsw i32 %2, -5
ret i32 %3
}
void RTTimeSpecToString(void) {}


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

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

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

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

/* Variables and functions */
uint32_t rotl_32b(short dummy, uint32_t x) { return (x << 8) | (x >> 24); }


x86 assembly (clang, -O0):
<rotl_32b>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%ecx
sar    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl_32b>:
mov    %esi,%eax
shl    $0x8,%eax
sar    $0x18,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @rotl_32b(i16 signext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32, i32* %4
%8 = ashr i32 %7, 24
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @rotl_32b(i16 signext %0, i32 %1) {
%3 = shl i32 %1, 8
%4 = ashr i32 %1, 24
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memory_error_and_abort(char *);
void *realloc(void *, int);
void *xrealloc(void *pointer, int bytes) {
  void *temp;
  if (!pointer)
    temp = malloc(bytes);
  else
    temp = realloc(pointer, bytes);
  if (!temp)
    memory_error_and_abort("xrealloc");
  return (temp);
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115b <xrealloc+0x2b>
mov    -0xc(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
jmp    116b <xrealloc+0x3b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1182 <xrealloc+0x52>
lea    0xe83(%rip),%rdi
call   1030 <memory_error_and_abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
test   %rdi,%rdi
je     113d <xrealloc+0xd>
call   1050 <realloc@plt>
jmp    1144 <xrealloc+0x14>
mov    %esi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1158 <xrealloc+0x28>
lea    0xead(%rip),%rdi
call   1030 <memory_error_and_abort@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"xrealloc\00"
define i8* @xrealloc(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i8* @malloc(i32 %1)
br label %8
6: ; preds = %2
%7 = tail call i8* @realloc(i8* %0, i32 %1)
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ %7, %6 ], [ %5, %4 ]
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @memory_error_and_abort(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %8
ret i8* %9
}
_Complex float dfn_rcf(void) {
  return ({
    _Complex float x;
    __real__(x) = (9), __imag__(x) == (10);
    x;
  });
}


x86 assembly (clang, -O0):
<dfn_rcf>:
push   %rbp
mov    %rsp,%rbp
movl   $0x41100000,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  %xmm1,-0x18(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  -0x18(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define <2 x float> @dfn_rcf() {
%1 = alloca { float, float }
%2 = alloca { float, float }
%3 = alloca { float, float }
%4 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
store float 9.000000e+00, float* %4
%5 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%6 = load float, float* %5
%7 = fcmp oeq float %6, 1.000000e+01
%8 = zext i1 %7 to i32
%9 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%10 = load float, float* %9
%11 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%12 = load float, float* %11
%13 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%14 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
store float %10, float* %13
store float %12, float* %14
%15 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%16 = load float, float* %15
%17 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
%18 = load float, float* %17
%19 = getelementptr inbounds { float, float }, { float, float }* %1, i32 0, i32 0
%20 = getelementptr inbounds { float, float }, { float, float }* %1, i32 0, i32 1
store float %16, float* %19
store float %18, float* %20
%21 = bitcast { float, float }* %1 to <2 x float>*
%22 = load <2 x float>, <2 x float>* %21
ret <2 x float> %22
}

LLVM IR (-O2):
define <2 x float> @dfn_rcf() {
ret <2 x float> <float 9.000000e+00, float undef>
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_srli_epi16(int /*<<< orphan*/, int);
__m128i test_mm_srli_epi16_2(__m128i A, int B) { return _mm_srli_epi16(A, B); }


x86 assembly (clang, -O0):
<test_mm_srli_epi16_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm_srli_epi16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_srli_epi16_2>:
jmp    1030 <_mm_srli_epi16@plt>

LLVM IR (-O0):
define i32 @test_mm_srli_epi16_2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @_mm_srli_epi16(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_srli_epi16_2(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_srli_epi16(i32 %0, i32 %1)
ret i32 %3
}
int test_imm_6Fint64_highword_reg(long long val) {
  return ((val >> 32) & (0x6F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_6Fint64_highword_reg>:
movabs $0x6f00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_6Fint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 111
%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_6Fint64_highword_reg(i64 %0) {
%2 = and i64 %0, 476741369856
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
float todaysStockValue() { return 123.4; }


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

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

LLVM IR (-O0):
define float @todaysStockValue() {
ret float 0x405ED999A0000000
}

LLVM IR (-O2):
define float @todaysStockValue() {
ret float 0x405ED999A0000000
}
/* Variables and functions */
int /*<<< orphan*/ ___delay_ms(int);
int /*<<< orphan*/ ___send_char_usci_A1(int);
int /*<<< orphan*/ ___send_msg_usci_A1(char *, int);
int strlen(char *);
void manda_frase_pc(char *msg2pc) {
  int l = strlen(msg2pc);
  ___send_msg_usci_A1(msg2pc, l);
  ___delay_ms(3);
  ___send_char_usci_A1(10);
  ___delay_ms(3);
  ___send_char_usci_A1(13);
  ___delay_ms(3);
}


x86 assembly (clang, -O0):
<manda_frase_pc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <___send_msg_usci_A1@plt>
mov    $0x3,%edi
call   1060 <___delay_ms@plt>
mov    $0xa,%edi
call   1030 <___send_char_usci_A1@plt>
mov    $0x3,%edi
call   1060 <___delay_ms@plt>
mov    $0xd,%edi
call   1030 <___send_char_usci_A1@plt>
mov    $0x3,%edi
call   1060 <___delay_ms@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<manda_frase_pc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <___send_msg_usci_A1@plt>
mov    $0x3,%edi
call   1060 <___delay_ms@plt>
mov    $0xa,%edi
call   1030 <___send_char_usci_A1@plt>
mov    $0x3,%edi
call   1060 <___delay_ms@plt>
mov    $0xd,%edi
call   1030 <___send_char_usci_A1@plt>
mov    $0x3,%edi
pop    %rbx
jmp    1060 <___delay_ms@plt>

LLVM IR (-O0):
define void @manda_frase_pc(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = call i32 @___send_msg_usci_A1(i8* %6, i32 %7)
%9 = call i32 @___delay_ms(i32 3)
%10 = call i32 @___send_char_usci_A1(i32 10)
%11 = call i32 @___delay_ms(i32 3)
%12 = call i32 @___send_char_usci_A1(i32 13)
%13 = call i32 @___delay_ms(i32 3)
ret void
}

LLVM IR (-O2):
define void @manda_frase_pc(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @___send_msg_usci_A1(i8* %0, i32 %2)
%4 = tail call i32 @___delay_ms(i32 3)
%5 = tail call i32 @___send_char_usci_A1(i32 10)
%6 = tail call i32 @___delay_ms(i32 3)
%7 = tail call i32 @___send_char_usci_A1(i32 13)
%8 = tail call i32 @___delay_ms(i32 3)
ret void
}
void S_Init(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_hv32_10_sse4() {
ret void
}
int reverse(int num) {
  int ret = 0;
  while (num) {
    ret = ret * 10 + num % 10;
    num /= 10;
  }
  return ret;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1145 <reverse+0x45>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <reverse+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
xor    %eax,%eax
test   %edi,%edi
je     113f <reverse+0x3f>
cs nopw 0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
lea    (%rsi,%rax,2),%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = srem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %5, 10
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
void skipframeclauses() {}


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

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

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

LLVM IR (-O2):
define void @skipframeclauses() {
ret void
}
__attribute__((always_)) char readpixel(void *s) { return (*((char *)(s))); }


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

x86 assembly (clang, -O2):
<readpixel>:
mov    (%rdi),%al
ret

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

LLVM IR (-O2):
define signext i8 @readpixel(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int _not_supported(void) {
  fprintf(stderr, "portio-vga not supported\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<_not_supported>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_not_supported>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"portio-vga not supported\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @_not_supported() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"portio-vga not supported\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @_not_supported() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
unsigned NI_USUAL_RTSI_SELECT(unsigned rtsi_channel) {
  if (rtsi_channel < 7)
    return 0xb + rtsi_channel;
  else
    return 0x1b;
}


x86 assembly (clang, -O0):
<NI_USUAL_RTSI_SELECT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
jae    111f <NI_USUAL_RTSI_SELECT+0x1f>
mov    -0x8(%rbp),%eax
add    $0xb,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <NI_USUAL_RTSI_SELECT+0x26>
movl   $0x1b,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NI_USUAL_RTSI_SELECT>:
lea    0xb(%rdi),%ecx
cmp    $0x7,%edi
mov    $0x1b,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @NI_USUAL_RTSI_SELECT(i32 %0) {
%2 = icmp ult i32 %0, 7
%3 = add i32 %0, 11
%4 = select i1 %2, i32 %3, i32 27
ret i32 %4
}