xunge/DecIR huggingface dataset:
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR98_get(void) { return U_WMRCORENONE_get("U_WMR98"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR98\00"
define i32 @U_WMR98_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void clear_line(char line[]) {
  int i = 0;
  for (i = 0; line[i] != '\0'; i++) {
    line[i] = 0;
  };
}


x86 assembly (clang, -O0):
<clear_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1145 <clear_line+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <clear_line+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_line>:
cmpb   $0x0,(%rdi)
je     111d <clear_line+0x1d>
add    $0x1,%rdi
nopl   0x0(%rax)
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <clear_line+0x10>
ret

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

LLVM IR (-O2):
define void @clear_line(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
store i8 0, i8* %6
%7 = add nuw nsw i64 %5, 1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ select(int /*<<< orphan*/, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          struct timeval *);
void mmsleep(int ms) {
  struct timeval delay;
  delay.tv_sec = 0;
  delay.tv_usec = ms * 1000;
  select(0, NULL, NULL, NULL, &delay);
}


x86 assembly (clang, -O0):
<mmsleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
imul   $0x3e8,-0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x18(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmsleep>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
imul   $0x3e8,%edi,%eax
mov    %eax,0x8(%rsp)
lea    0x8(%rsp),%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define void @mmsleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timeval
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i64 0, i64* %4
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i32 %6, i32* %7
%8 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %3)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define void @mmsleep(i32 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i64 0, i64* %4
%5 = mul nsw i32 %0, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i32 %5, i32* %6
%7 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ generateMonitorRead();
int /*<<< orphan*/ outUsedTime(int);
int /*<<< orphan*/ processGenome();
int main(void) {
  outUsedTime(0);
  processGenome();
  generateMonitorRead();
  outUsedTime(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <outUsedTime@plt>
mov    $0x0,%al
call   1040 <processGenome@plt>
mov    $0x0,%al
call   1050 <generateMonitorRead@plt>
mov    $0x1,%edi
call   1030 <outUsedTime@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <outUsedTime@plt>
xor    %eax,%eax
call   1040 <processGenome@plt>
xor    %eax,%eax
call   1050 <generateMonitorRead@plt>
mov    $0x1,%edi
call   1030 <outUsedTime@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @outUsedTime(i32 0)
%3 = call i32 (...) @processGenome()
%4 = call i32 (...) @generateMonitorRead()
%5 = call i32 @outUsedTime(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @outUsedTime(i32 0)
%2 = tail call i32 (...) @processGenome()
%3 = tail call i32 (...) @generateMonitorRead()
%4 = tail call i32 @outUsedTime(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _koberic__globalVarInit();
int _koberic_main();
int main(int argc, const char *argv[]) {
  _koberic__globalVarInit();
  return _koberic_main();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <_koberic__globalVarInit@plt>
mov    $0x0,%al
call   1040 <_koberic_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @_koberic__globalVarInit()
%4 = tail call i32 (...) @_koberic_main()
ret i32 %4
}
int test_imm_47int16_reg(short val) {
  return ((val) & (-0x47 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_47int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffb9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_47int16_reg>:
test   $0xffb9,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_47int16_reg(i16 signext %0) {
%2 = and i16 %0, -71
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void opal_atomic_wmb(void) { __sync_synchronize(); }


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

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

LLVM IR (-O0):
define void @opal_atomic_wmb() {
fence seq_cst
ret void
}

LLVM IR (-O2):
define void @opal_atomic_wmb() {
fence seq_cst
ret void
}
/* Variables and functions */
int system_c4_(char *, long);
int system_c8_(char *command, long len_command) {
  return system_c4_(command, len_command);
}


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

x86 assembly (clang, -O2):
<system_c8_>:
jmp    1030 <system_c4_@plt>

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

LLVM IR (-O2):
define i32 @system_c8_(i8* %0, i64 %1) {
%3 = tail call i32 @system_c4_(i8* %0, i64 %1)
ret i32 %3
}
int ima_path_check(struct path *path, int mask) { return 0; }


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

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

LLVM IR (-O0):
%struct.path = type opaque
define i32 @ima_path_check(%struct.path* %0, i32 %1) {
%3 = alloca %struct.path*
%4 = alloca i32
store %struct.path* %0, %struct.path** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.path = type opaque
define i32 @ima_path_check(%struct.path* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
char **stb_tokens_raw(char *, char *, int *, int, int, int /*<<< orphan*/,
                      int /*<<< orphan*/);
char **stb_tokens_quoted(char *src, char *delimit, int *count) {
  return stb_tokens_raw(src, delimit, count, 2, 1, 0, 0);
}


x86 assembly (clang, -O0):
<stb_tokens_quoted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x2,%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
movl   $0x0,(%rsp)
call   1030 <stb_tokens_raw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_tokens_quoted>:
push   %rax
movl   $0x0,(%rsp)
mov    $0x2,%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1030 <stb_tokens_raw@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i8** @stb_tokens_quoted(i8* %0, i8* %1, i32* %2) {
%4 = tail call i8** @stb_tokens_raw(i8* %0, i8* %1, i32* %2, i32 2, i32 1, i32 0, i32 0)
ret i8** %4
}
int os_peek_colour(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @os_peek_colour() {
ret i32 2
}

LLVM IR (-O2):
define i32 @os_peek_colour() {
ret i32 2
}
double pi() { return 3.14159265358979323846; }


x86 assembly (clang, -O0):
<pi>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @pi() {
ret double 0x400921FB54442D18
}

LLVM IR (-O2):
define double @pi() {
ret double 0x400921FB54442D18
}
/* Variables and functions */
unsigned int rand();
unsigned int GenerazioneCasualeNumero(unsigned int intervallo) {
  return 1 + rand() % intervallo;
}


x86 assembly (clang, -O0):
<GenerazioneCasualeNumero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
xor    %edx,%edx
divl   -0x4(%rbp)
mov    %edx,%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenerazioneCasualeNumero>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
xor    %edx,%edx
div    %ebx
lea    0x1(%rdx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @GenerazioneCasualeNumero(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = urem i32 %3, %4
%6 = add i32 1, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @GenerazioneCasualeNumero(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = urem i32 %2, %0
%4 = add nuw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  int area, permeter;
  scanf("%d %d", &a, &b);
  area = a * b;
  permeter = 2 * (a + b);
  printf("area = %d,permeter = %d\n", area, permeter);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%edx
mov    %edx,%esi
imul   %eax,%esi
add    %eax,%edx
add    %edx,%edx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [25 x i8] c"area = %d,permeter = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = mul nsw i32 %7, %8
store i32 %9, i32* %4
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
%13 = mul nsw i32 2, %12
store i32 %13, i32* %5
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [25 x i8] c"area = %d,permeter = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, %6
%9 = add nsw i32 %7, %6
%10 = shl nsw i32 %9, 1
%11 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %10)
ret i32 0
}
/* Variables and functions */
int TCSETS;
int get_termios_set_ioctl(void) { return TCSETS; }


x86 assembly (clang, -O0):
<get_termios_set_ioctl>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_termios_set_ioctl>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@TCSETS = global i32 0
define i32 @get_termios_set_ioctl() {
%1 = load i32, i32* @TCSETS
ret i32 %1
}

LLVM IR (-O2):
@TCSETS = global i32 0
define i32 @get_termios_set_ioctl() {
%1 = load i32, i32* @TCSETS
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ns_convert(char *, int, int);
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int main(void) {
  puts(ns_convert("-60EA4.54DF", 16, 25));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"-60EA4.54DF\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @ns_convert(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 16, i32 25)
%3 = call i32 @puts(i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"-60EA4.54DF\00"
define i32 @main() {
%1 = tail call i32 @ns_convert(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 16, i32 25)
%2 = tail call i32 @puts(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ linked_list_example();
int /*<<< orphan*/ vector_example();
int main(void) {
  vector_example();
  linked_list_example();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <vector_example@plt>
xor    %eax,%eax
call   1040 <linked_list_example@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @vector_example()
%3 = call i32 (...) @linked_list_example()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @vector_example()
%2 = tail call i32 (...) @linked_list_example()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, void *, size_t);
void *realloc(void *, size_t);
void *erealloc(void *ptr, size_t size) {
  void *ret;
  if (NULL == (ret = realloc(ptr, size)))
    fatal("realloc(%p, %zu) failed:", ptr, size);
  return ret;
}


x86 assembly (clang, -O0):
<erealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,%rcx
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
jne    1163 <erealloc+0x43>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xea2(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erealloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114a <erealloc+0x2a>
lea    0xec1(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [25 x i8] c"realloc(%p, %zu) failed:\00"
define i8* @erealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = icmp eq i8* null, %8
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %11, i64 %12)
br label %14
14: ; preds = %10, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [25 x i8] c"realloc(%p, %zu) failed:\00"
define noalias i8* @erealloc(i8* %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
scalar_t__ ceil(size_t);
size_t TKEstimateBas64EncodedDataSize(size_t inDataSize) {
  size_t theEncodedDataSize = (int)ceil(inDataSize / 3.0) * 4;
  theEncodedDataSize = theEncodedDataSize / 72 * 74 + theEncodedDataSize % 72;
  return (theEncodedDataSize);
}


x86 assembly (clang, -O0):
<TKEstimateBas64EncodedDataSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movaps 0xedd(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xedc(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xed5(%rip),%xmm1
divsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rdi
mov    %rdi,%rcx
sar    $0x3f,%rcx
movsd  0xec2(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
and    %rcx,%rax
or     %rax,%rdi
call   1030 <ceil@plt>
shl    $0x2,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x48,%ecx
xor    %edx,%edx
div    %rcx
imul   $0x4a,%rax,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x48,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x18(%rbp),%rax
add    %rdx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TKEstimateBas64EncodedDataSize>:
push   %rax
movq   %rdi,%xmm0
punpckldq 0xee2(%rip),%xmm0
subpd  0xeea(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
divsd  0xee6(%rip),%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rcx
sar    $0x3f,%rcx
subsd  0xeda(%rip),%xmm1
cvttsd2si %xmm1,%rdi
and    %rcx,%rdi
or     %rax,%rdi
call   1030 <ceil@plt>
shl    $0x2,%eax
movslq %eax,%rcx
movabs $0xe38e38e38e38e38f,%rdx
38 8e e3
mov    %rcx,%rax
mul    %rdx
shr    $0x6,%rdx
imul   $0x4a,%rdx,%rax
shl    $0x3,%rdx
lea    (%rdx,%rdx,8),%rdx
sub    %rdx,%rcx
add    %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @TKEstimateBas64EncodedDataSize(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = uitofp i64 %4 to double
%6 = fdiv double %5, 3.000000e+00
%7 = fptoui double %6 to i64
%8 = call i64 @ceil(i64 %7)
%9 = trunc i64 %8 to i32
%10 = mul nsw i32 %9, 4
%11 = sext i32 %10 to i64
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = udiv i64 %12, 72
%14 = mul i64 %13, 74
%15 = load i64, i64* %3
%16 = urem i64 %15, 72
%17 = add i64 %14, %16
store i64 %17, i64* %3
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
define i64 @TKEstimateBas64EncodedDataSize(i64 %0) {
%2 = uitofp i64 %0 to double
%3 = fdiv double %2, 3.000000e+00
%4 = fptoui double %3 to i64
%5 = tail call i64 @ceil(i64 %4)
%6 = trunc i64 %5 to i32
%7 = shl nsw i32 %6, 2
%8 = sext i32 %7 to i64
%9 = udiv i64 %8, 72
%10 = mul i64 %9, 74
%11 = urem i64 %8, 72
%12 = add i64 %10, %11
ret i64 %12
}
int test_imm_9Eint16_reg(short val) {
  return ((val) & (0x9E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Eint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x9e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_9Eint16_reg(i16 signext %0) {
%2 = and i16 %0, 158
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void IN_NULL_WaitKey() {}


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

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

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

LLVM IR (-O2):
define void @IN_NULL_WaitKey() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void write(int a[]) {
  int i;
  for (i = 0; i < *a; printf("%d ", a[++i]))
    ;
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jge    115b <write+0x4b>
jmp    1137 <write+0x27>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
jmp    1123 <write+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
push   %r15
push   %r14
push   %rbx
cmpl   $0x0,(%rdi)
jle    1149 <write+0x39>
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    0x4(%r15,%rbx,4),%esi
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <printf@plt>
movslq (%r15),%rax
cmp    %rax,%rbx
jl     1130 <write+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @write(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i64 %5, 1
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %0
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %6, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ s_free(void *);
void sds_free(void *ptr) { s_free(ptr); }


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

x86 assembly (clang, -O2):
<sds_free>:
jmp    1030 <s_free@plt>

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

LLVM IR (-O2):
define void @sds_free(i8* %0) {
%2 = tail call i32 @s_free(i8* %0)
ret void
}
void metal_bitmap_set_bit(unsigned long *bitmap, int bit) {
  bitmap[bit / (8 * sizeof(unsigned long))] |=
      (1UL << (bit & ((8 * sizeof(unsigned long)) - 1)));
}


x86 assembly (clang, -O0):
<metal_bitmap_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
and    $0x3f,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shr    $0x6,%rcx
or     (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<metal_bitmap_set_bit>:
movslq %esi,%rcx
mov    $0x1,%eax
shl    %cl,%rax
shr    $0x6,%rcx
or     %rax,(%rdi,%rcx,8)
ret

LLVM IR (-O0):
define void @metal_bitmap_set_bit(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = and i64 %6, 63
%8 = shl i64 1, %7
%9 = load i64*, i64** %3
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = udiv i64 %11, 64
%13 = getelementptr inbounds i64, i64* %9, i64 %12
%14 = load i64, i64* %13
%15 = or i64 %14, %8
store i64 %15, i64* %13
ret void
}

LLVM IR (-O2):
define void @metal_bitmap_set_bit(i64* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = and i64 %3, 63
%5 = shl nuw i64 1, %4
%6 = lshr i64 %3, 6
%7 = getelementptr inbounds i64, i64* %0, i64 %6
%8 = load i64, i64* %7
%9 = or i64 %8, %5
store i64 %9, i64* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) { printf("\nInside main ()"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [16 x i8] c"\0AInside main ()\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0AInside main ()\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
long double log(double);
long double logl(long double x) { return log((double)x); }


x86 assembly (clang, -O0):
<logl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <log@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <log@plt>

LLVM IR (-O0):
define x86_fp80 @logl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @log(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @logl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @log(double %2)
ret x86_fp80 %3
}
float none(float input) { return input; }


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

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

LLVM IR (-O0):
define float @none(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
ret float %3
}

LLVM IR (-O2):
define float @none(float returned %0) {
ret float %0
}
int binaryEqual(char *a, char *b, unsigned short len) {
  while (len-- > 0)
    if (*a++ != *b++)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<binaryEqual>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
mov    -0x1a(%rbp),%ax
mov    %ax,%cx
add    $0xffff,%cx
mov    %cx,-0x1a(%rbp)
movzwl %ax,%eax
cmp    $0x0,%eax
jle    116b <binaryEqual+0x6b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1166 <binaryEqual+0x66>
movl   $0x0,-0x4(%rbp)
jmp    1172 <binaryEqual+0x72>
jmp    1113 <binaryEqual+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binaryEqual>:
mov    %edx,%r8d
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %cx,%r8w
je     1129 <binaryEqual+0x29>
movzbl (%rdi,%rcx,1),%edx
lea    0x1(%rcx),%rax
cmp    (%rsi,%rcx,1),%dl
mov    %rax,%rcx
je     1110 <binaryEqual+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @binaryEqual(i8* nocapture %0, i8* nocapture %1, i16 zeroext %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %0, %3 ], [ %11, %9 ]
%6 = phi i8* [ %1, %3 ], [ %13, %9 ]
%7 = phi i16 [ %2, %3 ], [ %10, %9 ]
%8 = icmp eq i16 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %4
%10 = add i16 %7, -1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = load i8, i8* %5
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %6
%15 = icmp eq i8 %12, %14
br i1 %15, label %4, label %16
16: ; preds = %4, %9
%17 = phi i32 [ 0, %9 ], [ 1, %4 ]
ret i32 %17
}
int baz(int x, int y, int z, int u, int v) { return x >> v; }


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x14(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
mov    %r8d,%ecx
mov    %edi,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @baz(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %10
%13 = ashr i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @baz(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = ashr i32 %0, %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void _putchar(char c) { putchar(c); }


x86 assembly (clang, -O0):
<_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_putchar>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @_putchar(i8 signext %0) {
%2 = tail call i32 @putchar(i8 signext %0)
ret void
}
/* Variables and functions */
int recv(int, void *, int, int /*<<< orphan*/);
int _sapi_inet_tcp_receive(int sock, void *data, int datalen) {
  return recv(sock, (void *)data, datalen, 0);
}


x86 assembly (clang, -O0):
<_sapi_inet_tcp_receive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sapi_inet_tcp_receive>:
xor    %ecx,%ecx
jmp    1030 <recv@plt>

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

LLVM IR (-O2):
define i32 @_sapi_inet_tcp_receive(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ logGenericOptions();
int /*<<< orphan*/ logMsg(char *, char const *);
void logCmdHelp(const char *aCmd) {
  logMsg("Usage: %s [options]\n", aCmd);
  logGenericOptions();
}


x86 assembly (clang, -O0):
<logCmdHelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <logMsg@plt>
mov    $0x0,%al
call   1030 <logGenericOptions@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logCmdHelp>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <logMsg@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <logGenericOptions@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Usage: %s [options]\0A\00"
define void @logCmdHelp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @logMsg(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (...) @logGenericOptions()
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Usage: %s [options]\0A\00"
define void @logCmdHelp(i8* %0) {
%2 = tail call i32 @logMsg(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (...) @logGenericOptions()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mcharinp();
scalar_t__ minprdy();
void purgeline() {
  while (minprdy())
    mcharinp();
}


x86 assembly (clang, -O0):
<purgeline>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <purgeline+0x9>
mov    $0x0,%al
call   1040 <minprdy@plt>
cmp    $0x0,%rax
je     1146 <purgeline+0x26>
mov    $0x0,%al
call   1030 <mcharinp@plt>
jmp    1129 <purgeline+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<purgeline>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <minprdy@plt>
test   %rax,%rax
je     1145 <purgeline+0x25>
xor    %eax,%eax
call   1030 <mcharinp@plt>
jmp    1130 <purgeline+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @purgeline() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @minprdy()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 (...) @mcharinp()
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @purgeline() {
%1 = tail call i64 (...) @minprdy()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @mcharinp()
%5 = tail call i64 (...) @minprdy()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void hello_cab202() { printf("%s", "Hello CAB202!\n"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [15 x i8] c"Hello CAB202!\0A\00"
define void @hello_cab202() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [15 x i8] c"Hello CAB202!\0A\00"
define void @hello_cab202() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ half_isolanis(int);
void half_isolanis_test(void **state) {
  assert_int_equal(0x0000000000004400ul, half_isolanis(0x0000000000007C00ul));
}


x86 assembly (clang, -O0):
<half_isolanis_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x7c00,%edi
call   1030 <half_isolanis@plt>
mov    %eax,%esi
mov    $0x4400,%edi
call   1040 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<half_isolanis_test>:
push   %rax
mov    $0x7c00,%edi
call   1030 <half_isolanis@plt>
mov    $0x4400,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @half_isolanis_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @half_isolanis(i32 31744)
%4 = call i32 @assert_int_equal(i32 17408, i32 %3)
ret void
}

LLVM IR (-O2):
define void @half_isolanis_test(i8** nocapture readnone %0) {
%2 = tail call i32 @half_isolanis(i32 31744)
%3 = tail call i32 @assert_int_equal(i32 17408, i32 %2)
ret void
}
/* Variables and functions */
int exp(double);
double Logistic_Sigmoid(double x) {
  double y;
  y = 1.0 / (1 + exp(-x));
  return y;
}


x86 assembly (clang, -O0):
<Logistic_Sigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xeb3(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Logistic_Sigmoid>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <exp@plt>
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xee4(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @Logistic_Sigmoid(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fneg double %4
%6 = call i32 @exp(double %5)
%7 = add nsw i32 1, %6
%8 = sitofp i32 %7 to double
%9 = fdiv double 1.000000e+00, %8
store double %9, double* %3
%10 = load double, double* %3
ret double %10
}

LLVM IR (-O2):
define double @Logistic_Sigmoid(double %0) {
%2 = fneg double %0
%3 = tail call i32 @exp(double %2)
%4 = add nsw i32 %3, 1
%5 = sitofp i32 %4 to double
%6 = fdiv double 1.000000e+00, %5
ret double %6
}
int numCoeffs_so3(int bw, int m1) { return (bw * bw - m1 * m1); }


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

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

LLVM IR (-O0):
define i32 @numCoeffs_so3(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* %3
%7 = mul nsw i32 %5, %6
%8 = load i32, i32* %4
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @numCoeffs_so3(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, %0
%4 = mul nsw i32 %1, %1
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ XEvent;
typedef int /*<<< orphan*/ Widget;
typedef scalar_t__ String;
typedef scalar_t__ Cardinal;

/* Variables and functions */
int /*<<< orphan*/ focus_cmd(scalar_t__);
void focus_keyboard(Widget w, XEvent *ev, String *s, Cardinal *n) {
  if (n && *n && s && *s)
    focus_cmd(*s);
}


x86 assembly (clang, -O0):
<focus_keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1165 <focus_keyboard+0x55>
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
je     1165 <focus_keyboard+0x55>
cmpq   $0x0,-0x18(%rbp)
je     1165 <focus_keyboard+0x55>
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1165 <focus_keyboard+0x55>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <focus_cmd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<focus_keyboard>:
test   %rcx,%rcx
je     112d <focus_keyboard+0x1d>
test   %rdx,%rdx
je     112d <focus_keyboard+0x1d>
cmpq   $0x0,(%rcx)
je     112d <focus_keyboard+0x1d>
mov    (%rdx),%rdi
test   %rdi,%rdi
je     112d <focus_keyboard+0x1d>
jmp    1030 <focus_cmd@plt>
ret

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

LLVM IR (-O2):
define void @focus_keyboard(i32 %0, i32* nocapture readnone %1, i64* %2, i64* %3) {
%5 = icmp eq i64* %3, null
br i1 %5, label %16, label %6
6: ; preds = %4
%7 = load i64, i64* %3
%8 = icmp ne i64 %7, 0
%9 = icmp ne i64* %2, null
%10 = and i1 %9, %8
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = load i64, i64* %2
%13 = icmp eq i64 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = tail call i32 @focus_cmd(i64 %12)
br label %16
16: ; preds = %14, %11, %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clock();
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ mix(int /*<<< orphan*/, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void init_random() { srand(mix(clock(), time(NULL), getpid())); }


x86 assembly (clang, -O0):
<init_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <clock@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    %eax,%edx
call   1050 <mix@plt>
mov    %eax,%edi
call   1060 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_random>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <clock@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1050 <mix@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <srand@plt>

LLVM IR (-O0):
define void @init_random() {
%1 = call i32 (...) @clock()
%2 = call i32 @time(i32* null)
%3 = call i32 (...) @getpid()
%4 = call i32 @mix(i32 %1, i32 %2, i32 %3)
%5 = call i32 @srand(i32 %4)
ret void
}

LLVM IR (-O2):
define void @init_random() {
%1 = tail call i32 (...) @clock()
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @mix(i32 %1, i32 %2, i32 %3)
%5 = tail call i32 @srand(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IsValid();
void CloseWin(void) {
  if (!IsValid())
    return;
}


x86 assembly (clang, -O0):
<CloseWin>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <IsValid@plt>
cmp    $0x0,%eax
jne    1129 <CloseWin+0x19>
jmp    1129 <CloseWin+0x19>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @CloseWin() {
%1 = call i32 (...) @IsValid()
%2 = icmp ne i32 %1, 0
br i1 %2, label %4, label %3
3: ; preds = %0
br label %4
4: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @CloseWin() {
%1 = tail call i32 (...) @IsValid()
ret void
}