xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ sprintf(char *, char const *);
void str_concat(char *buf, int *len, const char *str) {
  *len += sprintf(buf + *len, str);
}


x86 assembly (clang, -O0):
<str_concat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <sprintf@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
movslq (%rax),%rcx
add    %rdx,%rcx
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_concat>:
push   %rbx
mov    %rsi,%rbx
movslq (%rsi),%rax
add    %rax,%rdi
mov    %rdx,%rsi
call   1030 <sprintf@plt>
add    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @str_concat(i8* %0, i32* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %7, i64 %10
%12 = load i8*, i8** %6
%13 = call i64 @sprintf(i8* %11, i8* %12)
%14 = load i32*, i32** %5
%15 = load i32, i32* %14
%16 = sext i32 %15 to i64
%17 = add nsw i64 %16, %13
%18 = trunc i64 %17 to i32
store i32 %18, i32* %14
ret void
}

LLVM IR (-O2):
define void @str_concat(i8* %0, i32* nocapture %1, i8* %2) {
%4 = load i32, i32* %1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = tail call i64 @sprintf(i8* %6, i8* %2)
%8 = load i32, i32* %1
%9 = trunc i64 %7 to i32
%10 = add i32 %8, %9
store i32 %10, i32* %1
ret void
}
int g3(__attribute((blah)) int x, __attribute((blah)) int y) {}


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

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

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

LLVM IR (-O2):
define i32 @g3(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ console_header();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ message_error(char *);
int /*<<< orphan*/ type_command(int, char **);
void check_args(int argc, char **argv) {
  if (argc < 2) {
    console_header();
    message_error("Gnu emu need arguments");
    exit(1);
  } else {
    type_command(argc, argv);
  }
}


x86 assembly (clang, -O0):
<check_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1176 <check_args+0x36>
mov    $0x0,%al
call   1050 <console_header@plt>
lea    0xe99(%rip),%rdi
call   1030 <message_error@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <type_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_args>:
cmp    $0x1,%edi
jle    114a <check_args+0xa>
jmp    1040 <type_command@plt>
push   %rax
xor    %eax,%eax
call   1050 <console_header@plt>
lea    0xea7(%rip),%rdi
call   1030 <message_error@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Gnu emu need arguments\00"
define void @check_args(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 = icmp slt i32 %5, 2
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = call i32 (...) @console_header()
%9 = call i32 @message_error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = load i32, i32* %3
%13 = load i8**, i8*** %4
%14 = call i32 @type_command(i32 %12, i8** %13)
br label %15
15: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Gnu emu need arguments\00"
define void @check_args(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 (...) @console_header()
%6 = tail call i32 @message_error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = tail call i32 @type_command(i32 %0, i8** %1)
ret void
}
void test___atomic_sub_fetch_2(int *mem) { __atomic_sub_fetch(mem, 1, 4); }


x86 assembly (clang, -O0):
<test___atomic_sub_fetch_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,%eax
neg    %eax
lock xadd %eax,(%rdx)
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_sub_fetch_2>:
lock subl $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test___atomic_sub_fetch_2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
store i32 1, i32* %3
%6 = load i32, i32* %3
%7 = atomicrmw sub i32* %5, i32 %6 acq_rel
%8 = sub i32 %7, %6
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_sub_fetch_2(i32* nocapture %0) {
%2 = atomicrmw sub i32* %0, i32 1 acq_rel
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_write(char *, int);
void console_backspace(int n) {
  int t;
  for (t = 0; t < n; t++)
    console_write("\b", 1);
}


x86 assembly (clang, -O0):
<console_backspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114d <console_backspace+0x3d>
lea    0xecb(%rip),%rdi
mov    $0x1,%esi
call   1030 <console_write@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <console_backspace+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_backspace>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1142 <console_backspace+0x32>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x1,%esi
call   1030 <console_write@plt>
add    $0xffffffff,%ebx
jne    1130 <console_backspace+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\08\00"
define void @console_backspace(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @console_write(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
int uninitialize_tuncompress() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @uninitialize_tuncompress() {
ret i32 0
}
/* Type definitions */
struct nlmsghdr {
  int dummy;
};
struct nlattr {
  int dummy;
};

/* Variables and functions */
struct nlattr *nla_find(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ nlmsg_attrdata(struct nlmsghdr *, int);
int /*<<< orphan*/ nlmsg_attrlen(struct nlmsghdr *, int);
struct nlattr *nlmsg_find_attr(struct nlmsghdr *nlh, int hdrlen, int attrtype) {
  return nla_find(nlmsg_attrdata(nlh, hdrlen), nlmsg_attrlen(nlh, hdrlen),
                  attrtype);
}


x86 assembly (clang, -O0):
<nlmsg_find_attr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <nlmsg_attrdata@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <nlmsg_attrlen@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
mov    -0x10(%rbp),%edx
call   1050 <nla_find@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nlmsg_find_attr>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <nlmsg_attrdata@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <nlmsg_attrlen@plt>
mov    %r15d,%edi
mov    %eax,%esi
mov    %r14d,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <nla_find@plt>

LLVM IR (-O0):
%struct.nlattr = type { i32 }
%struct.nlmsghdr = type { i32 }
define %struct.nlattr* @nlmsg_find_attr(%struct.nlmsghdr* %0, i32 %1, i32 %2) {
%4 = alloca %struct.nlmsghdr*
%5 = alloca i32
%6 = alloca i32
store %struct.nlmsghdr* %0, %struct.nlmsghdr** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.nlmsghdr*, %struct.nlmsghdr** %4
%8 = load i32, i32* %5
%9 = call i32 @nlmsg_attrdata(%struct.nlmsghdr* %7, i32 %8)
%10 = load %struct.nlmsghdr*, %struct.nlmsghdr** %4
%11 = load i32, i32* %5
%12 = call i32 @nlmsg_attrlen(%struct.nlmsghdr* %10, i32 %11)
%13 = load i32, i32* %6
%14 = call %struct.nlattr* @nla_find(i32 %9, i32 %12, i32 %13)
ret %struct.nlattr* %14
}

LLVM IR (-O2):
%struct.nlattr = type { i32 }
%struct.nlmsghdr = type { i32 }
define %struct.nlattr* @nlmsg_find_attr(%struct.nlmsghdr* %0, i32 %1, i32 %2) {
%4 = tail call i32 @nlmsg_attrdata(%struct.nlmsghdr* %0, i32 %1)
%5 = tail call i32 @nlmsg_attrlen(%struct.nlmsghdr* %0, i32 %1)
%6 = tail call %struct.nlattr* @nla_find(i32 %4, i32 %5, i32 %2)
ret %struct.nlattr* %6
}
void ff_hevc_put_hevc_bi_w_qpel_h24_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_h24_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ interrupt(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
void printString(char *str) {
  unsigned int i = 0;
  while (str[i] != '\0') {
    interrupt(0x10, 0xe * 256 + str[i], 0, 0, 0);
    i++;
  }
}


x86 assembly (clang, -O0):
<printString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1169 <printString+0x59>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%esi
add    $0xe00,%esi
mov    $0x10,%edi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <interrupt@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printString+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printString>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1157 <printString+0x47>
mov    %rdi,%rbx
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
add    $0xe00,%esi
mov    $0x10,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <interrupt@plt>
mov    %ebp,%eax
movzbl (%rbx,%rax,1),%eax
add    $0x1,%ebp
test   %al,%al
jne    1130 <printString+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @printString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = sext i8 %5 to i32
%8 = add nsw i32 %7, 3584
%9 = tail call i32 @interrupt(i32 16, i32 %8, i32 0, i32 0, i32 0)
%10 = add i32 %6, 1
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void fatal(int assert, const char message[], int status) {
  if (assert) {
    printf("%s\n", message);
    exit(status);
  }
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1154 <fatal+0x34>
mov    -0x10(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatal>:
test   %edi,%edi
jne    1125 <fatal+0x5>
ret
push   %rbx
mov    %edx,%ebx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @fatal(i32 %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = tail call i32 @exit(i32 %2)
unreachable
8: ; preds = %3
ret void
}
/* Variables and functions */
int syscall1(int);
int gettid() { return syscall1(21); }


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

x86 assembly (clang, -O2):
<gettid>:
mov    $0x15,%edi
jmp    1030 <syscall1@plt>

LLVM IR (-O0):
define i32 @gettid() {
%1 = call i32 @syscall1(i32 21)
ret i32 %1
}

LLVM IR (-O2):
define i32 @gettid() {
%1 = tail call i32 @syscall1(i32 21)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int do_errors() { printf("assume no error\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"assume no error\0A\00"
define i32 @do_errors() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [16 x i8] c"assume no error\00"
define i32 @do_errors() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ alloc_and_load_placement_structs();
int /*<<< orphan*/ read_place();
void place_and_route() {
  read_place();
  alloc_and_load_placement_structs();
}


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

x86 assembly (clang, -O2):
<place_and_route>:
push   %rax
xor    %eax,%eax
call   1040 <read_place@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <alloc_and_load_placement_structs@plt>

LLVM IR (-O0):
define void @place_and_route() {
%1 = call i32 (...) @read_place()
%2 = call i32 (...) @alloc_and_load_placement_structs()
ret void
}

LLVM IR (-O2):
define void @place_and_route() {
%1 = tail call i32 (...) @read_place()
%2 = tail call i32 (...) @alloc_and_load_placement_structs()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void adts_set_cp_id(uint8_t *p_adts, bool b_bit, bool b_start) {
  p_adts[3] &= ~0x0c;
  if (b_bit)
    p_adts[3] |= 0x08;
  if (b_start)
    p_adts[3] |= 0x04;
}


x86 assembly (clang, -O0):
<adts_set_cp_id>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
and    $0xfffffff3,%ecx
mov    %ecx,0xc(%rax)
cmpl   $0x0,-0xc(%rbp)
je     1132 <adts_set_cp_id+0x32>
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
or     $0x8,%ecx
mov    %ecx,0xc(%rax)
cmpl   $0x0,-0x10(%rbp)
je     1149 <adts_set_cp_id+0x49>
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
or     $0x4,%ecx
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<adts_set_cp_id>:
mov    0xc(%rdi),%eax
and    $0xfffffff3,%eax
lea    0x8(%rax),%ecx
test   %esi,%esi
cmove  %eax,%ecx
lea    0x4(%rcx),%eax
test   %edx,%edx
cmove  %ecx,%eax
mov    %eax,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @adts_set_cp_id(i32* nocapture %0, i32 %1, i32 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 3
%5 = load i32, i32* %4
%6 = and i32 %5, -13
%7 = icmp eq i32 %1, 0
%8 = or i32 %6, 8
%9 = select i1 %7, i32 %6, i32 %8
%10 = icmp eq i32 %2, 0
%11 = or i32 %9, 4
%12 = select i1 %10, i32 %9, i32 %11
store i32 %12, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((constructor)) void beginB(void) { printf("ctor b\n"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"ctor b\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @beginB, i8* null }]
define void @beginB() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @beginB, i8* null }]
@str = [7 x i8] c"ctor b\00"
define void @beginB() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ japi_setradiogroup(int, int);
void j_setradiogroup(int arg0, int arg1) { japi_setradiogroup(arg0, arg1); }


x86 assembly (clang, -O0):
<j_setradiogroup>:
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 <japi_setradiogroup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_setradiogroup>:
jmp    1030 <japi_setradiogroup@plt>

LLVM IR (-O0):
define void @j_setradiogroup(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 @japi_setradiogroup(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @j_setradiogroup(i32 %0, i32 %1) {
%3 = tail call i32 @japi_setradiogroup(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wm_debug(char *);
void grow_left() { wm_debug("Growing left."); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Growing left.\00"
define void @grow_left() {
%1 = call i32 @wm_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Growing left.\00"
define void @grow_left() {
%1 = tail call i32 @wm_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
void increm(int *i) { (*i)++; }


x86 assembly (clang, -O0):
<increm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<increm>:
addl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @increm(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
void XkbChangeEnabledControls() {}


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

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

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

LLVM IR (-O2):
define void @XkbChangeEnabledControls() {
ret void
}
int main() { return -1 >> 1; }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 -1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 -1
}
void packi16(unsigned char *buf, unsigned int i) {
  *buf++ = i >> 8;
  *buf++ = i;
}


x86 assembly (clang, -O0):
<packi16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<packi16>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @packi16(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 = lshr i32 %5, 8
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %3
store i8 %7, i8* %8
%10 = load i32, i32* %4
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @packi16(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %0
%6 = trunc i32 %1 to i8
store i8 %6, i8* %5
ret void
}
int foo3(void) { return 3; }


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

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

LLVM IR (-O0):
define i32 @foo3() {
ret i32 3
}

LLVM IR (-O2):
define i32 @foo3() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int padcon_prompt_for_homogenization(void) {
  char ans, nlsb;
  printf("\nRunning in homogeneous coordinates ? (y/n) ? ");
  scanf("%c", &ans);
  scanf("%c", &nlsb);
  if (ans == 'y')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<padcon_prompt_for_homogenization>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xee4(%rip),%rdi
lea    -0x6(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x79,%eax
jne    116d <padcon_prompt_for_homogenization+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1174 <padcon_prompt_for_homogenization+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padcon_prompt_for_homogenization>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
lea    0xef7(%rip),%rbx
lea    0xe(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
xor    %eax,%eax
cmpb   $0x79,0xe(%rsp)
sete   %al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"\0ARunning in homogeneous coordinates ? (y/n) ? \00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @padcon_prompt_for_homogenization() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 121
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 1, i32* %1
br label %12
11: ; preds = %0
store i32 0, i32* %1
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [47 x i8] c"\0ARunning in homogeneous coordinates ? (y/n) ? \00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @padcon_prompt_for_homogenization() {
%1 = alloca i8
%2 = alloca i8
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%6 = load i8, i8* %1
%7 = icmp eq i8 %6, 121
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int thisFunctionTerminatesTheProcess() { abort(); }


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

x86 assembly (clang, -O2):
<thisFunctionTerminatesTheProcess>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @thisFunctionTerminatesTheProcess() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @thisFunctionTerminatesTheProcess() {
%1 = tail call i32 (...) @abort()
unreachable
}
void f() {
  __int128 a;
  a = (char)3;
  a = (short)3;
  a = 3;
  a = 3l;
  a = 3ll;
  a = 3u;
  a = 3ul;
  a = 3ull;
  a = 3.4f;
  a = 3.4;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
movq   $0x3,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
movq   $0x3,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
movq   $0x3,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
movq   $0x3,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
movq   $0x3,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
movq   $0x3,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
movq   $0x3,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
movq   $0x3,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
movq   $0x3,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
movq   $0x3,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f() {
%1 = alloca i128
store i128 3, i128* %1
store i128 3, i128* %1
store i128 3, i128* %1
store i128 3, i128* %1
store i128 3, i128* %1
store i128 3, i128* %1
store i128 3, i128* %1
store i128 3, i128* %1
store i128 3, i128* %1
store i128 3, i128* %1
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void derefA(int *arg143) {
  int *p98;
  p98 = arg143;
  printf("%d\n", *p98);
  return;
}


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

x86 assembly (clang, -O2):
<derefA>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @derefA(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int quicksort_partition(long *, int, int);
void quicksort_sort(long *array, int lo, int hi) {
  int j = quicksort_partition(array, lo, hi);
  quicksort_sort(array, lo, j - 1);
  quicksort_sort(array, j + 1, hi);
}


x86 assembly (clang, -O0):
<quicksort_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <quicksort_partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <quicksort_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <quicksort_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
nop
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <quicksort_partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <quicksort_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
jmp    1130 <quicksort_sort+0x10>

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

LLVM IR (-O2):
define void @quicksort_sort(i64* %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i32 [ %1, %3 ], [ %8, %4 ]
%6 = tail call i32 @quicksort_partition(i64* %0, i32 %5, i32 %2)
%7 = add nsw i32 %6, -1
tail call void @quicksort_sort(i64* %0, i32 %5, i32 %7)
%8 = add nsw i32 %6, 1
br label %4
}
/* Variables and functions */
int InitConnection(char const *);
int InitLogFile(char const *);
int InitLog(const char *appName) {
  int result = InitLogFile(appName);
  result &= InitConnection(appName);
  return result;
}


x86 assembly (clang, -O0):
<InitLog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <InitLogFile@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <InitConnection@plt>
and    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitLog>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <InitLogFile@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <InitConnection@plt>
and    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @InitLog(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @InitLogFile(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @InitConnection(i8* %6)
%8 = load i32, i32* %3
%9 = and i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @InitLog(i8* %0) {
%2 = tail call i32 @InitLogFile(i8* %0)
%3 = tail call i32 @InitConnection(i8* %0)
%4 = and i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int def(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", def(4));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1040 <def@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @def(i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int test_07(unsigned short *x, int i) { return x[i]; }


x86 assembly (clang, -O0):
<test_07>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzwl (%rax,%rcx,2),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_07>:
movslq %esi,%rax
movzwl (%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @test_07(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
store i16* %0, i16** %3
store i32 %1, i32* %4
%5 = load i16*, i16** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i16, i16* %5, i64 %7
%9 = load i16, i16* %8
%10 = zext i16 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @test_07(i16* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i16, i16* %0, i64 %3
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
ret i32 %6
}
double nd_vi(double redchan, double nirchan) {
  double result;
  if ((nirchan + redchan) == 0.0) {
    result = -1.0;
  } else {
    result = (nirchan - redchan) / (nirchan + redchan);
  }
  return result;
}


x86 assembly (clang, -O0):
<nd_vi>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    113d <nd_vi+0x3d>
jp     113d <nd_vi+0x3d>
movsd  0xecd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    115a <nd_vi+0x5a>
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nd_vi>:
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm2
jne    111d <nd_vi+0x1d>
jp     111d <nd_vi+0x1d>
movsd  0xee4(%rip),%xmm0
ret
subsd  %xmm0,%xmm1
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @nd_vi(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fadd double %6, %7
%9 = fcmp oeq double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %2
store double -1.000000e+00, double* %5
br label %19
11: ; preds = %2
%12 = load double, double* %4
%13 = load double, double* %3
%14 = fsub double %12, %13
%15 = load double, double* %4
%16 = load double, double* %3
%17 = fadd double %15, %16
%18 = fdiv double %14, %17
store double %18, double* %5
br label %19
19: ; preds = %11, %10
%20 = load double, double* %5
ret double %20
}

LLVM IR (-O2):
define double @nd_vi(double %0, double %1) {
%3 = fadd double %0, %1
%4 = fcmp oeq double %3, 0.000000e+00
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = fsub double %1, %0
%7 = fdiv double %6, %3
br label %8
8: ; preds = %2, %5
%9 = phi double [ %7, %5 ], [ -1.000000e+00, %2 ]
ret double %9
}
long long int llabs(long long int i) { return i < 0 ? -i : i; }


x86 assembly (clang, -O0):
<llabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <llabs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <llabs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llabs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @llabs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @llabs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Type definitions */
struct srcu_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BUG();
int __srcu_read_lock(struct srcu_struct *sp) {
  BUG();
  return 1;
}


x86 assembly (clang, -O0):
<__srcu_read_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <BUG@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.srcu_struct = type { i32 }
define i32 @__srcu_read_lock(%struct.srcu_struct* %0) {
%2 = alloca %struct.srcu_struct*
store %struct.srcu_struct* %0, %struct.srcu_struct** %2
%3 = call i32 (...) @BUG()
ret i32 1
}

LLVM IR (-O2):
%struct.srcu_struct = type { i32 }
define i32 @__srcu_read_lock(%struct.srcu_struct* nocapture readnone %0) {
%2 = tail call i32 (...) @BUG()
ret i32 1
}
/* Variables and functions */
char *jsonCmd(char *, int);
char *jsonCmdStartNetwork(void) { return (jsonCmd("startnwk", 1)); }


x86 assembly (clang, -O0):
<jsonCmdStartNetwork>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <jsonCmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsonCmdStartNetwork>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <jsonCmd@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"startnwk\00"
define i8* @jsonCmdStartNetwork() {
%1 = call i8* @jsonCmd(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1)
ret i8* %1
}

LLVM IR (-O2):
@.str = [9 x i8] c"startnwk\00"
define i8* @jsonCmdStartNetwork() {
%1 = tail call i8* @jsonCmd(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1)
ret i8* %1
}
float ps2_sec_to_msec(float sec) { return sec * 1000.0f; }


x86 assembly (clang, -O0):
<ps2_sec_to_msec>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @ps2_sec_to_msec(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 1.000000e+03
ret float %4
}

LLVM IR (-O2):
define float @ps2_sec_to_msec(float %0) {
%2 = fmul float %0, 1.000000e+03
ret float %2
}
/* Variables and functions */
scalar_t__ test0();
scalar_t__ test1();
int main() { return test0() && test1(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test0@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1159 <main+0x39>
mov    $0x0,%al
call   1030 <test1@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <test0@plt>
test   %rax,%rax
je     113e <main+0x1e>
xor    %eax,%eax
call   1030 <test1@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @test0()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i64 (...) @test1()
%6 = icmp ne i64 %5, 0
br label %7
7: ; preds = %4, %0
%8 = phi i1 [ false, %0 ], [ %6, %4 ]
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @test0()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 (...) @test1()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ glDisable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
void light(void) {
  static int l = 1;
  if (l ^= 1)
    glEnable(GL_LIGHTING);
  else
    glDisable(GL_LIGHTING);
}


x86 assembly (clang, -O0):
<light>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f06(%rip),%eax
xor    $0x1,%eax
mov    %eax,0x2efd(%rip)
cmp    $0x0,%eax
je     114f <light+0x2f>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
jmp    115d <light+0x3d>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1040 <glDisable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<light>:
xorl   $0x1,0x2f09(%rip)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
je     1137 <light+0x17>
jmp    1030 <glEnable@plt>
jmp    1040 <glDisable@plt>

LLVM IR (-O0):
@light.l = internal global i32 1
@GL_LIGHTING = global i32 0
define void @light() {
%1 = load i32, i32* @light.l
%2 = xor i32 %1, 1
store i32 %2, i32* @light.l
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @GL_LIGHTING
%6 = call i32 @glEnable(i32 %5)
br label %10
7: ; preds = %0
%8 = load i32, i32* @GL_LIGHTING
%9 = call i32 @glDisable(i32 %8)
br label %10
10: ; preds = %7, %4
ret void
}

LLVM IR (-O2):
@light.l = internal unnamed_addr global i32 1
@GL_LIGHTING = global i32 0
define void @light() {
%1 = load i32, i32* @light.l
%2 = xor i32 %1, 1
store i32 %2, i32* @light.l
%3 = icmp eq i32 %2, 0
%4 = load i32, i32* @GL_LIGHTING
br i1 %3, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @glEnable(i32 %4)
br label %9
7: ; preds = %0
%8 = tail call i32 @glDisable(i32 %4)
br label %9
9: ; preds = %7, %5
ret void
}
int main() { return 77; }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 77
}

LLVM IR (-O2):
define i32 @main() {
ret i32 77
}
/* Variables and functions */
char *strtok(char *, char const *);
int cnt0(char *s, const char *del) {
  char *tok;
  int c;
  tok = s;
  c = 0;
  while ((tok = strtok(tok, del)) != NULL) {
    c++;
    tok = NULL;
  }
  return c;
}


x86 assembly (clang, -O0):
<cnt0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1160 <cnt0+0x50>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movq   $0x0,-0x18(%rbp)
jmp    112f <cnt0+0x1f>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cnt0>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <strtok@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1142 <cnt0+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <strtok@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1130 <cnt0+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @cnt0(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strtok(i8* %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %9, %5 ], [ 1, %2 ]
%7 = tail call i8* @strtok(i8* null, i8* %1)
%8 = icmp eq i8* %7, null
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %5
10: ; preds = %5, %2
%11 = phi i32 [ 0, %2 ], [ %6, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ LCDWrite(int, int);
void LCDClear(void) {
  int index;
  for (index = 0; index < 84 * 6; index++) {
    LCDWrite(1, 0x00);
  }
}


x86 assembly (clang, -O0):
<LCDClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x1f8,-0x4(%rbp)
jge    1146 <LCDClear+0x36>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <LCDWrite@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <LCDClear+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDClear>:
push   %rbx
mov    $0x1f8,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <LCDWrite@plt>
add    $0xffffffff,%ebx
jne    1120 <LCDClear+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @LCDClear() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 504
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 @LCDWrite(i32 1, i32 0)
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @LCDClear() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @LCDWrite(i32 1, i32 0)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 504
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}