xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void QEIConfigure(uint32_t ui32Base, uint32_t ui32Config,
                  uint32_t ui32MaxPosition) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) =
      (((*((volatile uint32_t *)(ui32Base + 0x00000000))) &
        ~(0x00000008 | 0x00000010 | 0x00000004 | 0x00000002)) |
       ui32Config);
  (*((volatile uint32_t *)(ui32Base + 0x0000000C))) = ui32MaxPosition;
}


x86 assembly (clang, -O0):
<QEIConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%ecx
and    $0xffffffe1,%ecx
or     -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0xc,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIConfigure>:
movslq %edi,%rax
mov    (%rax),%ecx
and    $0xffffffe1,%ecx
or     %esi,%ecx
mov    %ecx,(%rax)
mov    %edx,0xc(%rax)
ret

LLVM IR (-O0):
define void @QEIConfigure(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 0
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, -31
%13 = load i32, i32* %5
%14 = or i32 %12, %13
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 0
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
store volatile i32 %14, i32* %18
%19 = load i32, i32* %6
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 12
%22 = sext i32 %21 to i64
%23 = inttoptr i64 %22 to i32*
store volatile i32 %19, i32* %23
ret void
}

LLVM IR (-O2):
define void @QEIConfigure(i32 %0, i32 %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -31
%8 = or i32 %7, %1
store volatile i32 %8, i32* %5
%9 = add nsw i32 %0, 12
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store volatile i32 %2, i32* %11
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int fake_pthread_mutex_lock(pthread_mutex_t *mutex) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fake_pthread_mutex_lock(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *memchr(char const *, char, size_t);
size_t __strnlen(const char *s, size_t max) {
  const char *e = memchr(s, '\0', max);
  if (e != NULL)
    return e - s;
  return max;
}


x86 assembly (clang, -O0):
<__strnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1152 <__strnlen+0x42>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    115a <__strnlen+0x4a>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__strnlen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memchr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
test   %rax,%rax
cmove  %r14,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @__strnlen(i8* %0, i64 %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @memchr(i8* %7, i8 signext 0, i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = load i8*, i8** %4
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
store i64 %17, i64* %3
br label %20
18: ; preds = %2
%19 = load i64, i64* %5
store i64 %19, i64* %3
br label %20
20: ; preds = %18, %12
%21 = load i64, i64* %3
ret i64 %21
}

LLVM IR (-O2):
define i64 @__strnlen(i8* %0, i64 %1) {
%3 = tail call i8* @memchr(i8* %0, i8 signext 0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = select i1 %4, i64 %1, i64 %7
ret i64 %8
}
int first_one1(unsigned int u1) { return __builtin_clz(u1) + 22; }


x86 assembly (clang, -O0):
<first_one1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
add    $0x16,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_one1>:
bsr    %edi,%eax
xor    $0x1f,%eax
add    $0x16,%eax
ret

LLVM IR (-O0):
define i32 @first_one1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
%5 = add nsw i32 %4, 22
ret i32 %5
}

LLVM IR (-O2):
define i32 @first_one1(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%3 = add nuw nsw i32 %2, 22
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_U16_CR_2U16_swap(char *, int);
void U_WMRFLOODFILL_swap(char *record, int torev) {
  U_WMRCORE_U16_CR_2U16_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRFLOODFILL_swap>:
jmp    1030 <U_WMRCORE_U16_CR_2U16_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRFLOODFILL_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_U16_CR_2U16_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emq_user_release(void *);
void emq_user_list_free_handler(void *value) { emq_user_release(value); }


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

x86 assembly (clang, -O2):
<emq_user_list_free_handler>:
jmp    1030 <emq_user_release@plt>

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

LLVM IR (-O2):
define void @emq_user_list_free_handler(i8* %0) {
%2 = tail call i32 @emq_user_release(i8* %0)
ret void
}
/* Type definitions */
struct jedec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dump_row_asr(struct jedec *);
int /*<<< orphan*/ dump_row_n(struct jedec *, int);
int /*<<< orphan*/ dump_row_ues(struct jedec *);
void dump_jed(struct jedec *jed) {
  int i;
  for (i = 0; i < 44; i++) {
    dump_row_n(jed, i);
  }
  dump_row_ues(jed);
  dump_row_asr(jed);
}


x86 assembly (clang, -O0):
<dump_jed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2c,-0xc(%rbp)
jge    1167 <dump_jed+0x37>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <dump_row_n@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <dump_jed+0x13>
mov    -0x8(%rbp),%rdi
call   1040 <dump_row_ues@plt>
mov    -0x8(%rbp),%rdi
call   1030 <dump_row_asr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_jed>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <dump_row_n@plt>
add    $0x1,%ebp
cmp    $0x2c,%ebp
jne    1140 <dump_jed+0x10>
mov    %rbx,%rdi
call   1040 <dump_row_ues@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <dump_row_asr@plt>

LLVM IR (-O0):
%struct.jedec = type { i32 }
define void @dump_jed(%struct.jedec* %0) {
%2 = alloca %struct.jedec*
%3 = alloca i32
store %struct.jedec* %0, %struct.jedec** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 44
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load %struct.jedec*, %struct.jedec** %2
%9 = load i32, i32* %3
%10 = call i32 @dump_row_n(%struct.jedec* %8, i32 %9)
br label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load %struct.jedec*, %struct.jedec** %2
%16 = call i32 @dump_row_ues(%struct.jedec* %15)
%17 = load %struct.jedec*, %struct.jedec** %2
%18 = call i32 @dump_row_asr(%struct.jedec* %17)
ret void
}

LLVM IR (-O2):
%struct.jedec = type { i32 }
define void @dump_jed(%struct.jedec* %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %5, %2 ]
%4 = tail call i32 @dump_row_n(%struct.jedec* %0, i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 44
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = tail call i32 @dump_row_ues(%struct.jedec* %0)
%9 = tail call i32 @dump_row_asr(%struct.jedec* %0)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};

/* Variables and functions */
int stat(char const *, struct stat *);
size_t file_getsize(const char *path) {
  struct stat sb;
  int r;
  r = stat(path, &sb);
  if (r)
    return 0;
  else
    return (size_t)sb.st_size;
}


x86 assembly (clang, -O0):
<file_getsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1143 <file_getsize+0x33>
movq   $0x0,-0x8(%rbp)
jmp    114b <file_getsize+0x3b>
movslq -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_getsize>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %eax,%eax
jne    1122 <file_getsize+0x12>
mov    (%rsp),%ecx
movslq %ecx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i64 @file_getsize(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i64 0, i64* %2
br label %15
11: ; preds = %1
%12 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%13 = load i32, i32* %12
%14 = sext i32 %13 to i64
store i64 %14, i64* %2
br label %15
15: ; preds = %11, %10
%16 = load i64, i64* %2
ret i64 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i64 @file_getsize(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 0
%9 = sext i32 %8 to i64
ret i64 %9
}
/* Variables and functions */
float powf(float, int);
float quadratic_in(float step, float max_steps, float max_val) {
  float ratio = step / max_steps;
  return max_val * powf(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 <powf@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 <powf@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 @powf(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 @powf(float %4, i32 2)
%6 = fmul float %5, %2
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x38() {
  Assert_real((isascii(56)),
              "/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_isascii.c",
              285, ("isascii should be 1 for 8"));
}


x86 assembly (clang, -O0):
<t_isascii_0x38>:
push   %rbp
mov    %rsp,%rbp
mov    $0x38,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x11d,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x38>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x11d,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for 8\00"
define void @t_isascii_0x38() {
%1 = call i32 @isascii(i32 56)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 285, i8* getelementptr inbounds ([26 x i8], [26 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for 8\00"
define void @t_isascii_0x38() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 285, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ print_chars();
int main(void) {
  print("abfnrtvABFNRTV\n");
  print("\"WHAT \nDO\r YOU GET IF\tYOU MULTIPLY\vSIX BY\\ NINE\?\'\n");
  print("\x0068\x65\154\154o\n");
  print_chars();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <print@plt>
lea    0xedc(%rip),%rdi
call   1040 <print@plt>
lea    0xf03(%rip),%rdi
call   1040 <print@plt>
xor    %eax,%eax
call   1030 <print_chars@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"abfnrtvABFNRTV\0A\00"
@.str.1 = [51 x i8] c"\22WHAT \0ADO\0D YOU GET IF\09YOU MULTIPLY\0BSIX BY\\ NINE?'\0A\00"
@.str.2 = [7 x i8] c"hello\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @print(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @print(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @print(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (...) @print_chars()
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"abfnrtvABFNRTV\0A\00"
@.str.1 = [51 x i8] c"\22WHAT \0ADO\0D YOU GET IF\09YOU MULTIPLY\0BSIX BY\\ NINE?'\0A\00"
@.str.2 = [7 x i8] c"hello\0A\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @print(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (...) @print_chars()
ret i32 0
}
/* Variables and functions */
int strlen(char *);
void clear_argv(char *argv) {
  int x;
  for (x = 0; x < strlen(argv); x++)
    argv[x] = 'x';
  return;
}


x86 assembly (clang, -O0):
<clear_argv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    1159 <clear_argv+0x49>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x78,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <clear_argv+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_argv>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1148 <clear_argv+0x38>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x78,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1130 <clear_argv+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @clear_argv(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 120, i8* %6
%7 = add nuw nsw i64 %5, 1
%8 = tail call i32 @strlen(i8* %0)
%9 = sext i32 %8 to i64
%10 = icmp slt i64 %7, %9
br i1 %10, label %4, label %11
11: ; preds = %4, %1
ret void
}
int foo() {
  int *x = 0, *y = 0;
  char c = '\x13';
  return *x + *y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movb   $0x13,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
add    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i8
store i32* null, i32** %1
store i32* null, i32** %2
store i8 19, i8* %3
%4 = load i32*, i32** %1
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ error(char const *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ write_err(char *);
void usage(const char *msg) {
  if (msg)
    error(msg);
  write_err("Usage: sysloglwrite [-g GID] [-u UID] [-U] [-p] [-r] PATH "
            "FACILITY [PREFIX]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1150 <usage+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <error@plt>
lea    0xea9(%rip),%rdi
call   1050 <write_err@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
test   %rdi,%rdi
je     113b <usage+0xb>
call   1030 <error@plt>
lea    0xebe(%rip),%rdi
call   1050 <write_err@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [77 x i8] c"Usage: sysloglwrite [-g GID] [-u UID] [-U] [-p] [-r] PATH FACILITY [PREFIX]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @error(i8* %6)
br label %8
8: ; preds = %5, %1
%9 = call i32 @write_err(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [77 x i8] c"Usage: sysloglwrite [-g GID] [-u UID] [-U] [-p] [-r] PATH FACILITY [PREFIX]\0A\00"
define void @usage(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @error(i8* %0)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @write_err(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct test {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ t_assert_msg(struct test *, int, char *);
void t_assert(struct test *t, int condition) {
  t_assert_msg(t, condition, "Assert failed");
}


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

x86 assembly (clang, -O2):
<t_assert>:
lea    0xee9(%rip),%rdx
jmp    1030 <t_assert_msg@plt>

LLVM IR (-O0):
%struct.test = type { i32 }
@.str = [14 x i8] c"Assert failed\00"
define void @t_assert(%struct.test* %0, i32 %1) {
%3 = alloca %struct.test*
%4 = alloca i32
store %struct.test* %0, %struct.test** %3
store i32 %1, i32* %4
%5 = load %struct.test*, %struct.test** %3
%6 = load i32, i32* %4
%7 = call i32 @t_assert_msg(%struct.test* %5, i32 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.test = type { i32 }
@.str = [14 x i8] c"Assert failed\00"
define void @t_assert(%struct.test* %0, i32 %1) {
%3 = tail call i32 @t_assert_msg(%struct.test* %0, i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
int uniqueID(int x, int y, int z, int wid, int hei) {
  return x * hei * wid + hei * y + z;
}


x86 assembly (clang, -O0):
<uniqueID>:
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
imul   -0x14(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uniqueID>:
imul   %ecx,%edi
lea    (%rdi,%rsi,1),%eax
imul   %r8d,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @uniqueID(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 = mul nsw i32 %11, %12
%14 = load i32, i32* %9
%15 = mul nsw i32 %13, %14
%16 = load i32, i32* %10
%17 = load i32, i32* %7
%18 = mul nsw i32 %16, %17
%19 = add nsw i32 %15, %18
%20 = load i32, i32* %8
%21 = add nsw i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @uniqueID(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = mul i32 %3, %0
%7 = add i32 %6, %1
%8 = mul i32 %7, %4
%9 = add i32 %8, %2
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *, char *, char *, char *,
                         int /*<<< orphan*/ *);
void CWE78_OS_Command_Injection__char_console_execl_41_goodG2BSink(char *data) {
  execl("/bin/sh", "/bin/sh", "-c", "script1", "-la", data, NULL);
}


x86 assembly (clang, -O0):
<CWE78_OS_Command_Injection__char_console_execl_41_goodG2BSink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r9
lea    0xed9(%rip),%rsi
lea    0xeda(%rip),%rdx
lea    0xed6(%rip),%rcx
lea    0xed7(%rip),%r8
xor    %eax,%eax
mov    %rsi,%rdi
movq   $0x0,(%rsp)
call   1030 <execl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CWE78_OS_Command_Injection__char_console_execl_41_goodG2BSink>:
push   %rax
mov    %rdi,%r9
movq   $0x0,(%rsp)
lea    0xedd(%rip),%rdi
lea    0xede(%rip),%rdx
lea    0xeda(%rip),%rcx
lea    0xedb(%rip),%r8
mov    %rdi,%rsi
call   1030 <execl@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
@.str.1 = [3 x i8] c"-c\00"
@.str.2 = [8 x i8] c"script1\00"
@.str.3 = [4 x i8] c"-la\00"
define void @CWE78_OS_Command_Injection__char_console_execl_41_goodG2BSink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %3, i32* null)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
@.str.1 = [3 x i8] c"-c\00"
@.str.2 = [8 x i8] c"script1\00"
@.str.3 = [4 x i8] c"-la\00"
define void @CWE78_OS_Command_Injection__char_console_execl_41_goodG2BSink(i8* %0) {
%2 = tail call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %0, i32* null)
ret void
}
void emit_builtin(struct processor_explicatory_state *process_state,
                  struct modern_stream *stream, void *stream_state,
                  struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_builtin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_builtin(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_builtin(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
/* Variables and functions */
scalar_t__ lp_preload_modules();
int /*<<< orphan*/ smb_load_modules(scalar_t__);
void init_modules(void) {
  if (lp_preload_modules())
    smb_load_modules(lp_preload_modules());
}


x86 assembly (clang, -O0):
<init_modules>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <lp_preload_modules@plt>
cmp    $0x0,%rax
je     1144 <init_modules+0x24>
mov    $0x0,%al
call   1030 <lp_preload_modules@plt>
mov    %rax,%rdi
call   1040 <smb_load_modules@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_modules>:
push   %rax
xor    %eax,%eax
call   1030 <lp_preload_modules@plt>
test   %rax,%rax
je     113d <init_modules+0x1d>
xor    %eax,%eax
call   1030 <lp_preload_modules@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <smb_load_modules@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @init_modules() {
%1 = tail call i64 (...) @lp_preload_modules()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i64 (...) @lp_preload_modules()
%5 = tail call i32 @smb_load_modules(i64 %4)
br label %6
6: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printName() {
  printf("\n\n**************************");
  printf("\n\n*                        *");
  printf("\n\n*     Sam Niemoeller     *");
  printf("\n\n*                        *");
  printf("\n\n**************************\n\n");
  return;
}


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

x86 assembly (clang, -O2):
<printName>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xee9(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
lea    0xef7(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
lea    0xf00(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"\0A\0A**************************\00"
@.str.1 = [29 x i8] c"\0A\0A* *\00"
@.str.2 = [29 x i8] c"\0A\0A* Sam Niemoeller *\00"
@.str.3 = [31 x i8] c"\0A\0A**************************\0A\0A\00"
define void @printName() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"\0A\0A**************************\00"
@.str.1 = [29 x i8] c"\0A\0A* *\00"
@.str.2 = [29 x i8] c"\0A\0A* Sam Niemoeller *\00"
@str = [30 x i8] c"\0A\0A**************************\0A\00"
define void @printName() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int unlink(char *);
int LispUnlink(char *name) { return (unlink(name)); }


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

x86 assembly (clang, -O2):
<LispUnlink>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @LispUnlink(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ flushinp();
int getch();
int wait_for_input(void) {
  flushinp();
  return getch();
}


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

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

LLVM IR (-O0):
define i32 @wait_for_input() {
%1 = call i32 (...) @flushinp()
%2 = call i32 (...) @getch()
ret i32 %2
}

LLVM IR (-O2):
define i32 @wait_for_input() {
%1 = tail call i32 (...) @flushinp()
%2 = tail call i32 (...) @getch()
ret i32 %2
}
/* Variables and functions */
double exp(double);
double pow(double, double);
double qFT(double FT) {
  double q5, A = 213.7, B = -1.680, C = 0.3325;
  if (FT > 10) {
    return 1;
  } else {
    q5 = A * exp(B * pow(FT, C));
    return q5;
  }
}


x86 assembly (clang, -O0):
<qFT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xee3(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xece(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe9f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    117d <qFT+0x5d>
movsd  0xead(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11cc <qFT+0xac>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qFT>:
push   %rax
ucomisd 0xedf(%rip),%xmm0
jbe    1135 <qFT+0x15>
movsd  0xecd(%rip),%xmm0
pop    %rax
ret
movsd  0xed3(%rip),%xmm1
call   1040 <pow@plt>
mulsd  0xece(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xec9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @qFT(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %3
store double 2.137000e+02, double* %5
store double -1.680000e+00, double* %6
store double 3.325000e-01, double* %7
%8 = load double, double* %3
%9 = fcmp ogt double %8, 1.000000e+01
br i1 %9, label %10, label %11
10: ; preds = %1
store double 1.000000e+00, double* %2
br label %21
11: ; preds = %1
%12 = load double, double* %5
%13 = load double, double* %6
%14 = load double, double* %3
%15 = load double, double* %7
%16 = call double @pow(double %14, double %15)
%17 = fmul double %13, %16
%18 = call double @exp(double %17)
%19 = fmul double %12, %18
store double %19, double* %4
%20 = load double, double* %4
store double %20, double* %2
br label %21
21: ; preds = %11, %10
%22 = load double, double* %2
ret double %22
}

LLVM IR (-O2):
define double @qFT(double %0) {
%2 = fcmp ogt double %0, 1.000000e+01
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call double @pow(double %0, double 3.325000e-01)
%5 = fmul double %4, -1.680000e+00
%6 = tail call double @exp(double %5)
%7 = fmul double %6, 2.137000e+02
br label %8
8: ; preds = %1, %3
%9 = phi double [ %7, %3 ], [ 1.000000e+00, %1 ]
ret double %9
}
long int NJ_MAP(long int i, long int j, long int ntaxa) {
  return ((i * (2 * ntaxa - i - 1)) / 2 + j);
}


x86 assembly (clang, -O0):
<NJ_MAP>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
shl    $0x1,%rcx
sub    -0x8(%rbp),%rcx
sub    $0x1,%rcx
imul   %rcx,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
add    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NJ_MAP>:
mov    %rdi,%rax
not    %rax
lea    (%rax,%rdx,2),%rcx
imul   %rdi,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
add    %rcx,%rax
sar    %rax
add    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @NJ_MAP(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %6
%9 = mul nsw i64 2, %8
%10 = load i64, i64* %4
%11 = sub nsw i64 %9, %10
%12 = sub nsw i64 %11, 1
%13 = mul nsw i64 %7, %12
%14 = sdiv i64 %13, 2
%15 = load i64, i64* %5
%16 = add nsw i64 %14, %15
ret i64 %16
}

LLVM IR (-O2):
define i64 @NJ_MAP(i64 %0, i64 %1, i64 %2) {
%4 = shl nsw i64 %2, 1
%5 = xor i64 %0, -1
%6 = add i64 %4, %5
%7 = mul nsw i64 %6, %0
%8 = sdiv i64 %7, 2
%9 = add nsw i64 %8, %1
ret i64 %9
}
/* Variables and functions */
scalar_t__ __builtin_jnf(int, float);
int /*<<< orphan*/ link_failure_builtin_jnf();
void test_builtin_jnf(int x, float f) {
  if (__builtin_jnf(x, f) != __builtin_jnf(x, f))
    link_failure_builtin_jnf();
}


x86 assembly (clang, -O0):
<test_builtin_jnf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
movss  -0x8(%rbp),%xmm0
call   1030 <__builtin_jnf@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
movss  -0x8(%rbp),%xmm0
call   1030 <__builtin_jnf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     1165 <test_builtin_jnf+0x45>
mov    $0x0,%al
call   1040 <link_failure_builtin_jnf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_jnf>:
push   %r14
push   %rbx
push   %rax
movss  %xmm0,0x4(%rsp)
mov    %edi,%ebx
call   1030 <__builtin_jnf@plt>
mov    %rax,%r14
mov    %ebx,%edi
movss  0x4(%rsp),%xmm0
call   1030 <__builtin_jnf@plt>
cmp    %rax,%r14
jne    114e <test_builtin_jnf+0x2e>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <link_failure_builtin_jnf@plt>

LLVM IR (-O0):
define void @test_builtin_jnf(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load i32, i32* %3
%6 = load float, float* %4
%7 = call i64 @__builtin_jnf(i32 %5, float %6)
%8 = load i32, i32* %3
%9 = load float, float* %4
%10 = call i64 @__builtin_jnf(i32 %8, float %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_builtin_jnf()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_builtin_jnf(i32 %0, float %1) {
%3 = tail call i64 @__builtin_jnf(i32 %0, float %1)
%4 = tail call i64 @__builtin_jnf(i32 %0, float %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_builtin_jnf()
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ enter_signal();
int /*<<< orphan*/ leave_signal();
int /*<<< orphan*/ logerr(char *);
void signal_pipe(int signal) {
  enter_signal();
  logerr("Broken pipe.\n");
  leave_signal();
}


x86 assembly (clang, -O0):
<signal_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <enter_signal@plt>
lea    0xeb7(%rip),%rdi
call   1050 <logerr@plt>
mov    $0x0,%al
call   1030 <leave_signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_pipe>:
push   %rax
xor    %eax,%eax
call   1040 <enter_signal@plt>
lea    0xec1(%rip),%rdi
call   1050 <logerr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <leave_signal@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Broken pipe.\0A\00"
define void @signal_pipe(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @enter_signal()
%4 = call i32 @logerr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @leave_signal()
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Broken pipe.\0A\00"
define void @signal_pipe(i32 %0) {
%2 = tail call i32 (...) @enter_signal()
%3 = tail call i32 @logerr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @leave_signal()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putAC(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ putbits(int, int);
void putACfirst(signed int run, signed int val) {
  if (run == 0) {
    if (val == 1)
      goto __CPROVER_DUMP_L1;
    if (val == -1)
      goto __CPROVER_DUMP_L1;
    goto __CPROVER_DUMP_L2;
  __CPROVER_DUMP_L1:;
    putbits(2 | (signed int)(val < 0), 2);
  } else {
  __CPROVER_DUMP_L2:;
    putAC(run, val, 0);
  }
}


x86 assembly (clang, -O0):
<putACfirst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1179 <putACfirst+0x59>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <putACfirst+0x27>
jmp    115b <putACfirst+0x3b>
cmpl   $0xffffffff,-0x8(%rbp)
jne    1156 <putACfirst+0x36>
jmp    115b <putACfirst+0x3b>
jmp    117e <putACfirst+0x5e>
cmpl   $0x0,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
or     $0x2,%edi
mov    $0x2,%esi
call   1030 <putbits@plt>
jmp    118b <putACfirst+0x6b>
jmp    117e <putACfirst+0x5e>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1040 <putAC@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putACfirst>:
test   %edi,%edi
je     112b <putACfirst+0xb>
xor    %edx,%edx
jmp    1040 <putAC@plt>
cmp    $0x1,%esi
je     1135 <putACfirst+0x15>
cmp    $0xffffffff,%esi
jne    1124 <putACfirst+0x4>
shr    $0x1f,%esi
or     $0x2,%esi
mov    %esi,%edi
mov    $0x2,%esi
jmp    1030 <putbits@plt>

LLVM IR (-O0):
define void @putACfirst(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 = icmp eq i32 %5, 0
br i1 %6, label %7, label %22
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
br label %16
11: ; preds = %7
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %15
14: ; preds = %11
br label %16
15: ; preds = %11
br label %23
16: ; preds = %14, %10
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 0
%19 = zext i1 %18 to i32
%20 = or i32 2, %19
%21 = call i32 @putbits(i32 %20, i32 2)
br label %27
22: ; preds = %2
br label %23
23: ; preds = %22, %15
%24 = load i32, i32* %3
%25 = load i32, i32* %4
%26 = call i32 @putAC(i32 %24, i32 %25, i32 0)
br label %27
27: ; preds = %23, %16
ret void
}

LLVM IR (-O2):
define void @putACfirst(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %2
switch i32 %1, label %9 [
i32 -1, label %5
i32 1, label %5
]
5: ; preds = %4, %4
%6 = lshr i32 %1, 31
%7 = or i32 %6, 2
%8 = tail call i32 @putbits(i32 %7, i32 2)
br label %11
9: ; preds = %4, %2
%10 = tail call i32 @putAC(i32 %0, i32 %1, i32 0)
br label %11
11: ; preds = %9, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ defcmds();
void init_commands(void) {
  ;
  defcmds();
  { return; };
}


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

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

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

LLVM IR (-O2):
define void @init_commands() {
%1 = tail call i32 (...) @defcmds()
ret void
}
/* Variables and functions */
scalar_t__ __builtin_exp10(double);
int /*<<< orphan*/ link_failure_builtin_exp10();
void test_builtin_exp10(double d) {
  if (__builtin_exp10(d) != __builtin_exp10(d))
    link_failure_builtin_exp10();
}


x86 assembly (clang, -O0):
<test_builtin_exp10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__builtin_exp10@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__builtin_exp10@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_builtin_exp10+0x3c>
mov    $0x0,%al
call   1040 <link_failure_builtin_exp10@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_exp10>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <__builtin_exp10@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <__builtin_exp10@plt>
cmp    %rax,%rbx
jne    1149 <test_builtin_exp10+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_builtin_exp10@plt>

LLVM IR (-O0):
define void @test_builtin_exp10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @__builtin_exp10(double %3)
%5 = load double, double* %2
%6 = call i64 @__builtin_exp10(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_builtin_exp10()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_builtin_exp10(double %0) {
%2 = tail call i64 @__builtin_exp10(double %0)
%3 = tail call i64 @__builtin_exp10(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_exp10()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
quit() { exit(-1); }


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @quit() {
%1 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ini_getbool_port(int *, char *, char *);
int ini_getbool_port_def(char *port, char *param, int def) {
  int value;
  if (!ini_getbool_port(&value, port, param))
    return def;
  return value;
}


x86 assembly (clang, -O0):
<ini_getbool_port_def>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rdi
call   1030 <ini_getbool_port@plt>
cmp    $0x0,%eax
jne    1148 <ini_getbool_port_def+0x38>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114e <ini_getbool_port_def+0x3e>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ini_getbool_port_def>:
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xc(%rsp),%rdi
call   1030 <ini_getbool_port@plt>
test   %eax,%eax
je     112f <ini_getbool_port_def+0x1f>
mov    0xc(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ini_getbool_port_def(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @ini_getbool_port(i32* %4, i8* %0, i8* %1)
%7 = icmp eq i32 %6, 0
%8 = load i32, i32* %4
%9 = select i1 %7, i32 %2, i32 %8
ret i32 %9
}