xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: bin2asm [--offset=NUM] [--length=NUM] [--output=FILE]\n"
         "               [--help] [--usage] [--version]\n"
         "                FILE\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [129 x i8] c"Usage: bin2asm [--offset=NUM] [--length=NUM] [--output=FILE]\0A [--help] [--usage] [--version]\0A FILE\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [128 x i8] c"Usage: bin2asm [--offset=NUM] [--length=NUM] [--output=FILE]\0A [--help] [--usage] [--version]\0A FILE\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t TimerCountPerMillisec() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @TimerCountPerMillisec() {
ret i32 1
}
/* Variables and functions */
int setregid(int, int);
int sregid(int a, int b) { return setregid(a, b); }


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

x86 assembly (clang, -O2):
<sregid>:
jmp    1030 <setregid@plt>

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

LLVM IR (-O2):
define i32 @sregid(i32 %0, i32 %1) {
%3 = tail call i32 @setregid(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int /*<<< orphan*/ CPU_CLR(int, int /*<<< orphan*/ *);
void clear_cpu_affinity(int cpu, cpu_set_t *mask) { CPU_CLR(cpu, mask); }


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

x86 assembly (clang, -O2):
<clear_cpu_affinity>:
jmp    1030 <CPU_CLR@plt>

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

LLVM IR (-O2):
define void @clear_cpu_affinity(i32 %0, i32* %1) {
%3 = tail call i32 @CPU_CLR(i32 %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lis(int, int);
int /*<<< orphan*/ ori(int, int, int);
int /*<<< orphan*/ oris(int, int, int);
int /*<<< orphan*/ rldicr(int, int, int, int);
int /*<<< orphan*/ show_table();
void load_register_example() {
  lis(7, 0xaabb);
  ori(7, 7, 0xccdd);
  rldicr(7, 7, 32, 31);
  oris(7, 7, 0xeeff);
  ori(7, 7, 0x1122);
  show_table();
}


x86 assembly (clang, -O0):
<load_register_example>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
mov    $0xaabb,%esi
call   1030 <lis@plt>
mov    $0x7,%esi
mov    $0xccdd,%edx
mov    %esi,%edi
call   1050 <ori@plt>
mov    $0x7,%esi
mov    $0x20,%edx
mov    $0x1f,%ecx
mov    %esi,%edi
call   1040 <rldicr@plt>
mov    $0x7,%esi
mov    $0xeeff,%edx
mov    %esi,%edi
call   1060 <oris@plt>
mov    $0x7,%esi
mov    $0x1122,%edx
mov    %esi,%edi
call   1050 <ori@plt>
mov    $0x0,%al
call   1070 <show_table@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_register_example>:
push   %rax
mov    $0x7,%edi
mov    $0xaabb,%esi
call   1030 <lis@plt>
mov    $0x7,%edi
mov    $0x7,%esi
mov    $0xccdd,%edx
call   1050 <ori@plt>
mov    $0x7,%edi
mov    $0x7,%esi
mov    $0x20,%edx
mov    $0x1f,%ecx
call   1040 <rldicr@plt>
mov    $0x7,%edi
mov    $0x7,%esi
mov    $0xeeff,%edx
call   1060 <oris@plt>
mov    $0x7,%edi
mov    $0x7,%esi
mov    $0x1122,%edx
call   1050 <ori@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <show_table@plt>

LLVM IR (-O0):
define void @load_register_example() {
%1 = call i32 @lis(i32 7, i32 43707)
%2 = call i32 @ori(i32 7, i32 7, i32 52445)
%3 = call i32 @rldicr(i32 7, i32 7, i32 32, i32 31)
%4 = call i32 @oris(i32 7, i32 7, i32 61183)
%5 = call i32 @ori(i32 7, i32 7, i32 4386)
%6 = call i32 (...) @show_table()
ret void
}

LLVM IR (-O2):
define void @load_register_example() {
%1 = tail call i32 @lis(i32 7, i32 43707)
%2 = tail call i32 @ori(i32 7, i32 7, i32 52445)
%3 = tail call i32 @rldicr(i32 7, i32 7, i32 32, i32 31)
%4 = tail call i32 @oris(i32 7, i32 7, i32 61183)
%5 = tail call i32 @ori(i32 7, i32 7, i32 4386)
%6 = tail call i32 (...) @show_table()
ret void
}
/* Variables and functions */
int rand();
int random_number(int min, int max) { return min + rand() % (max - min + 1); }


x86 assembly (clang, -O0):
<random_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_number>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random_number(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 = call i32 (...) @rand()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = srem i32 %6, %10
%12 = add nsw i32 %5, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @random_number(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
int example_exe_function(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @example_exe_function() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ test(char *, int /*<<< orphan*/);
int main() {
  int retVal;
  test("/dev/mod_buf0", O_RDONLY);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"/dev/mod_buf0\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @O_RDONLY
%4 = call i32 @test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"/dev/mod_buf0\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
char *skip_space(char *str) {
  for (; *str && (*str == ' ' || *str == '\t'); str++)
    ;
  return str;
}


x86 assembly (clang, -O0):
<skip_space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1148 <skip_space+0x48>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xa(%rbp)
je     1142 <skip_space+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <skip_space+0x58>
jmp    116e <skip_space+0x6e>
jmp    115d <skip_space+0x5d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_space+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space>:
mov    %rdi,%rax
jmp    1114 <skip_space+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <skip_space+0x10>
cmp    $0x9,%cl
je     1110 <skip_space+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_space(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 9, label %5
i8 32, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void display_usage(const char *program) {
  printf(
      "Usage: %s [ OPTIONS ]\n"
      "Options:\n"
      "[-s, --server SERVER_IP] Remote Server Ip\n"
      "[-p, --port PORT] Remote Server Port\n"
      "[-m, --msg-payload PAYLOAD] Between 0..1500\n"
      "[-t, --total TOTAL_SEND] Number of packets\n"
      "[-S, --scheduler] Scheduler Algorithm (OTHER, BATCH, IDLE, FIFO, RR)\n"
      "[-P, --priority NUMBER] Realtime priority between 0.99 for realtime "
      "schedulers\n"
      "[-c] Use connected udp mode\n"
      "[-h, --help]\n\n",
      program);
  exit(1);
}


x86 assembly (clang, -O0):
<display_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<display_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [388 x i8] c"Usage: %s [ OPTIONS ]\0AOptions:\0A[-s, --server SERVER_IP] Remote Server Ip\0A[-p, --port PORT] Remote Server Port\0A[-m, --msg-payload PAYLOAD] Between 0..1500\0A[-t, --total TOTAL_SEND] Number of packets\0A[-S, --scheduler] Scheduler Algorithm (OTHER, BATCH, IDLE, FIFO, RR)\0A[-P, --priority NUMBER] Realtime priority between 0.99 for realtime schedulers\0A[-c] Use connected udp mode\0A[-h, --help]\0A\0A\00"
define void @display_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([388 x i8], [388 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [388 x i8] c"Usage: %s [ OPTIONS ]\0AOptions:\0A[-s, --server SERVER_IP] Remote Server Ip\0A[-p, --port PORT] Remote Server Port\0A[-m, --msg-payload PAYLOAD] Between 0..1500\0A[-t, --total TOTAL_SEND] Number of packets\0A[-S, --scheduler] Scheduler Algorithm (OTHER, BATCH, IDLE, FIFO, RR)\0A[-P, --priority NUMBER] Realtime priority between 0.99 for realtime schedulers\0A[-c] Use connected udp mode\0A[-h, --help]\0A\0A\00"
define void @display_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([388 x i8], [388 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("open source\n");
  printf("First Github Tranning\n");
  printf("sunkhun is very very hansome");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"open source\0A\00"
@.str.1 = [23 x i8] c"First Github Tranning\0A\00"
@.str.2 = [29 x i8] c"sunkhun is very very hansome\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [29 x i8] c"sunkhun is very very hansome\00"
@str = [12 x i8] c"open source\00"
@str.3 = [22 x i8] c"First Github Tranning\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int Fcntl(int, int /*<<< orphan*/, int);
int O_NONBLOCK;
void Setsockflag_nonblock(int s) {
  int sock_flags;
  sock_flags = Fcntl(s, F_GETFL, 0);
  sock_flags = sock_flags | O_NONBLOCK;
  Fcntl(s, F_SETFL, sock_flags);
}


x86 assembly (clang, -O0):
<Setsockflag_nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <Fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ead(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
call   1030 <Fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Setsockflag_nonblock>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <Fcntl@plt>
mov    0x2ebe(%rip),%rcx
or     (%rcx),%eax
mov    0x2ea5(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <Fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @Setsockflag_nonblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @Fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* @O_NONBLOCK
%9 = or i32 %7, %8
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETFL
%12 = load i32, i32* %3
%13 = call i32 @Fcntl(i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @Setsockflag_nonblock(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @Fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @O_NONBLOCK
%5 = or i32 %4, %3
%6 = load i32, i32* @F_SETFL
%7 = tail call i32 @Fcntl(i32 %0, i32 %6, i32 %5)
ret void
}
float img_deflect_nordic(float db) {
  return (1.0 / 48.0) * (db - 18) + (54 / 48.0);
}


x86 assembly (clang, -O0):
<img_deflect_nordic>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xefa(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeda(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<img_deflect_nordic>:
addss  0xef8(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @img_deflect_nordic(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float %3, 1.800000e+01
%5 = fpext float %4 to double
%6 = call double @llvm.fmuladd.f64(double 0x3F95555555555555, double %5, double 1.125000e+00)
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @img_deflect_nordic(float %0) {
%2 = fadd float %0, -1.800000e+01
%3 = fpext float %2 to double
%4 = tail call double @llvm.fmuladd.f64(double %3, double 0x3F95555555555555, double 1.125000e+00)
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int strlen(char *);
void test_strlen() {
  assert(strlen(NULL) == 0);
  assert(strlen("1") == 1);
  assert(strlen("123") == 3);
}


x86 assembly (clang, -O0):
<test_strlen>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <strlen@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xebc(%rip),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xea2(%rip),%rdi
call   1030 <strlen@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strlen>:
push   %rax
xor    %edi,%edi
call   1030 <strlen@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xec4(%rip),%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xeac(%rip),%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@.str.1 = [4 x i8] c"123\00"
define void @test_strlen() {
%1 = call i32 @strlen(i8* null)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32 %9, 3
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [4 x i8] c"123\00"
define void @test_strlen() {
%1 = tail call i32 @strlen(i8* null)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32 %9, 3
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret void
}
int test_imm_A3int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xA3 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A3int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 163
%7 = icmp ne i64 %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_A3int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 700079669248
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int _printChar(char c) {
  putc(c, stdout);
  return 0;
}


x86 assembly (clang, -O0):
<_printChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    0x2eb8(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1030 <putc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_printChar>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
call   1030 <putc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @_printChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = load i32, i32* @stdout
%5 = call i32 @putc(i8 signext %3, i32 %4)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @_printChar(i8 signext %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @putc(i8 signext %0, i32 %2)
ret i32 0
}
void hugetlb_report_meminfo(struct seq_file *m) {}


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

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

LLVM IR (-O0):
%struct.seq_file = type opaque
define void @hugetlb_report_meminfo(%struct.seq_file* %0) {
%2 = alloca %struct.seq_file*
store %struct.seq_file* %0, %struct.seq_file** %2
ret void
}

LLVM IR (-O2):
%struct.seq_file = type opaque
define void @hugetlb_report_meminfo(%struct.seq_file* nocapture %0) {
ret void
}
/* Variables and functions */
char *strerror_r(int, char *, size_t);
char *g_strerr_r(int errnum, char *buf, size_t buflen) {
  return strerror_r(errnum, buf, buflen);
}


x86 assembly (clang, -O0):
<g_strerr_r>:
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
call   1030 <strerror_r@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_strerr_r>:
jmp    1030 <strerror_r@plt>

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

LLVM IR (-O2):
define i8* @g_strerr_r(i32 %0, i8* %1, i64 %2) {
%4 = tail call i8* @strerror_r(i32 %0, i8* %1, i64 %2)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) void
dbg_vPrintfNullImpl(const char *Private_pcSrcFileName,
                    uint32_t Private_u32SrcLineNumber, const char *pcFormat,
                    ...) {}


x86 assembly (clang, -O0):
<dbg_vPrintfNullImpl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dbg_vPrintfNullImpl(i8* %0, i32 %1, i8* %2, ...) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @dbg_vPrintfNullImpl(i8* nocapture %0, i32 %1, i8* nocapture %2, ...) {
ret void
}
void float64Clear(double *data) { *data = 0.0; }


x86 assembly (clang, -O0):
<float64Clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<float64Clear>:
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @float64Clear(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
store double 0.000000e+00, double* %3
ret void
}

LLVM IR (-O2):
define void @float64Clear(double* nocapture writeonly %0) {
store double 0.000000e+00, double* %0
ret void
}
/* Variables and functions */
int syscall(int, int, int);
int chuid(int uid, int gid) { return syscall(5, uid, gid); }


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

x86 assembly (clang, -O2):
<chuid>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x5,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @chuid(i32 %0, i32 %1) {
%3 = tail call i32 @syscall(i32 5, i32 %0, i32 %1)
ret i32 %3
}
int test_imm_34uint8_mem(unsigned char *val) {
  return ((*val) & (-0x34 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_34uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -52
%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_34uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -52
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void alarm_wakeup(int i) { printf("%d sec up partner, Wakeup!!!\n", 1000); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"%d sec up partner, Wakeup!!!\0A\00"
define void @alarm_wakeup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 1000)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"%d sec up partner, Wakeup!!!\0A\00"
define void @alarm_wakeup(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 1000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, unsigned int);
int /*<<< orphan*/ stdout;
int progress(unsigned percent) {
  printf("\x08\x08\x08\x08%3d%%", percent);
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<progress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<progress>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"\08\08\08\08%3d%%\00"
@stdout = global i32 0
define i32 @progress(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret i32 0
}
/* Variables and functions */
int f(int);
int g(int);
int getint();
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ putint(int);
int main() {
  int a;
  a = getint();
  int b;
  b = f(a) + g(a);
  putint(b);
  putchar(10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <getint@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <f@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1070 <g@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <getint@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <f@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1070 <g@plt>
add    %eax,%ebp
mov    %ebp,%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @getint()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @f(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @g(i32 %7)
%9 = add nsw i32 %6, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @putint(i32 %10)
%12 = call i32 @putchar(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getint()
%2 = tail call i32 @f(i32 %1)
%3 = tail call i32 @g(i32 %1)
%4 = add nsw i32 %3, %2
%5 = tail call i32 @putint(i32 %4)
%6 = tail call i32 @putchar(i32 10)
ret i32 0
}
int is_dir_separator(char c) { return (c == '/'); }


x86 assembly (clang, -O0):
<is_dir_separator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir_separator>:
xor    %eax,%eax
cmp    $0x2f,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_dir_separator(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 47
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_dir_separator(i8 signext %0) {
%2 = icmp eq i8 %0, 47
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void pr_binding(int i, int j) { printf("%d -> %d; ", i, j); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"%d -> %d; \00"
define void @pr_binding(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
int __attribute__((always_)) test(double b) {
  double c = 1.01 * b;
  return __builtin_isinf(c);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xee9(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xecd(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mulsd  0xef8(%rip),%xmm0
andpd  0xf00(%rip),%xmm0
xor    %eax,%eax
ucomisd 0xeee(%rip),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @test(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double 1.010000e+00, %4
store double %5, double* %3
%6 = load double, double* %3
%7 = call double @llvm.fabs.f64(double %6)
%8 = fcmp oeq double %7, 0x7FF0000000000000
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @test(double %0) {
%2 = fmul double %0, 1.010000e+00
%3 = tail call double @llvm.fabs.f64(double %2)
%4 = fcmp oeq double %3, 0x7FF0000000000000
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ regex_t;

/* Variables and functions */
int REG_EXTENDED;
int REG_ICASE;
int /*<<< orphan*/ free(char *);
char *globals_to_regex(char const *);
int regcomp(int /*<<< orphan*/ *, char *, int);
int global_compile_as_re(const char global[], regex_t *re) {
  char *regex;
  int result;
  regex = globals_to_regex(global);
  result = regcomp(re, regex, REG_EXTENDED | REG_ICASE);
  free(regex);
  return result;
}


x86 assembly (clang, -O0):
<global_compile_as_re>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <globals_to_regex@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2e7c(%rip),%rax
mov    (%rax),%edx
mov    0x2e83(%rip),%rax
or     (%rax),%edx
call   1040 <regcomp@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<global_compile_as_re>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
call   1050 <globals_to_regex@plt>
mov    %rax,%rbx
mov    0x2e92(%rip),%rax
mov    0x2e9b(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <regcomp@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@REG_EXTENDED = global i32 0
@REG_ICASE = global i32 0
define i32 @global_compile_as_re(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
%7 = load i8*, i8** %3
%8 = call i8* @globals_to_regex(i8* %7)
store i8* %8, i8** %5
%9 = load i32*, i32** %4
%10 = load i8*, i8** %5
%11 = load i32, i32* @REG_EXTENDED
%12 = load i32, i32* @REG_ICASE
%13 = or i32 %11, %12
%14 = call i32 @regcomp(i32* %9, i8* %10, i32 %13)
store i32 %14, i32* %6
%15 = load i8*, i8** %5
%16 = call i32 @free(i8* %15)
%17 = load i32, i32* %6
ret i32 %17
}

LLVM IR (-O2):
@REG_EXTENDED = global i32 0
@REG_ICASE = global i32 0
define i32 @global_compile_as_re(i8* %0, i32* %1) {
%3 = tail call i8* @globals_to_regex(i8* %0)
%4 = load i32, i32* @REG_EXTENDED
%5 = load i32, i32* @REG_ICASE
%6 = or i32 %5, %4
%7 = tail call i32 @regcomp(i32* %1, i8* %3, i32 %6)
%8 = tail call i32 @free(i8* %3)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
extern void mem_free(void *p) { free(p); }


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

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

LLVM IR (-O2):
define void @mem_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  int a, b;
  a = 10;
  b = 11;
  a >= b ? printf("a e maior ou igual a b")
         : printf("a nao e maior ou igual a b");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0xb,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     114a <main+0x3a>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
jmp    1156 <main+0x46>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"a e maior ou igual a b\00"
@.str.1 = [27 x i8] c"a nao e maior ou igual a b\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 11, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = icmp sge i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c"a nao e maior ou igual a b\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void js_maths(int js_range, float js_d, int js_m) {
  js_range = 32767;
  js_d = 65.534;
  js_m = 2;
}


x86 assembly (clang, -O0):
<js_maths>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x7fff,-0x4(%rbp)
movss  0xee2(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @js_maths(i32 %0, float %1, i32 %2) {
%4 = alloca i32
%5 = alloca float
%6 = alloca i32
store i32 %0, i32* %4
store float %1, float* %5
store i32 %2, i32* %6
store i32 32767, i32* %4
store float 0x4050622D00000000, float* %5
store i32 2, i32* %6
ret void
}

LLVM IR (-O2):
define void @js_maths(i32 %0, float %1, i32 %2) {
ret void
}
long ALARM(sec)
long *sec;
{
  unsigned alarm();
  return ((long)alarm(*sec));
}


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

x86 assembly (clang, -O2):
<ALARM>:
push   %rax
mov    (%rdi),%rdi
xor    %eax,%eax
call   1030 <alarm@plt>
mov    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @ALARM(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = call i32 (i64, ...) bitcast (i32 (...)* @alarm to i32 (i64, ...)*)(i64 %4)
%6 = zext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @ALARM(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = tail call i32 (i64, ...) bitcast (i32 (...)* @alarm to i32 (i64, ...)*)(i64 %2)
%4 = zext i32 %3 to i64
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcscpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void uninivar_wcscpy(void) {
  wchar_t *str1;
  wchar_t *str2;
  (void)wcscpy(str1, str2);
}


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

x86 assembly (clang, -O2):
<uninivar_wcscpy>:
jmp    1030 <wcscpy@plt>

LLVM IR (-O0):
define void @uninivar_wcscpy() {
%1 = alloca i32*
%2 = alloca i32*
%3 = load i32*, i32** %1
%4 = load i32*, i32** %2
%5 = call i32 @wcscpy(i32* %3, i32* %4)
ret void
}

LLVM IR (-O2):
define void @uninivar_wcscpy() {
%1 = tail call i32 @wcscpy(i32* undef, i32* undef)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) void BME_AND_B(volatile uint8_t *addr,
                                        register uint8_t wdata) {
  *(volatile uint8_t *)((uint32_t)addr | (1 << 26)) = wdata;
}


x86 assembly (clang, -O0):
<BME_AND_B>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
or     $0x4000000,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BME_AND_B>:
movslq %edi,%rax
or     $0x4000000,%rax
mov    %esi,(%rax)
ret

LLVM IR (-O0):
define void @BME_AND_B(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = ptrtoint i32* %6 to i32
%8 = or i32 %7, 67108864
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %5, i32* %10
ret void
}

LLVM IR (-O2):
define void @BME_AND_B(i32* %0, i32 %1) {
%3 = ptrtoint i32* %0 to i64
%4 = shl i64 %3, 32
%5 = ashr exact i64 %4, 32
%6 = or i64 %5, 67108864
%7 = inttoptr i64 %6 to i32*
store volatile i32 %1, i32* %7
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  char *chars;
};
typedef TYPE_1__ XTextItem;

/* Variables and functions */
void set_XTextItem_chars(void *_p, void *_v) {
  ((XTextItem *)_p)->chars = (char *)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XTextItem_chars(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
OP(dd, a3) { op_a3(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_a3@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_a3()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print(char *url, void *arg) { fprintf(stderr, "%s\n", (char *)url); }


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @print(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%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):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @print(i8* %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @stderr
%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
}
/* Variables and functions */
int /*<<< orphan*/ Reserved59_DriverIRQHandler();
__attribute__((weak)) void Reserved59_IRQHandler(void) {
  Reserved59_DriverIRQHandler();
}


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

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

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

LLVM IR (-O2):
define weak void @Reserved59_IRQHandler() {
%1 = tail call i32 (...) @Reserved59_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("./bt_log log_file\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"./bt_log log_file\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [18 x i8] c"./bt_log log_file\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}