xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void panic(char *s) {
  fprintf(stderr, "panic: %s\n", s);
  exit(1);
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<panic>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"panic: %s\0A\00"
define void @panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"panic: %s\0A\00"
define void @panic(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int test_03(int a, int b, int c, int d) {
  if (d > 4)
    return a + b + 1;
  else
    return a + c + 1;
}


x86 assembly (clang, -O0):
<test_03>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jle    112b <test_03+0x2b>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1137 <test_03+0x37>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_03>:
cmp    $0x5,%ecx
cmovl  %edx,%esi
lea    (%rdi,%rsi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @test_03(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %3, 4
%6 = select i1 %5, i32 %1, i32 %2
%7 = add i32 %0, 1
%8 = add i32 %7, %6
ret i32 %8
}
char *r_strdup(str) const char *str;
{
  int len;
  char *nstr;
  if (!str)
    return (0);
  len = strlen(str) + 1;
  if (!(nstr = r_malloc(0, len)))
    return (0);
  memcpy(nstr, str, len);
  return (nstr);
}


x86 assembly (clang, -O0):
<r_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <r_strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    11a6 <r_strdup+0x76>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
xor    %edi,%edi
mov    $0x0,%al
call   1030 <r_malloc@plt>
cltq
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    118d <r_strdup+0x5d>
movq   $0x0,-0x8(%rbp)
jmp    11a6 <r_strdup+0x76>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_strdup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     116d <r_strdup+0x3d>
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
add    $0x1,%ebx
xor    %r14d,%r14d
xor    %edi,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <r_malloc@plt>
test   %eax,%eax
je     1170 <r_strdup+0x40>
movslq %eax,%r14
movslq %ebx,%rdx
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <memcpy@plt>
jmp    1170 <r_strdup+0x40>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @r_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i8* null, i8** %2
br label %26
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i64 @strlen(i8* %10)
%12 = add i64 %11, 1
%13 = trunc i64 %12 to i32
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = call i32 (i32, i32, ...) bitcast (i32 (...)* @r_malloc to i32 (i32, i32, ...)*)(i32 0, i32 %14)
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i8*
store i8* %17, i8** %5
%18 = icmp ne i8* %17, null
br i1 %18, label %20, label %19
19: ; preds = %9
store i8* null, i8** %2
br label %26
20: ; preds = %9
%21 = load i8*, i8** %5
%22 = load i8*, i8** %3
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = load i8*, i8** %5
store i8* %25, i8** %2
br label %26
26: ; preds = %20, %19, %8
%27 = load i8*, i8** %2
ret i8* %27
}

LLVM IR (-O2):
define i8* @r_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = trunc i64 %4 to i32
%6 = add i32 %5, 1
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @r_malloc to i32 (i32, i32, ...)*)(i32 0, i32 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = icmp eq i32 %7, 0
br i1 %10, label %13, label %11
11: ; preds = %3
%12 = sext i32 %6 to i64
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %9, i8* align 1 %0, i64 %12, i1 false)
br label %13
13: ; preds = %3, %1, %11
%14 = phi i8* [ %9, %11 ], [ null, %1 ], [ null, %3 ]
ret i8* %14
}
/* Type definitions */
typedef int u_int64_t;
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int /*<<< orphan*/ __put_unaligned_le32(int, int /*<<< orphan*/ *);
void __put_unaligned_le64(u_int64_t val, u_char *p) {
  __put_unaligned_le32(val >> 32, p + 4);
  __put_unaligned_le32(val, p);
}


x86 assembly (clang, -O0):
<__put_unaligned_le64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
mov    -0x10(%rbp),%rsi
add    $0x10,%rsi
call   1030 <__put_unaligned_le32@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <__put_unaligned_le32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__put_unaligned_le64>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x10,%rsi
call   1030 <__put_unaligned_le32@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <__put_unaligned_le32@plt>

LLVM IR (-O0):
define void @__put_unaligned_le64(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 = ashr i32 %5, 32
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 4
%9 = call i32 @__put_unaligned_le32(i32 %6, i32* %8)
%10 = load i32, i32* %3
%11 = load i32*, i32** %4
%12 = call i32 @__put_unaligned_le32(i32 %10, i32* %11)
ret void
}

LLVM IR (-O2):
define void @__put_unaligned_le64(i32 %0, i32* %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 4
%4 = tail call i32 @__put_unaligned_le32(i32 poison, i32* %3)
%5 = tail call i32 @__put_unaligned_le32(i32 %0, i32* %1)
ret void
}
int main() {
  int a;
  a = 5;
  int b;
  b = 2;
  return a / b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
void SeNotice(msg) char *msg;
{
  char buf[256];
  sprintf(buf, "\r>> Notice: %s.", msg);
  show(buf);
}


x86 assembly (clang, -O0):
<SeNotice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
mov    $0x0,%al
call   1030 <show@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SeNotice>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <show@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"\0D>> Notice: %s.\00"
define void @SeNotice(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @show to i32 (i8*, ...)*)(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0D>> Notice: %s.\00"
define void @SeNotice(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, i8*, ...) @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @show to i32 (i8*, ...)*)(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void die(int status) { exit(status); }


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

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

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

LLVM IR (-O2):
define void @die(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
struct event {
  int dummy;
};

/* Variables and functions */
int event_open_with_options(struct event *, int /*<<< orphan*/, int, int);
int event_open_with_group(struct event *e, int group_fd) {
  return event_open_with_options(e, 0, -1, group_fd);
}


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

x86 assembly (clang, -O2):
<event_open_with_group>:
mov    %esi,%ecx
xor    %esi,%esi
mov    $0xffffffff,%edx
jmp    1030 <event_open_with_options@plt>

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

LLVM IR (-O2):
%struct.event = type { i32 }
define i32 @event_open_with_group(%struct.event* %0, i32 %1) {
%3 = tail call i32 @event_open_with_options(%struct.event* %0, i32 0, i32 -1, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *integrity_slot_to_str(int slot, char *str) {
  if (slot == -1)
    return "n/a";
  sprintf(str, "%d", slot);
  return str;
}


x86 assembly (clang, -O0):
<integrity_slot_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1139 <integrity_slot_to_str+0x29>
lea    0xed0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <integrity_slot_to_str+0x44>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xebd(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integrity_slot_to_str>:
push   %rbx
cmp    $0xffffffff,%edi
je     112c <integrity_slot_to_str+0x1c>
mov    %rsi,%rbx
mov    %edi,%edx
lea    0xee2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
jmp    1133 <integrity_slot_to_str+0x23>
lea    0xecd(%rip),%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"n/a\00"
@.str.1 = [3 x i8] c"%d\00"
define i8* @integrity_slot_to_str(i32 %0, i8* writeonly %1) {
%3 = icmp eq i32 %0, -1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %2, %4
%7 = phi i8* [ %1, %4 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %2 ]
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ MAP_PRIVATE;
int /*<<< orphan*/ PROT_WRITE;
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int *mmap(int /*<<< orphan*/, int, int /*<<< orphan*/, int /*<<< orphan*/,
          int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ *tmpfile();
int main() {
  FILE *f = tmpfile();
  int *m = mmap(0, 4, PROT_WRITE, MAP_PRIVATE, fileno(f), 0);
  *m = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <tmpfile@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    0x2e7b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <fileno@plt>
mov    -0x20(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    %eax,%r8d
xor    %r9d,%r9d
mov    $0x4,%esi
mov    %r9d,%edi
call   1030 <mmap@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <tmpfile@plt>
mov    0x2e9f(%rip),%rcx
mov    (%rcx),%ebx
mov    0x2e8e(%rip),%rcx
mov    (%rcx),%ebp
mov    %rax,%rdi
call   1050 <fileno@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
movl   $0x0,(%rax)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@PROT_WRITE = global i32 0
@MAP_PRIVATE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* (...) @tmpfile()
store i32* %4, i32** %2
%5 = load i32, i32* @PROT_WRITE
%6 = load i32, i32* @MAP_PRIVATE
%7 = load i32*, i32** %2
%8 = call i32 @fileno(i32* %7)
%9 = call i32* @mmap(i32 0, i32 4, i32 %5, i32 %6, i32 %8, i32 0)
store i32* %9, i32** %3
%10 = load i32*, i32** %3
store i32 0, i32* %10
ret i32 0
}

LLVM IR (-O2):
@PROT_WRITE = global i32 0
@MAP_PRIVATE = global i32 0
define i32 @main() {
%1 = tail call i32* (...) @tmpfile()
%2 = load i32, i32* @PROT_WRITE
%3 = load i32, i32* @MAP_PRIVATE
%4 = tail call i32 @fileno(i32* %1)
%5 = tail call i32* @mmap(i32 0, i32 4, i32 %2, i32 %3, i32 %4, i32 0)
store i32 0, i32* %5
ret i32 0
}
int test(int i) { return i * i; }


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

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

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

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ reverse_argv_elements(char **, int);
void permute(char **argv, int len1, int len2) {
  reverse_argv_elements(argv, len1);
  reverse_argv_elements(argv, len1 + len2);
  reverse_argv_elements(argv, len2);
}


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

x86 assembly (clang, -O2):
<permute>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <reverse_argv_elements@plt>
add    %r14d,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <reverse_argv_elements@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <reverse_argv_elements@plt>

LLVM IR (-O0):
define void @permute(i8** %0, i32 %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8**, i8*** %4
%8 = load i32, i32* %5
%9 = call i32 @reverse_argv_elements(i8** %7, i32 %8)
%10 = load i8**, i8*** %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
%14 = call i32 @reverse_argv_elements(i8** %10, i32 %13)
%15 = load i8**, i8*** %4
%16 = load i32, i32* %6
%17 = call i32 @reverse_argv_elements(i8** %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @permute(i8** %0, i32 %1, i32 %2) {
%4 = tail call i32 @reverse_argv_elements(i8** %0, i32 %1)
%5 = add nsw i32 %2, %1
%6 = tail call i32 @reverse_argv_elements(i8** %0, i32 %5)
%7 = tail call i32 @reverse_argv_elements(i8** %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Bonjour\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%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 = [9 x i8] c"Bonjour\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"Bonjour\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned xrop3_51_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = ~S;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_51_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_51_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
not    %eax
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_51_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %6
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 8
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
store i32 %20, i32* %7
%21 = load i32, i32* %6
%22 = xor i32 %21, -1
store i32 %22, i32* %8
%23 = load i32, i32* %8
%24 = load i32, i32* %6
%25 = xor i32 %24, -1
%26 = and i32 %23, %25
%27 = load i32, i32* %7
%28 = xor i32 %27, -1
%29 = and i32 %26, %28
%30 = load i32, i32* %5
%31 = load i32, i32* %6
%32 = and i32 %30, %31
%33 = or i32 %29, %32
%34 = load i32, i32* %5
%35 = load i32, i32* %7
%36 = and i32 %34, %35
%37 = or i32 %33, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_51_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ out_byte(int, int);
void serial_init() {
  out_byte((0x3F8 + 1), 0x00);
  out_byte((0x3F8 + 3), 0x80);
  out_byte((0x3F8 + 0), 0x03);
  out_byte((0x3F8 + 1), 0x00);
  out_byte((0x3F8 + 3), 0x03);
  out_byte((0x3F8 + 2), 0xC7);
  out_byte((0x3F8 + 4), 0x0B);
}


x86 assembly (clang, -O0):
<serial_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f9,%edi
xor    %esi,%esi
call   1030 <out_byte@plt>
mov    $0x3fb,%edi
mov    $0x80,%esi
call   1030 <out_byte@plt>
mov    $0x3f8,%edi
mov    $0x3,%esi
call   1030 <out_byte@plt>
mov    $0x3f9,%edi
xor    %esi,%esi
call   1030 <out_byte@plt>
mov    $0x3fb,%edi
mov    $0x3,%esi
call   1030 <out_byte@plt>
mov    $0x3fa,%edi
mov    $0xc7,%esi
call   1030 <out_byte@plt>
mov    $0x3fc,%edi
mov    $0xb,%esi
call   1030 <out_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_init>:
push   %rax
mov    $0x3f9,%edi
xor    %esi,%esi
call   1030 <out_byte@plt>
mov    $0x3fb,%edi
mov    $0x80,%esi
call   1030 <out_byte@plt>
mov    $0x3f8,%edi
mov    $0x3,%esi
call   1030 <out_byte@plt>
mov    $0x3f9,%edi
xor    %esi,%esi
call   1030 <out_byte@plt>
mov    $0x3fb,%edi
mov    $0x3,%esi
call   1030 <out_byte@plt>
mov    $0x3fa,%edi
mov    $0xc7,%esi
call   1030 <out_byte@plt>
mov    $0x3fc,%edi
mov    $0xb,%esi
pop    %rax
jmp    1030 <out_byte@plt>

LLVM IR (-O0):
define void @serial_init() {
%1 = call i32 @out_byte(i32 1017, i32 0)
%2 = call i32 @out_byte(i32 1019, i32 128)
%3 = call i32 @out_byte(i32 1016, i32 3)
%4 = call i32 @out_byte(i32 1017, i32 0)
%5 = call i32 @out_byte(i32 1019, i32 3)
%6 = call i32 @out_byte(i32 1018, i32 199)
%7 = call i32 @out_byte(i32 1020, i32 11)
ret void
}

LLVM IR (-O2):
define void @serial_init() {
%1 = tail call i32 @out_byte(i32 1017, i32 0)
%2 = tail call i32 @out_byte(i32 1019, i32 128)
%3 = tail call i32 @out_byte(i32 1016, i32 3)
%4 = tail call i32 @out_byte(i32 1017, i32 0)
%5 = tail call i32 @out_byte(i32 1019, i32 3)
%6 = tail call i32 @out_byte(i32 1018, i32 199)
%7 = tail call i32 @out_byte(i32 1020, i32 11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EAGAIN;
int /*<<< orphan*/ errno;
__attribute__((weak)) int _fork() {
  errno = EAGAIN;
  return -1;
}


x86 assembly (clang, -O0):
<_fork>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ecc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fork>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EAGAIN = global i32 0
@errno = global i32 0
define weak i32 @_fork() {
%1 = load i32, i32* @EAGAIN
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EAGAIN = global i32 0
@errno = global i32 0
define weak i32 @_fork() {
%1 = load i32, i32* @EAGAIN
store i32 %1, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ do_tohost(int);
void terminate(int code) {
  do_tohost(code);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <do_tohost@plt>
jmp    1123 <terminate+0x13>

x86 assembly (clang, -O2):
<terminate>:
push   %rax
call   1030 <do_tohost@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1120 <terminate+0x10>

LLVM IR (-O0):
define void @terminate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @do_tohost(i32 %3)
br label %5
5: ; preds = %1, %5
br label %5
}

LLVM IR (-O2):
define void @terminate(i32 %0) {
%2 = tail call i32 @do_tohost(i32 %0)
br label %3
3: ; preds = %1, %3
br label %3
}
int rgb_shift_make_from_def(unsigned len, unsigned pos) {
  return pos + len - 8;
}


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

x86 assembly (clang, -O2):
<rgb_shift_make_from_def>:
lea    (%rdi,%rsi,1),%eax
add    $0xfffffff8,%eax
ret

LLVM IR (-O0):
define i32 @rgb_shift_make_from_def(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %5, %6
%8 = sub i32 %7, 8
ret i32 %8
}

LLVM IR (-O2):
define i32 @rgb_shift_make_from_def(i32 %0, i32 %1) {
%3 = add i32 %0, -8
%4 = add i32 %3, %1
ret i32 %4
}
/* Variables and functions */
double ReflexTestData_GetAverageResponseTime();
double LcdModel_GetAverageResponseTime() {
  return ReflexTestData_GetAverageResponseTime();
}


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

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

LLVM IR (-O0):
define double @LcdModel_GetAverageResponseTime() {
%1 = call double (...) @ReflexTestData_GetAverageResponseTime()
ret double %1
}

LLVM IR (-O2):
define double @LcdModel_GetAverageResponseTime() {
%1 = tail call double (...) @ReflexTestData_GetAverageResponseTime()
ret double %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void stub1(int, int, int, int);
void OSCXHfPowerModeSet(uint32_t ui32Mode) {

  ;
  ((void (*)(uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Mask,
             uint32_t ui32WrData))(
      (uint32_t *)(((uint32_t *)0x10000180)[9]))[0])(0x400CA000, 0x00000000,
                                                     0x00000800, ui32Mode);
}


x86 assembly (clang, -O0):
<OSCXHfPowerModeSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x10000180,%eax
movslq 0x24(%rax),%rax
movslq (%rax),%rax
mov    -0x4(%rbp),%ecx
mov    $0x400ca000,%edi
xor    %esi,%esi
mov    $0x800,%edx
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSCXHfPowerModeSet>:
mov    %edi,%ecx
movslq 0x100001a4,%rax
10
movslq (%rax),%rax
mov    $0x400ca000,%edi
xor    %esi,%esi
mov    $0x800,%edx
jmp    *%rax

LLVM IR (-O0):
define void @OSCXHfPowerModeSet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* getelementptr inbounds (i32, i32* inttoptr (i64 268435840 to i32*), i64 9)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to void (i32, i32, i32, i32)*
%10 = load i32, i32* %2
ret void
}

LLVM IR (-O2):
define void @OSCXHfPowerModeSet(i32 %0) {
%2 = load i32, i32* inttoptr (i64 268435876 to i32*)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to void (i32, i32, i32, i32)*
tail call void %7(i32 1074569216, i32 0, i32 2048, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(float *);
int /*<<< orphan*/ functionTestLoop(float *, size_t);
float *malloc(int);
int main(int argc, char **argv) {
  size_t size = 5;
  float *tabFloat = malloc(sizeof(float) * size);
  functionTestLoop(tabFloat, size);
  free(tabFloat);
  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)
movq   $0x5,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <functionTestLoop@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0x5,%esi
mov    %rax,%rdi
call   1040 <functionTestLoop@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca float*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 5, i64* %6
%8 = load i64, i64* %6
%9 = mul i64 4, %8
%10 = trunc i64 %9 to i32
%11 = call float* @malloc(i32 %10)
store float* %11, float** %7
%12 = load float*, float** %7
%13 = load i64, i64* %6
%14 = call i32 @functionTestLoop(float* %12, i64 %13)
%15 = load float*, float** %7
%16 = call i32 @free(float* %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call float* @malloc(i32 20)
%4 = tail call i32 @functionTestLoop(float* %3, i64 5)
%5 = tail call i32 @free(float* %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int getpid();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
pid_t saferFork() {
  fprintf(stderr, "process <%d> calling fork() in 5 seconds...", getpid());
  sleep(5);
  fprintf(stderr, "calling fork now!\n");
  return fork();
}


x86 assembly (clang, -O0):
<saferFork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%edx
lea    0xe99(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x5,%edi
call   1050 <sleep@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1060 <fork@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saferFork>:
push   %r14
push   %rbx
push   %rax
mov    0x2e95(%rip),%r14
mov    (%r14),%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xea4(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x5,%edi
call   1050 <sleep@plt>
mov    (%r14),%edi
lea    0xeb1(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <fork@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"process <%d> calling fork() in 5 seconds...\00"
@.str.1 = [19 x i8] c"calling fork now!\0A\00"
define i32 @saferFork() {
%1 = load i32, i32* @stderr
%2 = call i32 (...) @getpid()
%3 = call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @sleep(i32 5)
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @fork()
ret i32 %7
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"process <%d> calling fork() in 5 seconds...\00"
@.str.1 = [19 x i8] c"calling fork now!\0A\00"
define i32 @saferFork() {
%1 = load i32, i32* @stderr
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @sleep(i32 5)
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 (...) @fork()
ret i32 %7
}
int test_imm_4Cint64_lowword_mem(long long *val) {
  return ((*val) & (0x4C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_4Cint64_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, 76
%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_4Cint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 76
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int type1(int *, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
          int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int show(void *v) {
  int *msgvec = v;
  return (type1(msgvec, 0, 0, 0, 1, NULL, NULL));
}


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %ecx,%ecx
mov    $0x1,%r8d
xor    %eax,%eax
mov    %eax,%r9d
mov    %ecx,%esi
mov    %ecx,%edx
movq   $0x0,(%rsp)
call   1030 <type1@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
push   %rax
movq   $0x0,(%rsp)
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1030 <type1@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @show(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @type1(i32* %6, i32 0, i32 0, i32 0, i32 1, i32* null, i32* null)
ret i32 %7
}

LLVM IR (-O2):
define i32 @show(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @type1(i32* %2, i32 0, i32 0, i32 0, i32 1, i32* null, i32* null)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ IAMorpionDifficile();
int /*<<< orphan*/ IAMorpionFacile();
int /*<<< orphan*/ IAMorpionNormal();
void IAMorpion(int niveauDifficulte) {
  switch (niveauDifficulte) {
  case 1:
    IAMorpionFacile();
    break;
  case 2:
    IAMorpionNormal();
    break;
  case 3:
    IAMorpionDifficile();
    break;
  }
}


x86 assembly (clang, -O0):
<IAMorpion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     1171 <IAMorpion+0x41>
jmp    114f <IAMorpion+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     117d <IAMorpion+0x4d>
jmp    1160 <IAMorpion+0x30>
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
je     1189 <IAMorpion+0x59>
jmp    1190 <IAMorpion+0x60>
mov    $0x0,%al
call   1050 <IAMorpionFacile@plt>
jmp    1190 <IAMorpion+0x60>
mov    $0x0,%al
call   1030 <IAMorpionNormal@plt>
jmp    1190 <IAMorpion+0x60>
mov    $0x0,%al
call   1040 <IAMorpionDifficile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IAMorpion>:
cmp    $0x3,%edi
je     1146 <IAMorpion+0x16>
cmp    $0x2,%edi
je     114d <IAMorpion+0x1d>
cmp    $0x1,%edi
jne    1154 <IAMorpion+0x24>
xor    %eax,%eax
jmp    1050 <IAMorpionFacile@plt>
xor    %eax,%eax
jmp    1040 <IAMorpionDifficile@plt>
xor    %eax,%eax
jmp    1030 <IAMorpionNormal@plt>
ret

LLVM IR (-O0):
define void @IAMorpion(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %10 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
]
4: ; preds = %1
%5 = call i32 (...) @IAMorpionFacile()
br label %10
6: ; preds = %1
%7 = call i32 (...) @IAMorpionNormal()
br label %10
8: ; preds = %1
%9 = call i32 (...) @IAMorpionDifficile()
br label %10
10: ; preds = %1, %8, %6, %4
ret void
}

LLVM IR (-O2):
define void @IAMorpion(i32 %0) {
switch i32 %0, label %8 [
i32 1, label %2
i32 2, label %4
i32 3, label %6
]
2: ; preds = %1
%3 = tail call i32 (...) @IAMorpionFacile()
br label %8
4: ; preds = %1
%5 = tail call i32 (...) @IAMorpionNormal()
br label %8
6: ; preds = %1
%7 = tail call i32 (...) @IAMorpionDifficile()
br label %8
8: ; preds = %1, %6, %4, %2
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int width;
};
typedef TYPE_1__ Screen;

/* Variables and functions */
void set_Screen_width(void *_p, int _v) { ((Screen *)_p)->width = (int)_v; }


x86 assembly (clang, -O0):
<set_Screen_width>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_Screen_width>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_Screen_width(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
struct Pl_utl_iobuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(void *);
int /*<<< orphan*/ free(void *);
void iobuf_free(struct Pl_utl_iobuf *_buf_p) {
  void *buf_p = (void *)_buf_p;
  assert(buf_p);
  free(buf_p);
}


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

x86 assembly (clang, -O2):
<iobuf_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.Pl_utl_iobuf = type { i32 }
define void @iobuf_free(%struct.Pl_utl_iobuf* %0) {
%2 = alloca %struct.Pl_utl_iobuf*
%3 = alloca i8*
store %struct.Pl_utl_iobuf* %0, %struct.Pl_utl_iobuf** %2
%4 = load %struct.Pl_utl_iobuf*, %struct.Pl_utl_iobuf** %2
%5 = bitcast %struct.Pl_utl_iobuf* %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @assert(i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
%struct.Pl_utl_iobuf = type { i32 }
define void @iobuf_free(%struct.Pl_utl_iobuf* %0) {
%2 = bitcast %struct.Pl_utl_iobuf* %0 to i8*
%3 = tail call i32 @assert(i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
scalar_t__ superlu_malloc(int);
double *doubleMalloc(int n) {
  double *buf;
  buf = (double *)superlu_malloc(n * sizeof(double));
  if (!buf) {
    fprintf(stderr, "SUPERLU_MALLOC failed for buf in doubleMalloc()");
    exit(1);
  }
  return (buf);
}


x86 assembly (clang, -O0):
<doubleMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <superlu_malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1178 <doubleMalloc+0x48>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xe97(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubleMalloc>:
push   %rax
shl    $0x3,%edi
call   1040 <superlu_malloc@plt>
test   %rax,%rax
je     1140 <doubleMalloc+0x10>
pop    %rcx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"SUPERLU_MALLOC failed for buf in doubleMalloc()\00"
define double* @doubleMalloc(i32 %0) {
%2 = alloca i32
%3 = alloca double*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 8
%7 = trunc i64 %6 to i32
%8 = call i64 @superlu_malloc(i32 %7)
%9 = inttoptr i64 %8 to double*
store double* %9, double** %3
%10 = load double*, double** %3
%11 = icmp ne double* %10, null
br i1 %11, label %16, label %12
12: ; preds = %1
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %1
%17 = load double*, double** %3
ret double* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"SUPERLU_MALLOC failed for buf in doubleMalloc()\00"
define double* @doubleMalloc(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call i64 @superlu_malloc(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = inttoptr i64 %3 to double*
ret double* %10
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ towers(int, char, char, char);
int main() {
  int x;
  scanf("%d", &x);
  towers(x, 'A', 'B', 'C');
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1040 <towers@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @towers(i32 %4, i8 signext 65, i8 signext 66, i8 signext 67)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @towers(i32 %4, i8 signext 65, i8 signext 66, i8 signext 67)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int /*<<< orphan*/ memset(short *, int, int);
void memset28() {
  short x;
  memset(&x, 1, sizeof(short));
  clang_analyzer_eval(x == 0x101);
}


x86 assembly (clang, -O0):
<memset28>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x2(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <memset@plt>
movswl -0x2(%rbp),%eax
cmp    $0x101,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset28>:
push   %rax
lea    0x6(%rsp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <memset@plt>
movzwl 0x6(%rsp),%eax
xor    %edi,%edi
cmp    $0x101,%eax
sete   %dil
call   1040 <clang_analyzer_eval@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @memset28() {
%1 = alloca i16
%2 = call i32 @memset(i16* %1, i32 1, i32 2)
%3 = load i16, i16* %1
%4 = sext i16 %3 to i32
%5 = icmp eq i32 %4, 257
%6 = zext i1 %5 to i32
%7 = call i32 @clang_analyzer_eval(i32 %6)
ret void
}

LLVM IR (-O2):
define void @memset28() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
%3 = call i32 @memset(i16* %1, i32 1, i32 2)
%4 = load i16, i16* %1
%5 = icmp eq i16 %4, 257
%6 = zext i1 %5 to i32
%7 = call i32 @clang_analyzer_eval(i32 %6)
ret void
}
void updateOverflow(unsigned char ovf, unsigned int *reg) {
  reg -= 2;
  if (ovf) {
    *reg |= (1 << 28);
  } else {
    *reg &= ~(1 << 28);
  }
}


x86 assembly (clang, -O0):
<updateOverflow>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1137 <updateOverflow+0x37>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
or     $0x10000000,%ecx
mov    %ecx,(%rax)
jmp    1145 <updateOverflow+0x45>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
and    $0xefffffff,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateOverflow>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
mov    $0xefffffff,%ecx
and    -0x8(%rsi),%ecx
shl    $0x1c,%eax
or     %ecx,%eax
mov    %eax,-0x8(%rsi)
ret

LLVM IR (-O0):
define void @updateOverflow(i8 zeroext %0, i32* %1) {
%3 = alloca i8
%4 = alloca i32*
store i8 %0, i8* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 -2
store i32* %6, i32** %4
%7 = load i8, i8* %3
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = or i32 %11, 268435456
store i32 %12, i32* %10
br label %17
13: ; preds = %2
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = and i32 %15, -268435457
store i32 %16, i32* %14
br label %17
17: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
define void @updateOverflow(i8 zeroext %0, i32* nocapture %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 -2
%4 = icmp eq i8 %0, 0
%5 = load i32, i32* %3
%6 = and i32 %5, -268435457
%7 = select i1 %4, i32 0, i32 268435456
%8 = or i32 %6, %7
store i32 %8, i32* %3
ret void
}
/* Variables and functions */
int wcsutrne(int, char *, int);
int wcsutrn(int ctrl, char unitstr[]) { return wcsutrne(ctrl, unitstr, 0x0); }


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

x86 assembly (clang, -O2):
<wcsutrn>:
xor    %edx,%edx
jmp    1030 <wcsutrne@plt>

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

LLVM IR (-O2):
define i32 @wcsutrn(i32 %0, i8* %1) {
%3 = tail call i32 @wcsutrne(i32 %0, i8* %1, i32 0)
ret i32 %3
}