xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s", "linux.h");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [8 x i8] c"linux.h\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int invert_bit(int n, int number_bit) {
  n ^= 1 << number_bit;
  return (n);
}


x86 assembly (clang, -O0):
<invert_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @invert_bit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int ucast_send(char *, int);
int ucast_write_hbmsg(void) { return ucast_send("abc", sizeof("abc")); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
define i32 @ucast_write_hbmsg() {
%1 = tail call i32 @ucast_send(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 %1
}
/* 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_boo_comment() {
  test_parser_verify_parse(test_parser_sourcefile("boo", " #comment"), "boo",
                           "", "#comment", 0);
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"boo\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_boo_comment() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 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 ([4 x i8], [4 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 = [4 x i8] c"boo\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_boo_comment() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 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 ([4 x i8], [4 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 */
int /*<<< orphan*/ EA_A7_PI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int /*<<< orphan*/);
void m68k_op_sf_8_pi7(void) { m68ki_write_8(EA_A7_PI_8(), 0); }


x86 assembly (clang, -O0):
<m68k_op_sf_8_pi7>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <EA_A7_PI_8@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <m68ki_write_8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sf_8_pi7>:
push   %rax
xor    %eax,%eax
call   1030 <EA_A7_PI_8@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sf_8_pi7() {
%1 = call i32 (...) @EA_A7_PI_8()
%2 = call i32 @m68ki_write_8(i32 %1, i32 0)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sf_8_pi7() {
%1 = tail call i32 (...) @EA_A7_PI_8()
%2 = tail call i32 @m68ki_write_8(i32 %1, i32 0)
ret void
}
void long_long_arg(long long i) {}


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

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

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

LLVM IR (-O2):
define void @long_long_arg(i64 %0) {
ret void
}
int print(int i, int j) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @print(i32 %0, i32 %1) {
ret i32 1
}
int flip_triple(val, lc)
int val;
int lc;
{
  if (lc)
    return ((val == 1) ? 0 : 1);
  else
    return ((val == 2) ? 0 : 2);
}


x86 assembly (clang, -O0):
<flip_triple>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     112c <flip_triple+0x2c>
mov    -0x8(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <flip_triple+0x3f>
mov    -0x8(%rbp),%edx
mov    $0x2,%eax
xor    %ecx,%ecx
cmp    $0x2,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip_triple>:
xor    %ecx,%ecx
cmp    $0x2,%edi
setne  %cl
xor    %eax,%eax
cmp    $0x1,%edi
setne  %al
add    %ecx,%ecx
test   %esi,%esi
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @flip_triple(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* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 0, i32 1
store i32 %12, i32* %3
br label %18
13: ; preds = %2
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 2
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 0, i32 2
store i32 %17, i32* %3
br label %18
18: ; preds = %13, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @flip_triple(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = icmp ne i32 %0, 1
%5 = zext i1 %4 to i32
%6 = icmp eq i32 %0, 2
%7 = select i1 %6, i32 0, i32 2
%8 = select i1 %3, i32 %7, i32 %5
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void JUNK() { printf("upper case, "); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"upper case, \00"
define void @JUNK() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getFilename(char const *, char *);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char *);
void getParentDirectoryName(const char *path, char *parentDirName) {
  strcpy(parentDirName, path);
  char filename[12];
  getFilename(path, filename);
  int filenameLength = strlen(filename);
  int dirNameLength = strlen(parentDirName);
  parentDirName[dirNameLength - filenameLength] = '\0';
}


x86 assembly (clang, -O0):
<getParentDirectoryName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1050 <getFilename@plt>
lea    -0x1c(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    -0x20(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getParentDirectoryName>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
lea    0x4(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <getFilename@plt>
mov    %r15,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1040 <strlen@plt>
sub    %ebx,%eax
cltq
movb   $0x0,(%r14,%rax,1)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @getParentDirectoryName(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [12 x i8]
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
%9 = load i8*, i8** %3
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
%12 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 0
%13 = call i32 @getFilename(i8* %11, i8* %12)
%14 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 0
%15 = call i32 @strlen(i8* %14)
store i32 %15, i32* %6
%16 = load i8*, i8** %4
%17 = call i32 @strlen(i8* %16)
store i32 %17, i32* %7
%18 = load i8*, i8** %4
%19 = load i32, i32* %7
%20 = load i32, i32* %6
%21 = sub nsw i32 %19, %20
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %18, i64 %22
store i8 0, i8* %23
ret void
}

LLVM IR (-O2):
define void @getParentDirectoryName(i8* %0, i8* %1) {
%3 = alloca [12 x i8]
%4 = tail call i32 @strcpy(i8* %1, i8* %0)
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%6 = call i32 @getFilename(i8* %0, i8* %5)
%7 = call i32 @strlen(i8* %5)
%8 = call i32 @strlen(i8* %1)
%9 = sub nsw i32 %8, %7
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %1, i64 %10
store i8 0, i8* %11
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ ocl_plus_1d();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Starting...\n");
  ocl_plus_1d();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <ocl_plus_1d@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Starting...\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @ocl_plus_1d()
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [12 x i8] c"Starting...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @ocl_plus_1d()
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
long CDRconfigure() { return 0; }


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

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

LLVM IR (-O0):
define i64 @CDRconfigure() {
ret i64 0
}

LLVM IR (-O2):
define i64 @CDRconfigure() {
ret i64 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void msleep(uint64_t ms) { sleep(ms * 1000); }


x86 assembly (clang, -O0):
<msleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define void @msleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @sleep(i32 %2)
ret void
}
int is_cop0(int opcode) { return opcode == 0x10; }


x86 assembly (clang, -O0):
<is_cop0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_cop0>:
xor    %eax,%eax
cmp    $0x10,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_cop0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 16
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_cop0(i32 %0) {
%2 = icmp eq i32 %0, 16
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
scalar_t__ get_dtime();
uint64_t get_elapsed_dtime(uint64_t start_time) {
  return (get_dtime() - start_time);
}


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

x86 assembly (clang, -O2):
<get_elapsed_dtime>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <get_dtime@plt>
sub    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @get_elapsed_dtime(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i64 (...) @get_dtime()
%4 = load i64, i64* %2
%5 = sub nsw i64 %3, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @get_elapsed_dtime(i64 %0) {
%2 = tail call i64 (...) @get_dtime()
%3 = sub nsw i64 %2, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ time(int);
__attribute__((visibility("hidden"))) void func_0xF0() {
  time(2);
  ;
}


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

x86 assembly (clang, -O2):
<func_0xF0>:
mov    $0x2,%edi
jmp    1030 <time@plt>

LLVM IR (-O0):
define hidden void @func_0xF0() {
%1 = call i32 @time(i32 2)
ret void
}

LLVM IR (-O2):
define hidden void @func_0xF0() {
%1 = tail call i32 @time(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cmd_mousedown(int, char **);
int /*<<< orphan*/ cmd_mouseup(int, char **);
void cmd_click(int argc, char **args) {
  cmd_mousedown(argc, args);
  cmd_mouseup(argc, args);
}


x86 assembly (clang, -O0):
<cmd_click>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <cmd_mousedown@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <cmd_mouseup@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cmd_click(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 @cmd_mousedown(i32 %5, i8** %6)
%8 = load i32, i32* %3
%9 = load i8**, i8*** %4
%10 = call i32 @cmd_mouseup(i32 %8, i8** %9)
ret void
}

LLVM IR (-O2):
define void @cmd_click(i32 %0, i8** %1) {
%3 = tail call i32 @cmd_mousedown(i32 %0, i8** %1)
%4 = tail call i32 @cmd_mouseup(i32 %0, i8** %1)
ret void
}
void NewColorRamp(double frac, double *red, double *green, double *blue) {
  *red = frac;
  *green = 0.1;
  *blue = 1 - frac;
}


x86 assembly (clang, -O0):
<NewColorRamp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0xeda(%rip),%xmm0
movsd  %xmm0,(%rax)
movsd  0xec6(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<NewColorRamp>:
movsd  %xmm0,(%rdi)
movabs $0x3fb999999999999a,%rax
99 b9 3f
mov    %rax,(%rsi)
movsd  0xee7(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rdx)
ret

LLVM IR (-O0):
define void @NewColorRamp(double %0, double* %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double, double* %5
%10 = load double*, double** %6
store double %9, double* %10
%11 = load double*, double** %7
store double 1.000000e-01, double* %11
%12 = load double, double* %5
%13 = fsub double 1.000000e+00, %12
%14 = load double*, double** %8
store double %13, double* %14
ret void
}

LLVM IR (-O2):
define void @NewColorRamp(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
store double %0, double* %1
store double 1.000000e-01, double* %2
%5 = fsub double 1.000000e+00, %0
store double %5, double* %3
ret void
}
int test_imm_9Dint32_reg(int val) { return ((val) & (0x9D << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_9Dint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x9d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Dint32_reg>:
test   $0x9d,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Dint32_reg(i32 %0) {
%2 = and i32 %0, 157
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int nokia(char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char message[161];
  printf("Enter a sentence\n");
  gets(message);
  printf("%d\n", nokia(message));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xb0(%rbp),%rdi
call   1050 <gets@plt>
lea    -0xb0(%rbp),%rdi
call   1040 <nokia@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xb0,%rsp
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    %rbx,%rdi
call   1050 <nokia@plt>
lea    0xe92(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter a sentence\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [161 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [161 x i8], [161 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [161 x i8], [161 x i8]* %2, i64 0, i64 0
%7 = call i32 @nokia(i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@str = [17 x i8] c"Enter a sentence\00"
define i32 @main() {
%1 = alloca [161 x i8]
%2 = getelementptr inbounds [161 x i8], [161 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @nokia(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int SPUplayCDDAchannel(short *pcm, int nbytes) { return -1; }


x86 assembly (clang, -O0):
<SPUplayCDDAchannel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @SPUplayCDDAchannel(i16* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, float);
int /*<<< orphan*/ scanf(char *, char *, float *);
int main(void) {
  char name[10];
  float height;
  scanf("%s%f", name, &height);
  printf("%s, you are %.3f m tall.\n", name, height / 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rsi
lea    0xeca(%rip),%rdi
lea    -0x14(%rbp),%rdx
call   1040 <scanf@plt>
lea    -0xe(%rbp),%rsi
movss  -0x14(%rbp),%xmm0
movss  0xeac(%rip),%xmm1
divss  %xmm1,%xmm0
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed8(%rip),%rdi
lea    0x6(%rsp),%rbx
mov    %rsp,%rdx
mov    %rbx,%rsi
call   1040 <scanf@plt>
movss  (%rsp),%xmm0
divss  0xeb7(%rip),%xmm0
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%f\00"
@.str.1 = [26 x i8] c"%s, you are %.3f m tall.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca float
store i32 0, i32* %1
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4, float* %3)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = load float, float* %3
%8 = fdiv float %7, 1.000000e+02
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %6, float %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%f\00"
@.str.1 = [26 x i8] c"%s, you are %.3f m tall.\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca float
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, float* %2)
%6 = load float, float* %2
%7 = fdiv float %6, 1.000000e+02
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %3, float %7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ writeide(int, int /*<<< orphan*/, int /*<<< orphan*/);
void ide_write_ter(uint16_t addr, uint8_t val, void *priv) {
  writeide(2, addr, val);
}


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

x86 assembly (clang, -O2):
<ide_write_ter>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x2,%edi
jmp    1030 <writeide@plt>

LLVM IR (-O0):
define void @ide_write_ter(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 @writeide(i32 2, i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
define void @ide_write_ter(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @writeide(i32 2, i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void f_halt() { exit(0); }


x86 assembly (clang, -O0):
<f_halt>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @f_halt() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @f_halt() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int syscall(int, int, char const *, int, char const *, unsigned int);
int move_mount(int from_dfd, const char *from_pathname, int to_dfd,
               const char *to_pathname, unsigned int flags) {
  return syscall(429, from_dfd, from_pathname, to_dfd, to_pathname, flags);
}


x86 assembly (clang, -O0):
<move_mount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
mov    $0x1ad,%edi
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_mount>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x1ad,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @move_mount(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @syscall(i32 429, i32 %0, i8* %1, i32 %2, i8* %3, i32 %4)
ret i32 %6
}
long long calc_andn_u64(long long src1, long long src2, long long dummy) {
  return (~src1 + dummy) & (src2);
}


x86 assembly (clang, -O0):
<calc_andn_u64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
add    -0x18(%rbp),%rax
and    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_andn_u64>:
not    %rdi
lea    (%rdi,%rdx,1),%rax
and    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @calc_andn_u64(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = xor i64 %7, -1
%9 = load i64, i64* %6
%10 = add nsw i64 %8, %9
%11 = load i64, i64* %5
%12 = and i64 %10, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @calc_andn_u64(i64 %0, i64 %1, i64 %2) {
%4 = xor i64 %0, -1
%5 = add nsw i64 %4, %2
%6 = and i64 %5, %1
ret i64 %6
}
int test_imm_5Bint8_reg(signed char val) {
  return ((val) & (-0x5B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Bint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffffa5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Bint8_reg>:
test   $0xa5,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_5Bint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -91
%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_5Bint8_reg(i8 signext %0) {
%2 = and i8 %0, -91
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void dputchar(char c) {
  *((volatile unsigned int *)((
      ((((((((0xf0000000)) + (4 * 1024 * 1024)) + (4 * 1024 * 1024)) +
          (4 * 1024 * 1024)) +
         (4 * 1024 * 1024)) +
        (4 * 1024 * 1024)) +
       (4 * 1024 * 1024)) +
      0))) = c;
}


x86 assembly (clang, -O0):
<dputchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0xf1800000,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dputchar>:
mov    $0xf1800000,%eax
mov    %edi,(%rax)
ret

LLVM IR (-O0):
define void @dputchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
store volatile i32 %4, i32* inttoptr (i64 4051697664 to i32*)
ret void
}

LLVM IR (-O2):
define void @dputchar(i8 signext %0) {
%2 = sext i8 %0 to i32
store volatile i32 %2, i32* inttoptr (i64 4051697664 to i32*)
ret void
}
int raiz_digital(int n) { return 1 + ((n - 1) % 9); }


x86 assembly (clang, -O0):
<raiz_digital>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<raiz_digital>:
add    $0xffffffff,%edi
movslq %edi,%rax
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%ecx
sub    %ecx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @raiz_digital(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = srem i32 %2, 9
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ t(int, char, char, char);
int main() {
  printf("Moves\n");
  t(3, 'a', 'b', 'c');
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
mov    $0x61,%esi
mov    $0x62,%edx
mov    $0x63,%ecx
call   1040 <t@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [6 x i8] c"Moves\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @t(i32 3, i8 signext 97, i8 signext 98, i8 signext 99)
ret i32 0
}
int numberOfTabs(char *line) {
  int count = 0;
  int n = 0;
  char c;
  while ((c = line[n++]) != '\0')
    if (c == '\t')
      count++;
  return count;
}


x86 assembly (clang, -O0):
<numberOfTabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1155 <numberOfTabs+0x55>
movsbl -0x11(%rbp),%eax
cmp    $0x9,%eax
jne    1150 <numberOfTabs+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <numberOfTabs+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numberOfTabs>:
xor    %ecx,%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rdi,%rcx,1),%edx
test   %dl,%dl
je     1126 <numberOfTabs+0x26>
add    $0x1,%rcx
cmp    $0x9,%dl
jne    1110 <numberOfTabs+0x10>
add    $0x1,%eax
jmp    1110 <numberOfTabs+0x10>
ret

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

LLVM IR (-O2):
define i32 @numberOfTabs(i8* nocapture %0) {
br label %2
2: ; preds = %10, %1
%3 = phi i64 [ %7, %10 ], [ 0, %1 ]
%4 = phi i32 [ %11, %10 ], [ 0, %1 ]
br label %5
5: ; preds = %2, %5
%6 = phi i64 [ %7, %5 ], [ %3, %2 ]
%7 = add nuw i64 %6, 1
%8 = getelementptr inbounds i8, i8* %0, i64 %6
%9 = load i8, i8* %8
switch i8 %9, label %5 [
i8 0, label %12
i8 9, label %10
]
10: ; preds = %5
%11 = add nuw nsw i32 %4, 1
br label %2
12: ; preds = %5
ret i32 %4
}
int number_parser(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @number_parser() {
ret i32 0
}
void writeFile() {}


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

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

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

LLVM IR (-O2):
define void @writeFile() {
ret void
}
int cmp_asc(const void *a, const void *b) { return *(char *)a - *(char *)b; }


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

x86 assembly (clang, -O2):
<cmp_asc>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_asc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmp_asc(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ RESET_COUNTERS_SaveConfig();
void RESET_COUNTERS_Sleep(void) { RESET_COUNTERS_SaveConfig(); }


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

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

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

LLVM IR (-O2):
define void @RESET_COUNTERS_Sleep() {
%1 = tail call i32 (...) @RESET_COUNTERS_SaveConfig()
ret void
}
int sum_digits_recur(int n) {
  if (n == 0)
    return 0;
  return n % 10 + sum_digits_recur(n / 10);
}


x86 assembly (clang, -O0):
<sum_digits_recur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <sum_digits_recur+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1159 <sum_digits_recur+0x49>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <sum_digits_recur@plt>
mov    -0xc(%rbp),%edx
add    %eax,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sum_digits_recur(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = srem i32 %4, 10
%7 = sdiv i32 %4, 10
%8 = add nsw i32 %6, %5
%9 = add i32 %4, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
/* Variables and functions */
unsigned int f();
int /*<<< orphan*/ h();
g() {
  unsigned y = f();
  if (y != 680)
    h();
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <f@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x2a8,-0x8(%rbp)
je     1146 <g+0x26>
mov    $0x0,%al
call   1030 <h@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rax
xor    %eax,%eax
call   1040 <f@plt>
cmp    $0x2a8,%eax
je     1136 <g+0x16>
xor    %eax,%eax
call   1030 <h@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @g() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @f()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 680
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @h()
br label %8
8: ; preds = %6, %0
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @g() {
%1 = tail call i32 (...) @f()
%2 = icmp eq i32 %1, 680
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @h()
br label %5
5: ; preds = %3, %0
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_math_zoom_set(int);
int /*<<< orphan*/ roadmap_square_at_current_scale(int);
scalar_t__ roadmap_square_scale(int);
void roadmap_math_adjust_zoom(int square) {
  if (!roadmap_square_at_current_scale(square)) {
    if (roadmap_square_scale(square) == 0) {
      roadmap_math_zoom_set(90);
    } else {
      roadmap_math_zoom_set(130);
    }
  }
}


x86 assembly (clang, -O0):
<roadmap_math_adjust_zoom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <roadmap_square_at_current_scale@plt>
cmp    $0x0,%eax
jne    117c <roadmap_math_adjust_zoom+0x4c>
mov    -0x4(%rbp),%edi
call   1030 <roadmap_square_scale@plt>
cmp    $0x0,%rax
jne    116d <roadmap_math_adjust_zoom+0x3d>
mov    $0x5a,%edi
call   1050 <roadmap_math_zoom_set@plt>
jmp    1177 <roadmap_math_adjust_zoom+0x47>
mov    $0x82,%edi
call   1050 <roadmap_math_zoom_set@plt>
jmp    117c <roadmap_math_adjust_zoom+0x4c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_math_adjust_zoom>:
push   %rbx
mov    %edi,%ebx
call   1040 <roadmap_square_at_current_scale@plt>
test   %eax,%eax
je     113e <roadmap_math_adjust_zoom+0xe>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <roadmap_square_scale@plt>
test   %rax,%rax
mov    $0x5a,%eax
mov    $0x82,%edi
cmove  %eax,%edi
pop    %rbx
jmp    1050 <roadmap_math_zoom_set@plt>

LLVM IR (-O0):
define void @roadmap_math_adjust_zoom(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @roadmap_square_at_current_scale(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @roadmap_square_scale(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = call i32 @roadmap_math_zoom_set(i32 90)
br label %14
12: ; preds = %6
%13 = call i32 @roadmap_math_zoom_set(i32 130)
br label %14
14: ; preds = %12, %10
br label %15
15: ; preds = %14, %1
ret void
}

LLVM IR (-O2):
define void @roadmap_math_adjust_zoom(i32 %0) {
%2 = tail call i32 @roadmap_square_at_current_scale(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i64 @roadmap_square_scale(i32 %0)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 90, i32 130
%8 = tail call i32 @roadmap_math_zoom_set(i32 %7)
br label %9
9: ; preds = %4, %1
ret void
}
int test_imm_35int8_mem(signed char *val) {
  return ((*val) & (-0x35 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_35int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -53
%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_35int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -53
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ DMA4_DMA20_DriverIRQHandler();
__attribute__((weak)) void DMA4_DMA20_IRQHandler(void) {
  DMA4_DMA20_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @DMA4_DMA20_IRQHandler() {
%1 = call i32 (...) @DMA4_DMA20_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA4_DMA20_IRQHandler() {
%1 = tail call i32 (...) @DMA4_DMA20_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emsRenew();
void msgRenew(void) { emsRenew(); }


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

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

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

LLVM IR (-O2):
define void @msgRenew() {
%1 = tail call i32 (...) @emsRenew()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ kill_child();
int /*<<< orphan*/ power_off();
void exit_safe() {
  power_off();
  kill_child();
  exit(0);
}


x86 assembly (clang, -O0):
<exit_safe>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <power_off@plt>
mov    $0x0,%al
call   1030 <kill_child@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<exit_safe>:
push   %rax
xor    %eax,%eax
call   1040 <power_off@plt>
xor    %eax,%eax
call   1030 <kill_child@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @exit_safe() {
%1 = call i32 (...) @power_off()
%2 = call i32 (...) @kill_child()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @exit_safe() {
%1 = tail call i32 (...) @power_off()
%2 = tail call i32 (...) @kill_child()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void free1_d(double *v) { free(v); }


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

x86 assembly (clang, -O2):
<free1_d>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free1_d(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = call i32 @free(double* %3)
ret void
}

LLVM IR (-O2):
define void @free1_d(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLboolean;

/* Variables and functions */
int /*<<< orphan*/ GL_TEXTURE_2D;
int /*<<< orphan*/ LoadRGBMipmaps2(char const *, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/ *,
                                   int /*<<< orphan*/ *);
GLboolean LoadRGBMipmaps(const char *imageFile, GLint intFormat) {
  GLint w, h;
  return LoadRGBMipmaps2(imageFile, GL_TEXTURE_2D, intFormat, &w, &h);
}


x86 assembly (clang, -O0):
<LoadRGBMipmaps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <LoadRGBMipmaps2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LoadRGBMipmaps>:
push   %rax
mov    %esi,%edx
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rcx
mov    %rsp,%r8
call   1030 <LoadRGBMipmaps2@plt>
pop    %rcx
ret

LLVM IR (-O0):
@GL_TEXTURE_2D = global i32 0
define i32 @LoadRGBMipmaps(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* @GL_TEXTURE_2D
%9 = load i32, i32* %4
%10 = call i32 @LoadRGBMipmaps2(i8* %7, i32 %8, i32 %9, i32* %5, i32* %6)
ret i32 %10
}

LLVM IR (-O2):
@GL_TEXTURE_2D = global i32 0
define i32 @LoadRGBMipmaps(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = load i32, i32* @GL_TEXTURE_2D
%8 = call i32 @LoadRGBMipmaps2(i8* %0, i32 %7, i32 %1, i32* %3, i32* %4)
ret i32 %8
}