xunge/DecIR huggingface dataset:
/* Type definitions */
struct userlist_args_info {
  int dummy;
};

/* Variables and functions */
int userlist_cmdline_parser2(int, char **, struct userlist_args_info *,
                             int /*<<< orphan*/, int, int);
int userlist_cmdline_parser(int argc, char **argv,
                            struct userlist_args_info *args_info) {
  return userlist_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<userlist_cmdline_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <userlist_cmdline_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<userlist_cmdline_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <userlist_cmdline_parser2@plt>

LLVM IR (-O0):
%struct.userlist_args_info = type { i32 }
define i32 @userlist_cmdline_parser(i32 %0, i8** %1, %struct.userlist_args_info* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.userlist_args_info*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.userlist_args_info* %2, %struct.userlist_args_info** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load %struct.userlist_args_info*, %struct.userlist_args_info** %6
%10 = call i32 @userlist_cmdline_parser2(i32 %7, i8** %8, %struct.userlist_args_info* %9, i32 0, i32 1, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.userlist_args_info = type { i32 }
define i32 @userlist_cmdline_parser(i32 %0, i8** %1, %struct.userlist_args_info* %2) {
%4 = tail call i32 @userlist_cmdline_parser2(i32 %0, i8** %1, %struct.userlist_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
float getNHMmultiplier(void) {
  unsigned int msr_lo, msr_hi;
  float coef;
  __asm__ __volatile__("rdmsr"
                       : "=a"(msr_lo), "=d"(msr_hi)
                       : "c"(0x194)
                       : "edi");
  if ((msr_lo >> 16) & 1) {
    coef = (msr_lo >> 8) & 0xFF;
  } else {
    __asm__ __volatile__("rdmsr"
                         : "=a"(msr_lo), "=d"(msr_hi)
                         : "c"(0xCE)
                         : "edi");
    coef = (msr_lo >> 8) & 0xFF;
  }
  return coef;
}


x86 assembly (clang, -O0):
<getNHMmultiplier>:
push   %rbp
mov    %rsp,%rbp
mov    $0x194,%ecx
rdmsr
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1135 <getNHMmultiplier+0x35>
movzbl -0x3(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    114f <getNHMmultiplier+0x4f>
mov    $0xce,%ecx
rdmsr
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
movzbl -0x3(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNHMmultiplier>:
mov    $0x194,%ecx
rdmsr
test   $0x10000,%eax
jne    1115 <getNHMmultiplier+0x15>
mov    $0xce,%ecx
rdmsr
movzbl %ah,%eax
cvtsi2ss %eax,%xmm0
ret

LLVM IR (-O0):
define float @getNHMmultiplier() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = call { i32, i32 } asm sideeffect "rdmsr", "={ax},={dx},{cx},~{edi},~{dirflag},~{fpsr},~{flags}"(i32 404)
%5 = extractvalue { i32, i32 } %4, 0
%6 = extractvalue { i32, i32 } %4, 1
store i32 %5, i32* %1
store i32 %6, i32* %2
%7 = load i32, i32* %1
%8 = lshr i32 %7, 16
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %0
%12 = load i32, i32* %1
%13 = lshr i32 %12, 8
%14 = and i32 %13, 255
%15 = uitofp i32 %14 to float
store float %15, float* %3
br label %24
16: ; preds = %0
%17 = call { i32, i32 } asm sideeffect "rdmsr", "={ax},={dx},{cx},~{edi},~{dirflag},~{fpsr},~{flags}"(i32 206)
%18 = extractvalue { i32, i32 } %17, 0
%19 = extractvalue { i32, i32 } %17, 1
store i32 %18, i32* %1
store i32 %19, i32* %2
%20 = load i32, i32* %1
%21 = lshr i32 %20, 8
%22 = and i32 %21, 255
%23 = uitofp i32 %22 to float
store float %23, float* %3
br label %24
24: ; preds = %16, %11
%25 = load float, float* %3
ret float %25
}

LLVM IR (-O2):
define float @getNHMmultiplier() {
%1 = tail call { i32, i32 } asm sideeffect "rdmsr", "={ax},={dx},{cx},~{edi},~{dirflag},~{fpsr},~{flags}"(i32 404)
%2 = extractvalue { i32, i32 } %1, 0
%3 = and i32 %2, 65536
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = tail call { i32, i32 } asm sideeffect "rdmsr", "={ax},={dx},{cx},~{edi},~{dirflag},~{fpsr},~{flags}"(i32 206)
%7 = extractvalue { i32, i32 } %6, 0
br label %8
8: ; preds = %0, %5
%9 = phi i32 [ %7, %5 ], [ %2, %0 ]
%10 = lshr i32 %9, 8
%11 = and i32 %10, 255
%12 = uitofp i32 %11 to float
ret float %12
}
int f(register int a, register int b) {
  register int x = b, y = a;
  return x + y;
}


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

x86 assembly (clang, -O2):
<f>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int add_i(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<add_i>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @add_i(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void gdk_xid_table_lookup_for_display() {}


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

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

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

LLVM IR (-O2):
define void @gdk_xid_table_lookup_for_display() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(void) {
  char our_string[20];
  printf("You want to say: ");
  fgets(our_string, 20, stdin);
  printf("I understood: ");
  fputs(our_string, stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
mov    $0x14,%esi
call   1050 <fgets@plt>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    0x2e5f(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1050 <fgets@plt>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"You want to say: \00"
@stdin = global i32 0
@.str.1 = [15 x i8] c"I understood: \00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 20, i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%9 = load i32, i32* @stdout
%10 = call i32 @fputs(i8* %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"You want to say: \00"
@stdin = global i32 0
@.str.1 = [15 x i8] c"I understood: \00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 20, i32 %4)
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = call i32 @fputs(i8* %2, i32 %7)
ret i32 0
}
int is_white(int c) {
  return (c == ' ' || c == '\t' || c == '\r' || c == '\n');
}


x86 assembly (clang, -O0):
<is_white>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <is_white+0x3e>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <is_white+0x3e>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <is_white+0x3e>
cmpl   $0xa,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_white>:
cmp    $0x20,%edi
ja     111d <is_white+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100002200,%rdx
bt     %rcx,%rdx
jae    111d <is_white+0x1d>
ret
xor    %eax,%eax
cmp    $0xa,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_white(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 13
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 10
br label %14
14: ; preds = %11, %8, %5, %1
%15 = phi i1 [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_white(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 13, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ hash_words(int /*<<< orphan*/ const *, size_t,
                              int /*<<< orphan*/);
uint32_t hash_bytes32(const uint32_t p[], size_t n_bytes, uint32_t basis) {
  return hash_words(p, n_bytes / 4, basis);
}


x86 assembly (clang, -O0):
<hash_bytes32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
shr    $0x2,%rsi
mov    -0x14(%rbp),%edx
call   1030 <hash_words@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_bytes32>:
shr    $0x2,%rsi
jmp    1030 <hash_words@plt>

LLVM IR (-O0):
define i32 @hash_bytes32(i32* %0, i64 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32
store i32* %0, i32** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i64, i64* %5
%9 = udiv i64 %8, 4
%10 = load i32, i32* %6
%11 = call i32 @hash_words(i32* %7, i64 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @hash_bytes32(i32* %0, i64 %1, i32 %2) {
%4 = lshr i64 %1, 2
%5 = tail call i32 @hash_words(i32* %0, i64 %4, i32 %2)
ret i32 %5
}
void d2i_OCSP_CRLID(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_OCSP_CRLID() {
ret void
}
/* Variables and functions */
int writeToCompassDevice(int, int);
int setCompassModeRegister(int mode) {
  return writeToCompassDevice(0x02, mode);
}


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

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

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

LLVM IR (-O2):
define i32 @setCompassModeRegister(i32 %0) {
%2 = tail call i32 @writeToCompassDevice(i32 2, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int atomic_load_int(int *);
void reader(int *x) {
  for (;;) {
    ;
    int m0 = atomic_load_int(x);
    int m1 = atomic_load_int(x);
    assert(m0 <= m1);
  }
}


x86 assembly (clang, -O0):
<reader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <atomic_load_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <atomic_load_int@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setle  %al
and    $0x1,%al
mov    %al,-0x11(%rbp)
movzbl %al,%edi
call   1030 <assert@plt>
jmp    112c <reader+0xc>

x86 assembly (clang, -O2):
<reader>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <atomic_load_int@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <atomic_load_int@plt>
xor    %edi,%edi
cmp    %eax,%ebp
setle  %dil
call   1030 <assert@plt>
jmp    1130 <reader+0x10>

LLVM IR (-O0):
define void @reader(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
br label %5
5: ; preds = %5, %1
%6 = load i32*, i32** %2
%7 = call i32 @atomic_load_int(i32* %6)
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = call i32 @atomic_load_int(i32* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = icmp sle i32 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
br label %5
}

LLVM IR (-O2):
define void @reader(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @atomic_load_int(i32* %0)
%4 = tail call i32 @atomic_load_int(i32* %0)
%5 = icmp sle i32 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
br label %2
}
/* Variables and functions */
void test_threads2(void) {}


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

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

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

LLVM IR (-O2):
define void @test_threads2() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ print_assert_array_stats();
int /*<<< orphan*/ simple_tests();
int main(void) {
  simple_tests();
  print_assert_array_stats();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <simple_tests@plt>
mov    $0x0,%al
call   1040 <print_assert_array_stats@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <simple_tests@plt>
xor    %eax,%eax
call   1040 <print_assert_array_stats@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @simple_tests()
%3 = call i32 (...) @print_assert_array_stats()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @simple_tests()
%2 = tail call i32 (...) @print_assert_array_stats()
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
int main(int argc, char **argv) {
  int x;
  float r = argc;
  if (0 > r) {
    x = 7;
  } else {
    x = 42;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x18(%rbp),%xmm0
jbe    1135 <main+0x35>
movl   $0x7,-0x14(%rbp)
jmp    113c <main+0x3c>
movl   $0x2a,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
test   %edi,%edi
mov    $0x7,%ecx
mov    $0x2a,%eax
cmovs  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to float
store float %9, float* %7
%10 = load float, float* %7
%11 = fcmp ogt float 0.000000e+00, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 7, i32* %6
br label %14
13: ; preds = %2
store i32 42, i32* %6
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp slt i32 %0, 0
%4 = select i1 %3, i32 7, i32 42
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ irc_config_compute_nick_colors();
int irc_config_change_nick_colors_cb(const void *pointer, void *data,
                                     const char *option, const char *value) {
  (void)pointer;
  (void)data;
  (void)option;
  (void)value;
  irc_config_compute_nick_colors();
  return 0;
}


x86 assembly (clang, -O0):
<irc_config_change_nick_colors_cb>:
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    $0x0,%al
call   1030 <irc_config_compute_nick_colors@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_config_change_nick_colors_cb>:
push   %rax
xor    %eax,%eax
call   1030 <irc_config_compute_nick_colors@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @irc_config_change_nick_colors_cb(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 (...) @irc_config_compute_nick_colors()
ret i32 0
}

LLVM IR (-O2):
define i32 @irc_config_change_nick_colors_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 (...) @irc_config_compute_nick_colors()
ret i32 0
}
void XkbSetControls() {}


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

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

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

LLVM IR (-O2):
define void @XkbSetControls() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __softboundcets_init();
int /*<<< orphan*/ __softboundcets_stub();
void __softboundcets_global_init() {
  __softboundcets_init();
  __softboundcets_stub();
}


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

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

LLVM IR (-O0):
define void @__softboundcets_global_init() {
%1 = call i32 (...) @__softboundcets_init()
%2 = call i32 (...) @__softboundcets_stub()
ret void
}

LLVM IR (-O2):
define void @__softboundcets_global_init() {
%1 = tail call i32 (...) @__softboundcets_init()
%2 = tail call i32 (...) @__softboundcets_stub()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_DEBUG;
int __sapi_sock_set_optint(int, int /*<<< orphan*/, int /*<<< orphan*/);
int sapi_sock_set_debug(int sock) {
  return __sapi_sock_set_optint(sock, SOL_SOCKET, SO_DEBUG);
}


x86 assembly (clang, -O0):
<sapi_sock_set_debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
call   1030 <__sapi_sock_set_optint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sapi_sock_set_debug>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
mov    0x2ec0(%rip),%rax
mov    (%rax),%edx
jmp    1030 <__sapi_sock_set_optint@plt>

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_DEBUG = global i32 0
define i32 @sapi_sock_set_debug(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_DEBUG
%6 = call i32 @__sapi_sock_set_optint(i32 %3, i32 %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_DEBUG = global i32 0
define i32 @sapi_sock_set_debug(i32 %0) {
%2 = load i32, i32* @SOL_SOCKET
%3 = load i32, i32* @SO_DEBUG
%4 = tail call i32 @__sapi_sock_set_optint(i32 %0, i32 %2, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gl_writen(int, int, int, char *);
void gl_write(int x, int y, char *s) {
  int n;
  for (n = 0; s[n]; n++)
    ;
  gl_writen(x, y, n, s);
}


x86 assembly (clang, -O0):
<gl_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     114e <gl_write+0x3e>
jmp    1140 <gl_write+0x30>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <gl_write+0x19>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rcx
call   1030 <gl_writen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gl_write>:
mov    %rdx,%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x0,(%rcx,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <gl_write+0x10>
add    $0xffffffff,%edx
jmp    1030 <gl_writen@plt>

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

LLVM IR (-O2):
define void @gl_write(i32 %0, i32 %1, i8* %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i64 [ %9, %4 ], [ 0, %3 ]
%6 = getelementptr inbounds i8, i8* %2, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = add nuw i64 %5, 1
br i1 %8, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %5 to i32
%12 = tail call i32 @gl_writen(i32 %0, i32 %1, i32 %11, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_OnlyKeywordsAllowedInDelimiterSyntax(long p_position) {
  _Error(p_position,
         "Delimiter clause in repetition must only contain keywords");
}


x86 assembly (clang, -O0):
<Error_OnlyKeywordsAllowedInDelimiterSyntax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <_Error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Error_OnlyKeywordsAllowedInDelimiterSyntax>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"Delimiter clause in repetition must only contain keywords\00"
define void @Error_OnlyKeywordsAllowedInDelimiterSyntax(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [58 x i8] c"Delimiter clause in repetition must only contain keywords\00"
define void @Error_OnlyKeywordsAllowedInDelimiterSyntax(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isNoSpaceAvailable();
int isSpaceAvailable(void) { return !isNoSpaceAvailable(); }


x86 assembly (clang, -O0):
<isSpaceAvailable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <isNoSpaceAvailable@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSpaceAvailable>:
push   %rax
xor    %eax,%eax
call   1030 <isNoSpaceAvailable@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isSpaceAvailable() {
%1 = call i32 (...) @isNoSpaceAvailable()
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @isSpaceAvailable() {
%1 = tail call i32 (...) @isNoSpaceAvailable()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fn_b(int b) { printf("b = %d\n", b); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"b = %d\0A\00"
define void @fn_b(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
double Double_0_toDouble_2_Integer(long long value) { return (double)value; }


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

x86 assembly (clang, -O2):
<Double_0_toDouble_2_Integer>:
cvtsi2sd %rdi,%xmm0
ret

LLVM IR (-O0):
define double @Double_0_toDouble_2_Integer(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
ret double %4
}

LLVM IR (-O2):
define double @Double_0_toDouble_2_Integer(i64 %0) {
%2 = sitofp i64 %0 to double
ret double %2
}
int compare(const void *a, const void *b) {
  void *a1 = *(void **)a;
  void *b1 = *(void **)b;
  if (a1 > b1)
    return 1;
  else if (a1 < b1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jbe    113c <compare+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1162 <compare+0x62>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1156 <compare+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <compare+0x62>
jmp    115b <compare+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
cmp    %rcx,%rax
sbb    %edx,%edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovbe %edx,%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
store i8* %10, i8** %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i8**
%13 = load i8*, i8** %12
store i8* %13, i8** %7
%14 = load i8*, i8** %6
%15 = load i8*, i8** %7
%16 = icmp ugt i8* %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 1, i32* %3
br label %25
18: ; preds = %2
%19 = load i8*, i8** %6
%20 = load i8*, i8** %7
%21 = icmp ult i8* %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 -1, i32* %3
br label %25
23: ; preds = %18
br label %24
24: ; preds = %23
store i32 0, i32* %3
br label %25
25: ; preds = %24, %22, %17
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = icmp ugt i8* %4, %6
%8 = icmp ult i8* %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, void *, size_t, unsigned int);
ssize_t uv__getrandom(void *buf, size_t buflen, unsigned flags) {
  return syscall(318, buf, buflen, flags);
}


x86 assembly (clang, -O0):
<uv__getrandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x13e,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uv__getrandom>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x13e,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @uv__getrandom(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i32, i32* %6
%10 = call i32 @syscall(i32 318, i8* %7, i64 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @uv__getrandom(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @syscall(i32 318, i8* %0, i64 %1, i32 %2)
ret i32 %4
}
__attribute__((no)) int foo(int a) { return a * a; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
void Media_Seek(unsigned int seekHi, unsigned int seekLo) {}


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

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

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

LLVM IR (-O2):
define void @Media_Seek(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
void filevisitor(const char *path, int lvl) { fprintf(stdout, "%s\n", path); }


x86 assembly (clang, -O0):
<filevisitor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filevisitor>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @filevisitor(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct mat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat_rotate(struct mat *, float);
int /*<<< orphan*/ mat_translate(struct mat *, float, float);
void mat_rotate_at(struct mat *this, float angle, float center_x,
                   float center_y) {
  mat_translate(this, center_x, center_y);
  mat_rotate(this, angle);
  mat_translate(this, -center_x, -center_y);
}


x86 assembly (clang, -O0):
<mat_rotate_at>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
call   1030 <mat_translate@plt>
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
call   1040 <mat_rotate@plt>
mov    -0x8(%rbp),%rdi
movss  -0x10(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  -0x14(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
call   1030 <mat_translate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat_rotate_at>:
push   %rbx
sub    $0x30,%rsp
movaps %xmm2,0x20(%rsp)
movaps %xmm1,0x10(%rsp)
movss  %xmm0,0xc(%rsp)
mov    %rdi,%rbx
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
call   1030 <mat_translate@plt>
mov    %rbx,%rdi
movss  0xc(%rsp),%xmm0
call   1040 <mat_rotate@plt>
movaps 0xea8(%rip),%xmm2
movaps 0x10(%rsp),%xmm0
xorps  %xmm2,%xmm0
movaps 0x20(%rsp),%xmm1
xorps  %xmm2,%xmm1
mov    %rbx,%rdi
add    $0x30,%rsp
pop    %rbx
jmp    1030 <mat_translate@plt>

LLVM IR (-O0):
%struct.mat = type { i32 }
define void @mat_rotate_at(%struct.mat* %0, float %1, float %2, float %3) {
%5 = alloca %struct.mat*
%6 = alloca float
%7 = alloca float
%8 = alloca float
store %struct.mat* %0, %struct.mat** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load %struct.mat*, %struct.mat** %5
%10 = load float, float* %7
%11 = load float, float* %8
%12 = call i32 @mat_translate(%struct.mat* %9, float %10, float %11)
%13 = load %struct.mat*, %struct.mat** %5
%14 = load float, float* %6
%15 = call i32 @mat_rotate(%struct.mat* %13, float %14)
%16 = load %struct.mat*, %struct.mat** %5
%17 = load float, float* %7
%18 = fneg float %17
%19 = load float, float* %8
%20 = fneg float %19
%21 = call i32 @mat_translate(%struct.mat* %16, float %18, float %20)
ret void
}

LLVM IR (-O2):
%struct.mat = type { i32 }
define void @mat_rotate_at(%struct.mat* %0, float %1, float %2, float %3) {
%5 = tail call i32 @mat_translate(%struct.mat* %0, float %2, float %3)
%6 = tail call i32 @mat_rotate(%struct.mat* %0, float %1)
%7 = fneg float %2
%8 = fneg float %3
%9 = tail call i32 @mat_translate(%struct.mat* %0, float %7, float %8)
ret void
}
/* Type definitions */
struct ss7_msg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ss7_msg *);
void ss7_msg_free(struct ss7_msg *m) { free(m); }


x86 assembly (clang, -O0):
<ss7_msg_free>:
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):
<ss7_msg_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.ss7_msg = type { i32 }
define void @ss7_msg_free(%struct.ss7_msg* %0) {
%2 = alloca %struct.ss7_msg*
store %struct.ss7_msg* %0, %struct.ss7_msg** %2
%3 = load %struct.ss7_msg*, %struct.ss7_msg** %2
%4 = call i32 @free(%struct.ss7_msg* %3)
ret void
}

LLVM IR (-O2):
%struct.ss7_msg = type { i32 }
define void @ss7_msg_free(%struct.ss7_msg* nocapture %0) {
%2 = tail call i32 @free(%struct.ss7_msg* %0)
ret void
}
/* Variables and functions */
double __llvm_amdgcn_rcp_f64(double);
double __drcp_rd(double x) { return __llvm_amdgcn_rcp_f64(x); }


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

x86 assembly (clang, -O2):
<__drcp_rd>:
jmp    1030 <__llvm_amdgcn_rcp_f64@plt>

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

LLVM IR (-O2):
define double @__drcp_rd(double %0) {
%2 = tail call double @__llvm_amdgcn_rcp_f64(double %0)
ret double %2
}
int getgid() {}


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

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

LLVM IR (-O0):
define i32 @getgid() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @getgid() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int, int, int, int, ...);
int main() {
  printf("sum(10,20,30)=%d\n", sum(3, 10, 20, 30));
  printf("sum(4,20,25,30)=%d\n", sum(4, 4, 20, 25, 30));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0xa,%esi
mov    $0x14,%edx
mov    $0x1e,%ecx
mov    $0x0,%al
call   1040 <sum@plt>
mov    %eax,%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x4,%esi
mov    $0x14,%edx
mov    $0x19,%ecx
mov    $0x1e,%r8d
mov    %esi,%edi
mov    $0x0,%al
call   1040 <sum@plt>
mov    %eax,%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0xa,%esi
mov    $0x14,%edx
mov    $0x1e,%ecx
xor    %eax,%eax
call   1040 <sum@plt>
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x4,%edi
mov    $0x4,%esi
mov    $0x14,%edx
mov    $0x19,%ecx
mov    $0x1e,%r8d
xor    %eax,%eax
call   1040 <sum@plt>
lea    0xea0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"sum(10,20,30)=%d\0A\00"
@.str.1 = [20 x i8] c"sum(4,20,25,30)=%d\0A\00"
define i32 @main() {
%1 = tail call i32 (i32, i32, i32, i32, ...) @sum(i32 3, i32 10, i32 20, i32 30)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (i32, i32, i32, i32, ...) @sum(i32 4, i32 4, i32 20, i32 25, i32 30)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
double pow(double, double);
double pow_dd(double *x, double *y) { return pow(*x, *y); }


x86 assembly (clang, -O0):
<pow_dd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow_dd>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @pow_dd(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = call double @pow(double %6, double %8)
ret double %9
}

LLVM IR (-O2):
define double @pow_dd(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = tail call double @pow(double %3, double %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ free(long *);
long *malloc(size_t);
int /*<<< orphan*/ memset(long *, int, size_t);
int do_malloc_memset(void *args) {
  int i;
  size_t size = (long)args;
  long *foo = malloc(size);
  memset(foo, 42, size);
  free(foo);
  return 0;
}


x86 assembly (clang, -O0):
<do_malloc_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x2a,%esi
call   1040 <memset@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_malloc_memset>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x2a,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @do_malloc_memset(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = ptrtoint i8* %6 to i64
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = call i64* @malloc(i64 %8)
store i64* %9, i64** %5
%10 = load i64*, i64** %5
%11 = load i64, i64* %4
%12 = call i32 @memset(i64* %10, i32 42, i64 %11)
%13 = load i64*, i64** %5
%14 = call i32 @free(i64* %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @do_malloc_memset(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i64* @malloc(i64 %2)
%4 = tail call i32 @memset(i64* %3, i32 42, i64 %2)
%5 = tail call i32 @free(i64* %3)
ret i32 0
}
/* Variables and functions */
int getWideStringSize(unsigned char *);
short *malloc(int);
int /*<<< orphan*/ memcpy(short *, unsigned char *, int);
short *getWideString(unsigned char *in, int *outSize) {
  int size = getWideStringSize(in) + 1;
  short *result = malloc(size * sizeof(short));
  memcpy(result, in, size * sizeof(short));
  *outSize = size;
  return result;
}


x86 assembly (clang, -O0):
<getWideString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <getWideStringSize@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x1,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x1,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getWideString>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1050 <getWideStringSize@plt>
lea    (%rax,%rax,1),%r12d
add    $0x2,%r12d
mov    %eax,%ebp
add    $0x1,%ebp
mov    %r12d,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r12d,%edx
call   1030 <memcpy@plt>
mov    %ebp,(%r14)
mov    %rbx,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i16* @getWideString(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i16*
store i8* %0, i8** %3
store i32* %1, i32** %4
%7 = load i8*, i8** %3
%8 = call i32 @getWideStringSize(i8* %7)
%9 = add nsw i32 %8, 1
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 2
%13 = trunc i64 %12 to i32
%14 = call i16* @malloc(i32 %13)
store i16* %14, i16** %6
%15 = load i16*, i16** %6
%16 = load i8*, i8** %3
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = mul i64 %18, 2
%20 = trunc i64 %19 to i32
%21 = call i32 @memcpy(i16* %15, i8* %16, i32 %20)
%22 = load i32, i32* %5
%23 = load i32*, i32** %4
store i32 %22, i32* %23
%24 = load i16*, i16** %6
ret i16* %24
}

LLVM IR (-O2):
define i16* @getWideString(i8* %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @getWideStringSize(i8* %0)
%4 = add nsw i32 %3, 1
%5 = shl i32 %4, 1
%6 = tail call i16* @malloc(i32 %5)
%7 = tail call i32 @memcpy(i16* %6, i8* %0, i32 %5)
store i32 %4, i32* %1
ret i16* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int main(void) {
  char s1[1024], s2[1024];
  scanf("%s", s1);
  scanf("%s", s2);
  strcat(s1, s2);
  printf("%s\n", s1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x800,%rsp
lea    -0x400(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x800(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x400(%rbp),%rdi
lea    -0x800(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x400(%rbp),%rsi
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x800,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x800,%rsp
lea    0xebd(%rip),%r15
lea    0x400(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
mov    %rsp,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <strcat@plt>
lea    0xe8d(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x800,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%9 = call i32 @strcat(i8* %7, i8* %8)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = call i32 @strcat(i8* %3, i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}