xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ gen_pop();
int /*<<< orphan*/ output_line(char *);
void gen_div(void) {
  gen_pop();
  output_line("__div");
}


x86 assembly (clang, -O0):
<gen_div>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <output_line@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_div>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <output_line@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"__div\00"
define void @gen_div() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @output_line(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"__div\00"
define void @gen_div() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @output_line(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int waitpid(int /*<<< orphan*/, int *, int /*<<< orphan*/);
int wait_until_child_ends(pid_t child_pid) {
  int status;
  errno = 0;
  if (waitpid(child_pid, &status, 0) == -1) {
    perror("waitpid() failed");
    exit(EXIT_FAILURE);
  }
  return status;
}


x86 assembly (clang, -O0):
<wait_until_child_ends>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
movq   $0x0,(%rax)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
xor    %edx,%edx
call   1030 <waitpid@plt>
cmp    $0xffffffff,%eax
jne    117a <wait_until_child_ends+0x4a>
lea    0xe99(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_until_child_ends>:
push   %rax
mov    0x2ea8(%rip),%rax
movq   $0x0,(%rax)
lea    0x4(%rsp),%rsi
xor    %edx,%edx
call   1030 <waitpid@plt>
cmp    $0xffffffff,%eax
je     1156 <wait_until_child_ends+0x26>
mov    0x4(%rsp),%eax
pop    %rcx
ret
lea    0xea3(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@.str = [17 x i8] c"waitpid() failed\00"
@EXIT_FAILURE = global i32 0
define i32 @wait_until_child_ends(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i64 0, i64* @errno
%4 = load i32, i32* %2
%5 = call i32 @waitpid(i32 %4, i32* %3, i32 0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [17 x i8] c"waitpid() failed\00"
@EXIT_FAILURE = global i32 0
define i32 @wait_until_child_ends(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i64 0, i64* @errno
%4 = call i32 @waitpid(i32 %0, i32* %2, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
%11 = load i32, i32* %2
ret i32 %11
}
unsigned long long transfer_diff(unsigned long long new,
                                 unsigned long long old) {
  return new - old;
}


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

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

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

LLVM IR (-O2):
define i64 @transfer_diff(i64 %0, i64 %1) {
%3 = sub i64 %0, %1
ret i64 %3
}
int __attribute__((no, noclone)) baz() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @baz() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ __set_file_attribute(int /*<<< orphan*/ *);
int /*<<< orphan*/ *malloc(int);
DIR *opendir(const char *dirname) {
  DIR *ret;
  ret = malloc(sizeof(void *));
  if (ret)
    __set_file_attribute(ret);
  return ret;
}


x86 assembly (clang, -O0):
<opendir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114e <opendir+0x2e>
mov    -0x10(%rbp),%rdi
call   1040 <__set_file_attribute@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opendir>:
push   %rbx
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113b <opendir+0x1b>
mov    %rbx,%rdi
call   1040 <__set_file_attribute@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @opendir(i8* nocapture readnone %0) {
%2 = tail call i32* @malloc(i32 8)
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @__set_file_attribute(i32* %2)
br label %6
6: ; preds = %4, %1
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_matlab_line_comment_1() {
  test_parser_verify_parse(test_parser_sourcefile("matlab", " %comment"),
                           "matlab", "", "%comment", 0);
}


x86 assembly (clang, -O0):
<test_matlab_line_comment_1>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebf(%rip),%rdx
lea    0xeba(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_matlab_line_comment_1>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec8(%rip),%rdx
lea    0xec3(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"matlab\00"
@.str.1 = [10 x i8] c" %comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"%comment\00"
define void @test_matlab_line_comment_1() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"matlab\00"
@.str.1 = [10 x i8] c" %comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"%comment\00"
define void @test_matlab_line_comment_1() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) { return (isupper(c) ? c - ('A' - 'a') : c); }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113b <tolower+0x2b>
mov    -0x4(%rbp),%eax
sub    $0xffffffe0,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <tolower+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
void uninitvar_realloc(void) {
  void *block;
  size_t newsize;
  void *p = realloc(block, newsize);
  free(p);
}


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

x86 assembly (clang, -O2):
<uninitvar_realloc>:
push   %rax
call   1040 <realloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @uninitvar_realloc() {
%1 = alloca i8*
%2 = alloca i64
%3 = alloca i8*
%4 = load i8*, i8** %1
%5 = load i64, i64* %2
%6 = call i8* @realloc(i8* %4, i64 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @free(i8* %7)
ret void
}

LLVM IR (-O2):
define void @uninitvar_realloc() {
%1 = tail call i8* @realloc(i8* undef, i64 undef)
%2 = tail call i32 @free(i8* %1)
ret void
}
int lwg_parse_yywrap(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @lwg_parse_yywrap() {
ret i32 1
}

LLVM IR (-O2):
define i32 @lwg_parse_yywrap() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ seven_segment_dispaly(int);
int main(int argc, char *argv[]) {
  seven_segment_dispaly(12340);
  seven_segment_dispaly(56789);
  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)
mov    $0x3034,%edi
call   1030 <seven_segment_dispaly@plt>
mov    $0xddd5,%edi
call   1030 <seven_segment_dispaly@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3034,%edi
call   1030 <seven_segment_dispaly@plt>
mov    $0xddd5,%edi
call   1030 <seven_segment_dispaly@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @seven_segment_dispaly(i32 12340)
%4 = tail call i32 @seven_segment_dispaly(i32 56789)
ret i32 0
}
int or (register2, register3) { return (register2 | register3); }


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

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

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

LLVM IR (-O2):
define i32 @or(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
int do_794() { return 794; }


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

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

LLVM IR (-O0):
define i32 @do_794() {
ret i32 794
}

LLVM IR (-O2):
define i32 @do_794() {
ret i32 794
}
int clamp2047(int x) {
  if (x < 0)
    return 0;
  if (x > 2047)
    return 2047;
  return x;
}


x86 assembly (clang, -O0):
<clamp2047>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <clamp2047+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    113c <clamp2047+0x3c>
cmpl   $0x7ff,-0x8(%rbp)
jle    1136 <clamp2047+0x36>
movl   $0x7ff,-0x4(%rbp)
jmp    113c <clamp2047+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp2047>:
cmp    $0x7ff,%edi
mov    $0x7ff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp2047(i32 %0) {
%2 = icmp slt i32 %0, 2047
%3 = select i1 %2, i32 %0, i32 2047
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int f();
int main() {
  if (f() != 8192)
    _exit(-1);
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <f@plt>
cmp    $0x2000,%eax
je     114b <main+0x2b>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f@plt>
cmp    $0x2000,%eax
jne    1136 <main+0x16>
xor    %edi,%edi
call   1030 <_exit@plt>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f()
%3 = icmp ne i32 %2, 8192
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @_exit(i32 -1)
unreachable
6: ; preds = %0
%7 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = icmp eq i32 %1, 8192
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @_exit(i32 -1)
unreachable
5: ; preds = %0
%6 = tail call i32 @_exit(i32 0)
unreachable
}
void ARGBBlendRow_SSSE3() {}


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

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

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

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

/* Variables and functions */
int getdomainname(char *, int);
int main(void) {
  char name[128];
  return getdomainname(name, sizeof(name));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
mov    $0x80,%esi
call   1030 <getdomainname@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x88,%rsp
mov    %rsp,%rdi
mov    $0x80,%esi
call   1030 <getdomainname@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @getdomainname(i8* %3, i32 128)
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @getdomainname(i8* %2, i32 128)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void SysCtlLDOConfigSet(unsigned long ulConfig) {
  DEBUG_ASSERT((ulConfig == 0x00000001) || (ulConfig == 0x00000000));
  (*((volatile unsigned long *)(0x400FE160))) = ulConfig;
}


x86 assembly (clang, -O0):
<SysCtlLDOConfigSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x1,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1137 <SysCtlLDOConfigSet+0x27>
cmpq   $0x0,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rcx
mov    $0x400fe160,%eax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlLDOConfigSet>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x2,%rbx
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %rbx,0x400fe160
40
pop    %rbx
ret

LLVM IR (-O0):
define void @SysCtlLDOConfigSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 0
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %2
store volatile i64 %12, i64* inttoptr (i64 1074782560 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlLDOConfigSet(i64 %0) {
%2 = icmp ult i64 %0, 2
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
store volatile i64 %0, i64* inttoptr (i64 1074782560 to i64*)
ret void
}
int main() { typedef int a; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_PCTX;
typedef int /*<<< orphan*/ ASN1_ITEM;

/* Variables and functions */
int BIO_printf(int /*<<< orphan*/ *, char *, long);
int long_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it, int indent,
               const ASN1_PCTX *pctx) {
  return BIO_printf(out, "%ld\n", *(long *)pval);
}


x86 assembly (clang, -O0):
<long_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xec3(%rip),%rsi
call   1030 <BIO_printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_print>:
mov    (%rsi),%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <BIO_printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @long_print(i32* %0, i32** %1, i32* %2, i32 %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32**
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32*
store i32* %0, i32** %6
store i32** %1, i32*** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%11 = load i32*, i32** %6
%12 = load i32**, i32*** %7
%13 = bitcast i32** %12 to i64*
%14 = load i64, i64* %13
%15 = call i32 @BIO_printf(i32* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %14)
ret i32 %15
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @long_print(i32* %0, i32** nocapture %1, i32* nocapture readnone %2, i32 %3, i32* nocapture readnone %4) {
%6 = bitcast i32** %1 to i64*
%7 = load i64, i64* %6
%8 = tail call i32 @BIO_printf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %7)
ret i32 %8
}
int min(int a, int b) {
  if (a < b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <min+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @min(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* %4
%7 = load i32, i32* %5
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void f() { printf("%z", 2); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%z\00"
define void @f() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%z\00"
define void @f() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
int do_nothing(void) {
  fprintf(stderr, "koules.sndsrv: doing nothing, something is broken\n");
  while (1)
    sleep(5);
}


x86 assembly (clang, -O0):
<do_nothing>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
jmp    1139 <do_nothing+0x19>

x86 assembly (clang, -O2):
<do_nothing>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
cs nopw 0x0(%rax,%rax,1)
mov    $0x5,%edi
call   1040 <sleep@plt>
jmp    1140 <do_nothing+0x20>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"koules.sndsrv: doing nothing, something is broken\0A\00"
define i32 @do_nothing() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
%4 = call i32 @sleep(i32 5)
br label %3
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"koules.sndsrv: doing nothing, something is broken\0A\00"
define i32 @do_nothing() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
%4 = tail call i32 @sleep(i32 5)
br label %3
}
/* Variables and functions */
int BUFSIZ;
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
int main() {
  char buf[BUFSIZ];
  setbuf(stdout, buf);
  puts("Linkerist Heracles");
  sleep(5);
  fflush(stdout);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,%rsp
mov    %rax,-0x18(%rbp)
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
call   1040 <setbuf@plt>
lea    0xe74(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1060 <sleep@plt>
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rsi
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rsi
mov    %rsi,%rsp
mov    0x2e71(%rip),%rbx
mov    (%rbx),%edi
call   1040 <setbuf@plt>
lea    0xe8b(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1060 <sleep@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
@stdout = global i32 0
@.str = [19 x i8] c"Linkerist Heracles\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
store i32 0, i32* %1
%4 = load i32, i32* @BUFSIZ
%5 = zext i32 %4 to i64
%6 = call i8* @llvm.stacksave()
store i8* %6, i8** %2
%7 = alloca i8, i64 %5
store i64 %5, i64* %3
%8 = load i32, i32* @stdout
%9 = call i32 @setbuf(i32 %8, i8* %7)
%10 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @sleep(i32 5)
%12 = load i32, i32* @stdout
%13 = call i32 @fflush(i32 %12)
store i32 0, i32* %1
%14 = load i8*, i8** %2
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@stdout = global i32 0
@.str = [19 x i8] c"Linkerist Heracles\00"
define i32 @main() {
%1 = load i32, i32* @BUFSIZ
%2 = zext i32 %1 to i64
%3 = alloca i8, i64 %2
%4 = load i32, i32* @stdout
%5 = call i32 @setbuf(i32 %4, i8* %3)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @sleep(i32 5)
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
ret i32 0
}
int test_imm_F7int16_mem(short *val) {
  return ((*val) & (0xF7 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F7int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 247
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int fb_ConsoleGetColorAtt(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fb_ConsoleGetColorAtt() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pem_password_cb;
typedef int /*<<< orphan*/ d2i_of_void;
typedef int /*<<< orphan*/ X509_REQ;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *PEM_ASN1_read(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int /*<<< orphan*/ *, void **,
                                  int /*<<< orphan*/ *, void *);
int /*<<< orphan*/ PEM_STRING_X509_REQ;
scalar_t__ d2i_X509_REQ;
X509_REQ *PEM_read_X509_REQ(FILE *fp, X509_REQ **x, pem_password_cb *cb,
                            void *u) {
  return PEM_ASN1_read((d2i_of_void *)d2i_X509_REQ, PEM_STRING_X509_REQ, fp,
                       (void **)x, cb, u);
}


x86 assembly (clang, -O0):
<PEM_read_X509_REQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%rdi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1030 <PEM_ASN1_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_read_X509_REQ>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
jmp    1030 <PEM_ASN1_read@plt>

LLVM IR (-O0):
@d2i_X509_REQ = global i64 0
@PEM_STRING_X509_REQ = global i32 0
define i32* @PEM_read_X509_REQ(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32**
%7 = alloca i32*
%8 = alloca i8*
store i32* %0, i32** %5
store i32** %1, i32*** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i64, i64* @d2i_X509_REQ
%10 = inttoptr i64 %9 to i32*
%11 = load i32, i32* @PEM_STRING_X509_REQ
%12 = load i32*, i32** %5
%13 = load i32**, i32*** %6
%14 = bitcast i32** %13 to i8**
%15 = load i32*, i32** %7
%16 = load i8*, i8** %8
%17 = call i32* @PEM_ASN1_read(i32* %10, i32 %11, i32* %12, i8** %14, i32* %15, i8* %16)
ret i32* %17
}

LLVM IR (-O2):
@d2i_X509_REQ = global i64 0
@PEM_STRING_X509_REQ = global i32 0
define i32* @PEM_read_X509_REQ(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = load i64, i64* @d2i_X509_REQ
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_X509_REQ
%8 = bitcast i32** %1 to i8**
%9 = tail call i32* @PEM_ASN1_read(i32* %6, i32 %7, i32* %0, i8** %8, i32* %2, i8* %3)
ret i32* %9
}
void change_dir(char *name) {}


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

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

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

LLVM IR (-O2):
define void @change_dir(i8* nocapture %0) {
ret void
}
void path_023_expected_3(int a, int b, int c) {
  switch (a) {
  case 0:
    if (b) {
    }
    break;
  }
}


x86 assembly (clang, -O0):
<path_023_expected_3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
test   %eax,%eax
jne    1131 <path_023_expected_3+0x31>
jmp    111d <path_023_expected_3+0x1d>
cmpl   $0x0,-0x8(%rbp)
je     112c <path_023_expected_3+0x2c>
jmp    112c <path_023_expected_3+0x2c>
jmp    1131 <path_023_expected_3+0x31>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @path_023_expected_3(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
switch i32 %7, label %13 [
i32 0, label %8
]
8: ; preds = %3
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
br label %12
12: ; preds = %11, %8
br label %13
13: ; preds = %3, %12
ret void
}

LLVM IR (-O2):
define void @path_023_expected_3(i32 %0, i32 %1, i32 %2) {
ret void
}
int sparse_bitcount(unsigned int n) {
  int count = 0;
  while (n) {
    count++;
    n &= (n - 1);
  }
  return count;
}


x86 assembly (clang, -O0):
<sparse_bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <sparse_bitcount+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110e <sparse_bitcount+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sparse_bitcount>:
xor    %eax,%eax
test   %edi,%edi
je     111c <sparse_bitcount+0x1c>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <sparse_bitcount+0x10>
ret

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

LLVM IR (-O2):
define i32 @sparse_bitcount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = add i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int transmit(char *transmission) {
  system("cd ../../ && btscript");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"cd ../../ && btscript\00"
define i32 @transmit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @system(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"cd ../../ && btscript\00"
define i32 @transmit(i8* nocapture readnone %0) {
%2 = tail call i32 @system(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
foo(int *z, int *y, int xx) {
  *z = 1;
  if (xx)
    xx = 20;
  else
    xx = 30;
  *z = 2;
  *z = 3;
  return xx;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
cmpl   $0x0,-0x14(%rbp)
je     112f <foo+0x2f>
movl   $0x14,-0x14(%rbp)
jmp    1136 <foo+0x36>
movl   $0x1e,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edx,%edx
mov    $0x1e,%ecx
mov    $0x14,%eax
cmove  %ecx,%eax
movl   $0x3,(%rdi)
ret

LLVM IR (-O0):
define i32 @foo(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
store i32 1, i32* %7
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 20, i32* %6
br label %12
11: ; preds = %3
store i32 30, i32* %6
br label %12
12: ; preds = %11, %10
%13 = load i32*, i32** %4
store i32 2, i32* %13
%14 = load i32*, i32** %4
store i32 3, i32* %14
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
define i32 @foo(i32* nocapture writeonly %0, i32* nocapture readnone %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = select i1 %4, i32 30, i32 20
store i32 3, i32* %0
ret i32 %5
}
int test_imm_EFuint32_mem(unsigned int *val) {
  return ((*val) & (0xEF << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_EFuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 239
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double libballistics_deg2moa(double deg) { return deg * 60.0; }


x86 assembly (clang, -O0):
<libballistics_deg2moa>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @libballistics_deg2moa(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 6.000000e+01
ret double %4
}

LLVM IR (-O2):
define double @libballistics_deg2moa(double %0) {
%2 = fmul double %0, 6.000000e+01
ret double %2
}
/* Variables and functions */
int isnan(float);
int main(void) {
  float fzero, x;
  fzero = (0.0f);
  x = (0.0f) / fzero;
  return isnan(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <isnan@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movss  0xee8(%rip),%xmm0
jmp    1030 <isnan@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %2
%4 = load float, float* %2
%5 = fdiv float 0.000000e+00, %4
store float %5, float* %3
%6 = load float, float* %3
%7 = call i32 @isnan(float %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @isnan(float 0x7FF8000000000000)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ a();
int /*<<< orphan*/ r();
void warn_lock3(void) {
  a();
  a();
  r();
}


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

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

LLVM IR (-O0):
define void @warn_lock3() {
%1 = call i32 (...) @a()
%2 = call i32 (...) @a()
%3 = call i32 (...) @r()
ret void
}

LLVM IR (-O2):
define void @warn_lock3() {
%1 = tail call i32 (...) @a()
%2 = tail call i32 (...) @a()
%3 = tail call i32 (...) @r()
ret void
}
int test_int_6(int a, int b, int c, int d, int e, int f) { return -1223446720; }


x86 assembly (clang, -O0):
<test_int_6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    $0xb713af40,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_int_6(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
ret i32 -1223446720
}

LLVM IR (-O2):
define i32 @test_int_6(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret i32 -1223446720
}
/* Variables and functions */
double convert_to_celsius(int);
char *convert_to_celsius_should_return_0_when_input_is_32() {
  double degrees = convert_to_celsius(32);
  do {
    if (!(degrees == 0.0))
      return "error, celsius conversion != 0";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<convert_to_celsius_should_return_0_when_input_is_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x20,%edi
call   1030 <convert_to_celsius@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1144 <convert_to_celsius_should_return_0_when_input_is_32+0x34>
jp     1144 <convert_to_celsius_should_return_0_when_input_is_32+0x34>
jmp    1154 <convert_to_celsius_should_return_0_when_input_is_32+0x44>
lea    0xeb5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1161 <convert_to_celsius_should_return_0_when_input_is_32+0x51>
jmp    1159 <convert_to_celsius_should_return_0_when_input_is_32+0x49>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_to_celsius_should_return_0_when_input_is_32>:
push   %rax
mov    $0x20,%edi
call   1030 <convert_to_celsius@plt>
xor    %eax,%eax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
lea    0xed4(%rip),%rcx
cmovne %rcx,%rax
cmovp  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"error, celsius conversion != 0\00"
define i8* @convert_to_celsius_should_return_0_when_input_is_32() {
%1 = alloca i8*
%2 = alloca double
%3 = call double @convert_to_celsius(i32 32)
store double %3, double* %2
br label %4
4: ; preds = %0
%5 = load double, double* %2
%6 = fcmp oeq double %5, 0.000000e+00
br i1 %6, label %8, label %7
7: ; preds = %4
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8** %1
br label %10
8: ; preds = %4
br label %9
9: ; preds = %8
store i8* null, i8** %1
br label %10
10: ; preds = %9, %7
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [31 x i8] c"error, celsius conversion != 0\00"
define i8* @convert_to_celsius_should_return_0_when_input_is_32() {
%1 = tail call double @convert_to_celsius(i32 32)
%2 = fcmp oeq double %1, 0.000000e+00
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ __iar_program_start();
void am_reset_isr(void) { __iar_program_start(); }


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

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

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

LLVM IR (-O2):
define void @am_reset_isr() {
%1 = tail call i32 (...) @__iar_program_start()
ret void
}
/* Type definitions */
typedef char *Elf32_Word;

/* Variables and functions */
Elf32_Word rev_32word(Elf32_Word in) {
  __asm__("bswap %0" : "=r"(in) : "0"(in));
  return in;
}


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

x86 assembly (clang, -O2):
<rev_32word>:
mov    %rdi,%rax
bswap  %rax
ret

LLVM IR (-O0):
define i8* @rev_32word(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "bswap $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @rev_32word(i8* readnone %0) {
%2 = tail call i8* asm "bswap $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
void *mallocx() {
  int *p = 0;
  *p = 2;
  return 0;
}


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

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

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ bar(char *);
void f1() {
  static char *x = "hello";
  bar(x);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0d(%rip),%rdi
call   1030 <bar@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@f1.x = internal global i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0)
@.str = [6 x i8] c"hello\00"
define void @f1() {
%1 = load i8*, i8** @f1.x
%2 = call i32 @bar(i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define void @f1() {
%1 = tail call i32 @bar(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void sendlogoff() {}


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

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

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

LLVM IR (-O2):
define void @sendlogoff() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
void remove_pidfile(void) { remove("/run/cpacfstatsd.pid"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"/run/cpacfstatsd.pid\00"
define void @remove_pidfile() {
%1 = call i32 @remove(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"/run/cpacfstatsd.pid\00"
define void @remove_pidfile() {
%1 = tail call i32 @remove(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __show_tree(int /*<<< orphan*/, double);
double sqrt(double);
void test_quadratic(double a, double b, double c) {
  __show_tree(0, (-b + sqrt(b * b - 4 * a * c)) / (2 * a));
}


x86 assembly (clang, -O0):
<test_quadratic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xe9e(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xe54(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
xor    %edi,%edi
call   1030 <__show_tree@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_quadratic>:
sub    $0x18,%rsp
movapd %xmm0,%xmm3
movsd  0xed0(%rip),%xmm4
mulsd  %xmm0,%xmm4
mulsd  %xmm2,%xmm4
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm4,%xmm0
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jb     1154 <test_quadratic+0x34>
sqrtsd %xmm0,%xmm0
jmp    1171 <test_quadratic+0x51>
movsd  %xmm3,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
call   1040 <sqrt@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm3
subsd  %xmm1,%xmm0
addsd  %xmm3,%xmm3
divsd  %xmm3,%xmm0
xor    %edi,%edi
add    $0x18,%rsp
jmp    1030 <__show_tree@plt>

LLVM IR (-O0):
define void @test_quadratic(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = fneg double %7
%9 = load double, double* %5
%10 = load double, double* %5
%11 = load double, double* %4
%12 = fmul double 4.000000e+00, %11
%13 = load double, double* %6
%14 = fmul double %12, %13
%15 = fneg double %14
%16 = call double @llvm.fmuladd.f64(double %9, double %10, double %15)
%17 = call double @sqrt(double %16)
%18 = fadd double %8, %17
%19 = load double, double* %4
%20 = fmul double 2.000000e+00, %19
%21 = fdiv double %18, %20
%22 = call i32 @__show_tree(i32 0, double %21)
ret void
}

LLVM IR (-O2):
define void @test_quadratic(double %0, double %1, double %2) {
%4 = fmul double %0, -4.000000e+00
%5 = fmul double %4, %2
%6 = tail call double @llvm.fmuladd.f64(double %1, double %1, double %5)
%7 = tail call double @sqrt(double %6)
%8 = fsub double %7, %1
%9 = fmul double %0, 2.000000e+00
%10 = fdiv double %8, %9
%11 = tail call i32 @__show_tree(i32 0, double %10)
ret void
}