xunge/DecIR huggingface dataset:
/* Variables and functions */
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int, int, int);
void affiche() {
  int i;
#pragma omp parallel for
  for (i = 0; i < 20; i++) {
    int id_threadOMP = omp_get_thread_num();
    int nb_threadOMP = omp_get_num_threads();
    printf("Mon rang est : %d sur %d - i : %d\n", id_threadOMP, nb_threadOMP,
           i);
  }
}


x86 assembly (clang, -O0):
<affiche>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
jge    1180 <affiche+0x50>
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <affiche+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<affiche>:
push   %rbp
push   %r14
push   %rbx
lea    0xec5(%rip),%r14
xor    %ebp,%ebp
nopl   (%rax)
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
mov    %ebp,%ecx
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x14,%ebp
jne    1140 <affiche+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [35 x i8] c"Mon rang est : %d sur %d - i : %d\0A\00"
define void @affiche() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @omp_get_thread_num()
%4 = tail call i32 (...) @omp_get_num_threads()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %2)
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 20
br i1 %7, label %8, label %1
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_testcancel();
void sbridge_thread_testcancel(void) { pthread_testcancel(); }


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

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

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

LLVM IR (-O2):
define void @sbridge_thread_testcancel() {
%1 = tail call i32 (...) @pthread_testcancel()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xe9() {
  Assert_real((isdigit(233) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              1170, ("isdigit should be 0 for 0xe9"));
}


x86 assembly (clang, -O0):
<t_isdigit_0xe9>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe9,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x492,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0xe9>:
push   %rax
mov    $0xe9,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x492,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xe9\00"
define void @t_isdigit_0xe9() {
%1 = call i64 @isdigit(i32 233)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1170, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xe9\00"
define void @t_isdigit_0xe9() {
%1 = tail call i64 @isdigit(i32 233)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1170, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gtk_identifier_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_identifier_get_type() {
ret void
}
/* Variables and functions */
int omap_rev();
int is_omap1611(void) {
  return (((omap_rev() >> 16) & 0xffff) == (0x1611)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_omap1611>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <omap_rev@plt>
mov    %eax,%edx
sar    $0x10,%edx
and    $0xffff,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1611,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_omap1611>:
push   %rax
xor    %eax,%eax
call   1030 <omap_rev@plt>
and    $0xffff0000,%eax
xor    %ecx,%ecx
cmp    $0x16110000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_omap1611() {
%1 = call i32 (...) @omap_rev()
%2 = ashr i32 %1, 16
%3 = and i32 %2, 65535
%4 = icmp eq i32 %3, 5649
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_omap1611() {
%1 = tail call i32 (...) @omap_rev()
%2 = and i32 %1, -65536
%3 = icmp eq i32 %2, 370212864
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ OAL_CREATE_SEMAPHORE();
int fc8150_spib_init(void *hDevice, unsigned short param1,
                     unsigned short param2) {
  OAL_CREATE_SEMAPHORE();
  return 0;
}


x86 assembly (clang, -O0):
<fc8150_spib_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <OAL_CREATE_SEMAPHORE@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fc8150_spib_init(i8* %0, i16 zeroext %1, i16 zeroext %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i16
store i8* %0, i8** %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = call i32 (...) @OAL_CREATE_SEMAPHORE()
ret i32 0
}

LLVM IR (-O2):
define i32 @fc8150_spib_init(i8* nocapture readnone %0, i16 zeroext %1, i16 zeroext %2) {
%4 = tail call i32 (...) @OAL_CREATE_SEMAPHORE()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getch();
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
int compEroda(char *str) {
  char string[101];
  sprintf(string, "gcc -Wall -lm -o blablabla %s/main.c batata.c -std=c99",
          str);
  if (!system(string))
    system("./blablabla");
  else
    getch();
  return 0;
}


x86 assembly (clang, -O0):
<compEroda>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <system@plt>
cmp    $0x0,%eax
jne    1173 <compEroda+0x43>
lea    0xece(%rip),%rdi
call   1030 <system@plt>
jmp    117a <compEroda+0x4a>
mov    $0x0,%al
call   1040 <getch@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compEroda>:
push   %rbx
sub    $0x70,%rsp
mov    %rdi,%rdx
lea    0xec1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
test   %eax,%eax
je     115f <compEroda+0x2f>
xor    %eax,%eax
call   1040 <getch@plt>
jmp    116b <compEroda+0x3b>
lea    0xed1(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [55 x i8] c"gcc -Wall -lm -o blablabla %s/main.c batata.c -std=c99\00"
@.str.1 = [12 x i8] c"./blablabla\00"
define i32 @compEroda(i8* %0) {
%2 = alloca i8*
%3 = alloca [101 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%8 = call i32 @system(i8* %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %1
%11 = call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %14
12: ; preds = %1
%13 = call i32 (...) @getch()
br label %14
14: ; preds = %12, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [55 x i8] c"gcc -Wall -lm -o blablabla %s/main.c batata.c -std=c99\00"
@.str.1 = [12 x i8] c"./blablabla\00"
define i32 @compEroda(i8* %0) {
%2 = alloca [101 x i8]
%3 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @system(i8* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %1
%10 = tail call i32 (...) @getch()
br label %11
11: ; preds = %9, %7
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printNChars(unsigned char *, int);
void putChar(unsigned char c) { printNChars(&c, 1); }


x86 assembly (clang, -O0):
<putChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <printNChars@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putChar>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <printNChars@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @putChar(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @printNChars(i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @putChar(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @printNChars(i8* %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FIONREAD;
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int *);
int socket_available_bytes(int socket) {
  int count;
  ioctl(socket, FIONREAD, &count);
  return count;
}


x86 assembly (clang, -O0):
<socket_available_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_available_bytes>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@FIONREAD = global i32 0
define i32 @socket_available_bytes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @FIONREAD
%6 = call i32 @ioctl(i32 %4, i32 %5, i32* %3)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@FIONREAD = global i32 0
define i32 @socket_available_bytes(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @FIONREAD
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
main() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
unsigned int submask_unzip(unsigned int);
unsigned int submask_networkip(unsigned int ip, unsigned int mask) {
  unsigned int network = ip & mask;
  return submask_unzip(network);
}


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

x86 assembly (clang, -O2):
<submask_networkip>:
and    %esi,%edi
jmp    1030 <submask_unzip@plt>

LLVM IR (-O0):
define i32 @submask_networkip(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = and i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @submask_unzip(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @submask_networkip(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = tail call i32 @submask_unzip(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void vn_usage(char *program) {
  fprintf(stderr,
          "Usage: %s [option]\n"
          "Options are:\n"
          "    -p|--port <port>    Specify port for Vino. 8080 is the default "
          "port.\n"
          "    -h|--help           This information.\n"
          "    -V|--version        Display program version.\n"
          "    -k  <on|off>        Use HTTP Keep-Alive featue or not. "
          "Keep-Alive is on by default.\n",
          program);
}


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

x86 assembly (clang, -O2):
<vn_usage>:
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 = [285 x i8] c"Usage: %s [option]\0AOptions are:\0A -p|--port <port> Specify port for Vino. 8080 is the default port.\0A -h|--help This information.\0A -V|--version Display program version.\0A -k <on|off> Use HTTP Keep-Alive featue or not. Keep-Alive is on by default.\0A\00"
define void @vn_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([285 x i8], [285 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [285 x i8] c"Usage: %s [option]\0AOptions are:\0A -p|--port <port> Specify port for Vino. 8080 is the default port.\0A -h|--help This information.\0A -V|--version Display program version.\0A -k <on|off> Use HTTP Keep-Alive featue or not. Keep-Alive is on by default.\0A\00"
define void @vn_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([285 x i8], [285 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int /*<<< orphan*/);
int main() {
  f(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ thread_job(unsigned long *);
void *thread_wrapper(void *arg) {
  thread_job((unsigned long *)arg);
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @thread_wrapper(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i64*
%5 = call i32 @thread_job(i64* %4)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thread_wrapper(i8* %0) {
%2 = bitcast i8* %0 to i64*
%3 = tail call i32 @thread_job(i64* %2)
ret i8* null
}
/* Variables and functions */
int close(int);
int yudpsocket_close(int socket_fd) { return close(socket_fd); }


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

x86 assembly (clang, -O2):
<yudpsocket_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @yudpsocket_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
void ILibEndThisThread() {}


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

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

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

LLVM IR (-O2):
define void @ILibEndThisThread() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int /*<<< orphan*/ string_first_once(char const *);
void main() {
  const char *str = "abaccdeff";
  putchar(string_first_once(str));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <string_first_once@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <string_first_once@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"abaccdeff\00"
define void @main() {
%1 = alloca i8*
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @string_first_once(i8* %2)
%4 = call i32 @putchar(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"abaccdeff\00"
define void @main() {
%1 = tail call i32 @string_first_once(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ iterative_count(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ recursive_count(int /*<<< orphan*/);
int main() {
  iterative_count(0);
  printf("\n");
  recursive_count(0);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <iterative_count@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1050 <recursive_count@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @iterative_count(i32 0)
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @recursive_count(i32 0)
ret i32 0
}
/* Variables and functions */
float pow(float, int);
float quadratic_in(float step, float max_steps, float max_val) {
  float ratio = step / max_steps;
  return max_val * pow(ratio, 2);
}


x86 assembly (clang, -O0):
<quadratic_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadratic_in>:
push   %rax
movss  %xmm2,0x4(%rsp)
divss  %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @quadratic_in(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
%9 = load float, float* %5
%10 = fdiv float %8, %9
store float %10, float* %7
%11 = load float, float* %6
%12 = load float, float* %7
%13 = call float @pow(float %12, i32 2)
%14 = fmul float %11, %13
ret float %14
}

LLVM IR (-O2):
define float @quadratic_in(float %0, float %1, float %2) {
%4 = fdiv float %0, %1
%5 = tail call float @pow(float %4, i32 2)
%6 = fmul float %5, %2
ret float %6
}
void RTAvlrooGCPtrRangeGet(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrooGCPtrRangeGet() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void testdlr_deeplib1_func() {
  printf("testdlr_deeplib1: testdlr_deeplib1_func() called\n");
}


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

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

LLVM IR (-O0):
@.str = [50 x i8] c"testdlr_deeplib1: testdlr_deeplib1_func() called\0A\00"
define void @testdlr_deeplib1_func() {
%1 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [49 x i8] c"testdlr_deeplib1: testdlr_deeplib1_func() called\00"
define void @testdlr_deeplib1_func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int ndelay_on(int);
int socket_tcp4b();
int socket_tcp4(void) {
  int s;
  s = socket_tcp4b();
  if (s == -1)
    return -1;
  if (ndelay_on(s) == -1) {
    close(s);
    return -1;
  }
  return s;
}


x86 assembly (clang, -O0):
<socket_tcp4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <socket_tcp4b@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1158 <socket_tcp4+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    1183 <socket_tcp4+0x53>
mov    -0x8(%rbp),%edi
call   1050 <ndelay_on@plt>
cmp    $0xffffffff,%eax
jne    117d <socket_tcp4+0x4d>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1183 <socket_tcp4+0x53>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_tcp4>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <socket_tcp4b@plt>
mov    $0xffffffff,%ebx
cmp    $0xffffffff,%eax
je     115d <socket_tcp4+0x2d>
mov    %eax,%ebp
mov    %eax,%edi
call   1050 <ndelay_on@plt>
cmp    $0xffffffff,%eax
je     1156 <socket_tcp4+0x26>
mov    %ebp,%ebx
jmp    115d <socket_tcp4+0x2d>
mov    %ebp,%edi
call   1030 <close@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @socket_tcp4() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @socket_tcp4b()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %16
7: ; preds = %0
%8 = load i32, i32* %2
%9 = call i32 @ndelay_on(i32 %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %2
%13 = call i32 @close(i32 %12)
store i32 -1, i32* %1
br label %16
14: ; preds = %7
%15 = load i32, i32* %2
store i32 %15, i32* %1
br label %16
16: ; preds = %14, %11, %6
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @socket_tcp4() {
%1 = tail call i32 (...) @socket_tcp4b()
%2 = icmp eq i32 %1, -1
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 @ndelay_on(i32 %1)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @close(i32 %1)
br label %8
8: ; preds = %3, %0, %6
%9 = phi i32 [ -1, %6 ], [ -1, %0 ], [ %1, %3 ]
ret i32 %9
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISREG(int /*<<< orphan*/);
int /*<<< orphan*/ lstat(char const *const, struct stat *);
int is_regular_file(const char *const file_path) {
  struct stat path_stat;
  lstat(file_path, &path_stat);
  return S_ISREG(path_stat.st_mode);
}


x86 assembly (clang, -O0):
<is_regular_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <lstat@plt>
mov    -0x10(%rbp),%edi
call   1040 <S_ISREG@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_regular_file>:
push   %rax
mov    %rsp,%rsi
call   1030 <lstat@plt>
mov    (%rsp),%edi
pop    %rax
jmp    1040 <S_ISREG@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_regular_file(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @lstat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i32 @S_ISREG(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_regular_file(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @lstat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @S_ISREG(i32 %6)
ret i32 %7
}
void b_file_read(unsigned char *name, void *mem) {
  asm volatile("call 0x00100190" : : "S"(name), "D"(mem));
}


x86 assembly (clang, -O0):
<b_file_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdi
call   100190 <completed.0+0xfc170>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_file_read>:
mov    %rsi,%rax
mov    %rdi,%rsi
mov    %rax,%rdi
call   100190 <completed.0+0xfc170>
ret

LLVM IR (-O0):
define void @b_file_read(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @b_file_read(i8* %0, i8* %1) {
tail call void asm sideeffect "call 0x00100190", "{si},{di},~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1)
ret void
}
/* Type definitions */
struct comm {
  int dummy;
};

/* Variables and functions */
void comm_recv(const struct comm *c, void *p, size_t n, unsigned int src,
               int tag) {}


x86 assembly (clang, -O0):
<comm_recv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.comm = type { i32 }
define void @comm_recv(%struct.comm* %0, i8* %1, i64 %2, i32 %3, i32 %4) {
%6 = alloca %struct.comm*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
store %struct.comm* %0, %struct.comm** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
%struct.comm = type { i32 }
define void @comm_recv(%struct.comm* nocapture %0, i8* nocapture %1, i64 %2, i32 %3, i32 %4) {
ret void
}
int fun749() { return 749; }


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

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

LLVM IR (-O0):
define i32 @fun749() {
ret i32 749
}

LLVM IR (-O2):
define i32 @fun749() {
ret i32 749
}
__attribute__((visibility("default"))) const char *httplib_version(void) {
  return "1.9";
}


x86 assembly (clang, -O0):
<httplib_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<httplib_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"1.9\00"
define i8* @httplib_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"1.9\00"
define i8* @httplib_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct stack {
  int dummy;
};

/* Variables and functions */
int stack_push_dup(struct stack **, char const *, scalar_t__);
scalar_t__ strlen(char const *);
int stack_push_fname(struct stack **path, const char *fname) {
  return stack_push_dup(path, fname, strlen(fname) + 1);
}


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

x86 assembly (clang, -O2):
<stack_push_fname>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <stack_push_dup@plt>

LLVM IR (-O0):
%struct.stack = type { i32 }
define i32 @stack_push_fname(%struct.stack** %0, i8* %1) {
%3 = alloca %struct.stack**
%4 = alloca i8*
store %struct.stack** %0, %struct.stack*** %3
store i8* %1, i8** %4
%5 = load %struct.stack**, %struct.stack*** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i32 @stack_push_dup(%struct.stack** %5, i8* %6, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.stack = type { i32 }
define i32 @stack_push_fname(%struct.stack** %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i32 @stack_push_dup(%struct.stack** %0, i8* %1, i64 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ angle_rotate(unsigned int);
int /*<<< orphan*/ soft_left();
void soft_left_degrees(unsigned int Degrees) {
  soft_left();
  Degrees = Degrees * 2;
  angle_rotate(Degrees);
}


x86 assembly (clang, -O0):
<soft_left_degrees>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <soft_left@plt>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <angle_rotate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soft_left_degrees>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <soft_left@plt>
add    %ebx,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <angle_rotate@plt>

LLVM IR (-O0):
define void @soft_left_degrees(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @soft_left()
%4 = load i32, i32* %2
%5 = mul i32 %4, 2
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @angle_rotate(i32 %6)
ret void
}

LLVM IR (-O2):
define void @soft_left_degrees(i32 %0) {
%2 = tail call i32 (...) @soft_left()
%3 = shl i32 %0, 1
%4 = tail call i32 @angle_rotate(i32 %3)
ret void
}
int LimitSym(int in, int max) {
  if (in > max)
    return (max);
  if (in < -max)
    return (-max);
  return (in);
}


x86 assembly (clang, -O0):
<LimitSym>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <LimitSym+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <LimitSym+0x44>
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    113e <LimitSym+0x3e>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <LimitSym+0x44>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LimitSym>:
mov    %esi,%eax
neg    %eax
cmp    %edi,%eax
cmovle %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @LimitSym(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %5
store i32 %10, i32* %3
br label %21
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = sub nsw i32 0, %13
%15 = icmp slt i32 %12, %14
br i1 %15, label %16, label %19
16: ; preds = %11
%17 = load i32, i32* %5
%18 = sub nsw i32 0, %17
store i32 %18, i32* %3
br label %21
19: ; preds = %11
%20 = load i32, i32* %4
store i32 %20, i32* %3
br label %21
21: ; preds = %19, %16, %9
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @LimitSym(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = sub nsw i32 0, %1
%5 = icmp sgt i32 %4, %0
%6 = select i1 %5, i32 %4, i32 %0
%7 = select i1 %3, i32 %1, i32 %6
ret i32 %7
}
/* Variables and functions */
char *DES_fcrypt(char const *, char const *, char *);
char *DES_crypt(const char *buf, const char *salt) {
  static char buff[14];
  return DES_fcrypt(buf, salt, buff);
}


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

x86 assembly (clang, -O2):
<DES_crypt>:
lea    0x2f12(%rip),%rdx
jmp    1030 <DES_fcrypt@plt>

LLVM IR (-O0):
@DES_crypt.buff = internal global [14 x i8] zeroinitializer
define i8* @DES_crypt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @DES_fcrypt(i8* %5, i8* %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @DES_crypt.buff, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
@DES_crypt.buff = internal global [14 x i8] zeroinitializer
define i8* @DES_crypt(i8* %0, i8* %1) {
%3 = tail call i8* @DES_fcrypt(i8* %0, i8* %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @DES_crypt.buff, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, int *);
void console_ESC_A(char *esc_param) {
  int p[1];
  sscanf(esc_param, "%d", &p[0]);
}


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

x86 assembly (clang, -O2):
<console_ESC_A>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @console_ESC_A(i8* nocapture %0) {
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %2 to i8*
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%5 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
ret void
}
/* Variables and functions */
bool is_bullet(int ch) { return ch == '*' || ch == '-'; }


x86 assembly (clang, -O0):
<is_bullet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x2a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <is_bullet+0x20>
cmpl   $0x2d,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_bullet>:
cmp    $0x2a,%edi
sete   %al
cmp    $0x2d,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_bullet(i32 %0) {
%2 = icmp eq i32 %0, 42
%3 = icmp eq i32 %0, 45
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ play_sound(char *);
int /*<<< orphan*/ printf(char *, char *);
int remote_play_sound(char *filename) {
  printf("remote play sound %s\n", filename);
  play_sound(filename);
}


x86 assembly (clang, -O0):
<remote_play_sound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <play_sound@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remote_play_sound>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <play_sound@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"remote play sound %s\0A\00"
define i32 @remote_play_sound(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %3
%7 = call i32 @play_sound(i8* %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [22 x i8] c"remote play sound %s\0A\00"
define i32 @remote_play_sound(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @play_sound(i8* %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((hotpatch(1000001, 1000000))) void hp3(void) {
  printf("hello, world!\n");
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define void @hp3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int);
int /*<<< orphan*/ output_byte(int);
int /*<<< orphan*/ output_modrm(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_pushmem(int addr) {
  assem_debug("push *%x\n", addr);
  output_byte(0xFF);
  output_modrm(0, 5, 6);
  output_w32(addr);
}


x86 assembly (clang, -O0):
<emit_pushmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xff,%edi
call   1050 <output_byte@plt>
xor    %edi,%edi
mov    $0x5,%esi
mov    $0x6,%edx
call   1060 <output_modrm@plt>
mov    -0x4(%rbp),%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_pushmem>:
push   %rbx
mov    %edi,%ebx
lea    0xeb6(%rip),%rdi
mov    %ebx,%esi
call   1030 <assem_debug@plt>
mov    $0xff,%edi
call   1050 <output_byte@plt>
xor    %edi,%edi
mov    $0x5,%esi
mov    $0x6,%edx
call   1060 <output_modrm@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"push *%x\0A\00"
define void @emit_pushmem(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @assem_debug(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @output_byte(i32 255)
%6 = call i32 @output_modrm(i32 0, i32 5, i32 6)
%7 = load i32, i32* %2
%8 = call i32 @output_w32(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"push *%x\0A\00"
define void @emit_pushmem(i32 %0) {
%2 = tail call i32 @assem_debug(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @output_byte(i32 255)
%4 = tail call i32 @output_modrm(i32 0, i32 5, i32 6)
%5 = tail call i32 @output_w32(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
main(void) {
  printf("RogerWu\n");
  printf("Roger\nWu\n");
  printf("Roger");
  printf("Wu\n");
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"RogerWu\0A\00"
@.str.1 = [10 x i8] c"Roger\0AWu\0A\00"
@.str.2 = [6 x i8] c"Roger\00"
@.str.3 = [4 x i8] c"Wu\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [6 x i8] c"Roger\00"
@str = [8 x i8] c"RogerWu\00"
@str.4 = [9 x i8] c"Roger\0AWu\00"
@str.5 = [3 x i8] c"Wu\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.5, i64 0, i64 0))
%5 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int xcorr(double *, int, double *, int, double *, int);
int autocorr(double *output, int len_output, double *rev, int len_rev) {
  return xcorr(output, len_output, rev, len_rev, rev, len_rev);
}


x86 assembly (clang, -O0):
<autocorr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
call   1030 <xcorr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autocorr>:
mov    %rdx,%r8
mov    %ecx,%r9d
jmp    1030 <xcorr@plt>

LLVM IR (-O0):
define i32 @autocorr(double* %0, i32 %1, double* %2, i32 %3) {
%5 = alloca double*
%6 = alloca i32
%7 = alloca double*
%8 = alloca i32
store double* %0, double** %5
store i32 %1, i32* %6
store double* %2, double** %7
store i32 %3, i32* %8
%9 = load double*, double** %5
%10 = load i32, i32* %6
%11 = load double*, double** %7
%12 = load i32, i32* %8
%13 = load double*, double** %7
%14 = load i32, i32* %8
%15 = call i32 @xcorr(double* %9, i32 %10, double* %11, i32 %12, double* %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @autocorr(double* %0, i32 %1, double* %2, i32 %3) {
%5 = tail call i32 @xcorr(double* %0, i32 %1, double* %2, i32 %3, double* %2, i32 %3)
ret i32 %5
}
int is_valid_int(char c) {
  switch (c) {
  case '0':
    return 0;
  case '1':
    return 1;
  case '2':
    return 2;
  case '3':
    return 3;
  case '4':
    return 4;
  case '5':
    return 5;
  case '6':
    return 6;
  case '7':
    return 7;
  case '8':
    return 8;
  case '9':
    return 9;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<is_valid_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x9,%eax
ja     11ac <is_valid_int+0xac>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    11b3 <is_valid_int+0xb3>
movl   $0x1,-0x4(%rbp)
jmp    11b3 <is_valid_int+0xb3>
movl   $0x2,-0x4(%rbp)
jmp    11b3 <is_valid_int+0xb3>
movl   $0x3,-0x4(%rbp)
jmp    11b3 <is_valid_int+0xb3>
movl   $0x4,-0x4(%rbp)
jmp    11b3 <is_valid_int+0xb3>
movl   $0x5,-0x4(%rbp)
jmp    11b3 <is_valid_int+0xb3>
movl   $0x6,-0x4(%rbp)
jmp    11b3 <is_valid_int+0xb3>
movl   $0x7,-0x4(%rbp)
jmp    11b3 <is_valid_int+0xb3>
movl   $0x8,-0x4(%rbp)
jmp    11b3 <is_valid_int+0xb3>
movl   $0x9,-0x4(%rbp)
jmp    11b3 <is_valid_int+0xb3>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_int>:
lea    -0x30(%rdi),%ecx
cmp    $0xa,%ecx
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @is_valid_int(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %16 [
i32 48, label %6
i32 49, label %7
i32 50, label %8
i32 51, label %9
i32 52, label %10
i32 53, label %11
i32 54, label %12
i32 55, label %13
i32 56, label %14
i32 57, label %15
]
6: ; preds = %1
store i32 0, i32* %2
br label %17
7: ; preds = %1
store i32 1, i32* %2
br label %17
8: ; preds = %1
store i32 2, i32* %2
br label %17
9: ; preds = %1
store i32 3, i32* %2
br label %17
10: ; preds = %1
store i32 4, i32* %2
br label %17
11: ; preds = %1
store i32 5, i32* %2
br label %17
12: ; preds = %1
store i32 6, i32* %2
br label %17
13: ; preds = %1
store i32 7, i32* %2
br label %17
14: ; preds = %1
store i32 8, i32* %2
br label %17
15: ; preds = %1
store i32 9, i32* %2
br label %17
16: ; preds = %1
store i32 -1, i32* %2
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_valid_int(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
%4 = icmp ult i32 %3, 10
%5 = select i1 %4, i32 %3, i32 -1
ret i32 %5
}
use_c(struct c *a) {}


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

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

LLVM IR (-O0):
%struct.c = type opaque
define i32 @use_c(%struct.c* %0) {
%2 = alloca i32
%3 = alloca %struct.c*
store %struct.c* %0, %struct.c** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.c = type opaque
define i32 @use_c(%struct.c* nocapture readnone %0) {
ret i32 undef
}