xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ db_pos(float);
float psd_estimate_usemdct(float mdct_line, float cof) {
  float power;
  float psd;
  power = (mdct_line * mdct_line + 1) / cof;
  psd = 0 + db_pos(power);
  return psd;
}


x86 assembly (clang, -O0):
<psd_estimate_usemdct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xec8(%rip),%xmm1
addss  %xmm1,%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <db_pos@plt>
add    $0x0,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psd_estimate_usemdct>:
push   %rax
mulss  %xmm0,%xmm0
addss  0xee3(%rip),%xmm0
divss  %xmm1,%xmm0
call   1030 <db_pos@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @psd_estimate_usemdct(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %3
%8 = load float, float* %3
%9 = call float @llvm.fmuladd.f32(float %7, float %8, float 1.000000e+00)
%10 = load float, float* %4
%11 = fdiv float %9, %10
store float %11, float* %5
%12 = load float, float* %5
%13 = call i32 @db_pos(float %12)
%14 = add nsw i32 0, %13
%15 = sitofp i32 %14 to float
store float %15, float* %6
%16 = load float, float* %6
ret float %16
}

LLVM IR (-O2):
define float @psd_estimate_usemdct(float %0, float %1) {
%3 = tail call float @llvm.fmuladd.f32(float %0, float %0, float 1.000000e+00)
%4 = fdiv float %3, %1
%5 = tail call i32 @db_pos(float %4)
%6 = sitofp i32 %5 to float
ret float %6
}
char utol(char c) {
  if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';
  else
    return c;
}


x86 assembly (clang, -O0):
<utol>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1136 <utol+0x36>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1136 <utol+0x36>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    113c <utol+0x3c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utol>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @utol(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 65
%15 = add nsw i32 %14, 97
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %19
17: ; preds = %7, %1
%18 = load i8, i8* %3
store i8 %18, i8* %2
br label %19
19: ; preds = %17, %11
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @utol(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ fortchartoc(char *);
int /*<<< orphan*/ gmvwrite_openfile_ascii(int /*<<< orphan*/);
void fgmvwrite_openfile_ascii_(char *filnam) {
  gmvwrite_openfile_ascii(fortchartoc(filnam));
}


x86 assembly (clang, -O0):
<fgmvwrite_openfile_ascii_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fortchartoc@plt>
mov    %eax,%edi
call   1040 <gmvwrite_openfile_ascii@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_openfile_ascii_>:
push   %rax
call   1030 <fortchartoc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <gmvwrite_openfile_ascii@plt>

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

LLVM IR (-O2):
define void @fgmvwrite_openfile_ascii_(i8* %0) {
%2 = tail call i32 @fortchartoc(i8* %0)
%3 = tail call i32 @gmvwrite_openfile_ascii(i32 %2)
ret void
}
void yy_1_LinkTitle(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_LinkTitle(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func2();
void func1(void) {
  int count = 0;
  for (count = 0; count < 0XFF; count++)
    func2();
  return;
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jge    1148 <func1+0x38>
mov    $0x0,%al
call   1030 <func2@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <func1+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
push   %rbx
mov    $0xff,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <func2@plt>
add    $0xffffffff,%ebx
jne    1120 <func1+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @func1() {
%1 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 255
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 (...) @func2()
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @func1() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 (...) @func2()
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 255
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
int SNDWavChangeVideoFormat(__attribute((unused)) int vertfreq) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @SNDWavChangeVideoFormat(i32 %0) {
ret i32 0
}
/* Variables and functions */
int core3_swap(char *, int);
int U_EMRSETPOLYFILLMODE_swap(char *record, int torev) {
  return (core3_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRSETPOLYFILLMODE_swap>:
jmp    1030 <core3_swap@plt>

LLVM IR (-O0):
define i32 @U_EMRSETPOLYFILLMODE_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 @core3_swap(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @U_EMRSETPOLYFILLMODE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core3_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct repos_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ repos_free_dump(struct repos_t *, int /*<<< orphan*/ *);
void repos_free(struct repos_t *repos) { repos_free_dump(repos, NULL); }


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

x86 assembly (clang, -O2):
<repos_free>:
xor    %esi,%esi
jmp    1030 <repos_free_dump@plt>

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

LLVM IR (-O2):
%struct.repos_t = type { i32 }
define void @repos_free(%struct.repos_t* %0) {
%2 = tail call i32 @repos_free_dump(%struct.repos_t* %0, i32* null)
ret void
}
int BaudValid(unsigned char b) {
  int val = 0;
  switch (b) {
  case 6:
    val = 1;
    break;
  case 7:
    val = 1;
    break;
  case 8:
    val = 1;
    break;
  case 9:
    val = 1;
    break;
  case 10:
    val = 1;
    break;
  default:
    val = 0;
    break;
  }
  return (val);
}


x86 assembly (clang, -O0):
<BaudValid>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
add    $0xfffffffa,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     1177 <BaudValid+0x77>
mov    -0x10(%rbp),%rax
lea    0xece(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
jmp    117e <BaudValid+0x7e>
movl   $0x1,-0x8(%rbp)
jmp    117e <BaudValid+0x7e>
movl   $0x1,-0x8(%rbp)
jmp    117e <BaudValid+0x7e>
movl   $0x1,-0x8(%rbp)
jmp    117e <BaudValid+0x7e>
movl   $0x1,-0x8(%rbp)
jmp    117e <BaudValid+0x7e>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BaudValid>:
add    $0xfa,%dil
xor    %eax,%eax
cmp    $0x5,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @BaudValid(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
switch i32 %5, label %11 [
i32 6, label %6
i32 7, label %7
i32 8, label %8
i32 9, label %9
i32 10, label %10
]
6: ; preds = %1
store i32 1, i32* %3
br label %12
7: ; preds = %1
store i32 1, i32* %3
br label %12
8: ; preds = %1
store i32 1, i32* %3
br label %12
9: ; preds = %1
store i32 1, i32* %3
br label %12
10: ; preds = %1
store i32 1, i32* %3
br label %12
11: ; preds = %1
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @BaudValid(i8 zeroext %0) {
%2 = add i8 %0, -6
%3 = icmp ult i8 %2, 5
%4 = zext i1 %3 to i32
ret i32 %4
}
int compare_int(const void *a, const void *b) {
  int *pa = (int *)a;
  int *pb = (int *)b;
  return *pa - *pb;
}


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

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

LLVM IR (-O0):
define i32 @compare_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int arr[], int n) {
  int i;
  for (i = 0; i < n; ++i)
    printf("%d\n", arr[i]);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <print+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <print+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int lqtvq_clamp32767U(int x) {
  return ((x < 0) ? 0 : ((x > 32767) ? 32767 : x));
}


x86 assembly (clang, -O0):
<lqtvq_clamp32767U>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111b <lqtvq_clamp32767U+0x1b>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <lqtvq_clamp32767U+0x41>
cmpl   $0x7fff,-0x4(%rbp)
jle    1135 <lqtvq_clamp32767U+0x35>
mov    $0x7fff,%eax
mov    %eax,-0xc(%rbp)
jmp    113b <lqtvq_clamp32767U+0x3b>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lqtvq_clamp32767U>:
cmp    $0x7fff,%edi
mov    $0x7fff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @lqtvq_clamp32767U(i32 %0) {
%2 = icmp slt i32 %0, 32767
%3 = select i1 %2, i32 %0, i32 32767
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sliceFree(void *);
void dictSliceDestructor(void *val) { sliceFree(val); }


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

x86 assembly (clang, -O2):
<dictSliceDestructor>:
jmp    1030 <sliceFree@plt>

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

LLVM IR (-O2):
define void @dictSliceDestructor(i8* %0) {
%2 = tail call i32 @sliceFree(i8* %0)
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
char *basename(char *path) {
  char *bn;
  bn = strrchr(path, '/');
  if (bn == NULL)
    return path;
  else
    return bn + 1;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1146 <basename+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <basename+0x42>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %3
store i8* %10, i8** %2
br label %14
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %2
br label %14
14: ; preds = %11, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage:  multiblend.flt\n"
                  "params: -t num     type of overlay [1-10]\n"
                  "         1 = additive\n"
                  "         2 = substractive\n"
                  "         3 = multiply\n"
                  "         4 = divide\n"
                  "         5 = difference\n"
                  "         6 = difference negate\n"
                  "         7 = freeze\n"
                  "         8 = unfreeze\n"
                  "         9 = hardlight\n"
                  "        10 = lighten only\n"
                  "\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [303 x i8] c"usage: multiblend.flt\0Aparams: -t num type of overlay [1-10]\0A 1 = additive\0A 2 = substractive\0A 3 = multiply\0A 4 = divide\0A 5 = difference\0A 6 = difference negate\0A 7 = freeze\0A 8 = unfreeze\0A 9 = hardlight\0A 10 = lighten only\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([303 x i8], [303 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [303 x i8] c"usage: multiblend.flt\0Aparams: -t num type of overlay [1-10]\0A 1 = additive\0A 2 = substractive\0A 3 = multiply\0A 4 = divide\0A 5 = difference\0A 6 = difference negate\0A 7 = freeze\0A 8 = unfreeze\0A 9 = hardlight\0A 10 = lighten only\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([303 x i8], [303 x i8]* @.str, i64 0, i64 0))
ret void
}
void sys_listmididevs(void) {}


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

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

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

LLVM IR (-O2):
define void @sys_listmididevs() {
ret void
}
int maxi(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<maxi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <maxi+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <maxi+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @maxi(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @maxi(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XGetSelectionOwner() {
  printf("XGetSelectionOwner called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [26 x i8] c"XGetSelectionOwner called\00"
define i32 @XGetSelectionOwner() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void _start(void) {
  asm volatile("and $0xfffffff0, %esp");
  main();
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
and    $0xfffffff0,%esp
mov    $0x0,%al
call   1030 <main@plt>
jmp    111e <_start+0xe>

x86 assembly (clang, -O2):
<_start>:
push   %rax
and    $0xfffffff0,%esp
xor    %eax,%eax
call   1030 <main@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <_start+0x10>

LLVM IR (-O0):
define void @_start() {
%1 = call i32 (...) @main()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @_start() {
tail call void asm sideeffect "and $$0xfffffff0, %esp", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (...) @main()
br label %2
2: ; preds = %0, %2
br label %2
}
float knots(float f) { return f * 0.514444444f; }


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

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

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

LLVM IR (-O2):
define float @knots(float %0) {
%2 = fmul float %0, 0x3FE0765440000000
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ list_selectaddfriend();
void button_add_onpress(void) { list_selectaddfriend(); }


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

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

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

LLVM IR (-O2):
define void @button_add_onpress() {
%1 = tail call i32 (...) @list_selectaddfriend()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_bpm_changes();
int /*<<< orphan*/ test_bpm_modifier_changes();
int /*<<< orphan*/ test_buzzer_changes();
int /*<<< orphan*/ test_initialization_values();
int /*<<< orphan*/ test_req_iter_changes();
void execute_tests() {
  test_initialization_values();
  test_bpm_changes();
  test_bpm_modifier_changes();
  test_req_iter_changes();
  test_buzzer_changes();
}


x86 assembly (clang, -O0):
<execute_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test_initialization_values@plt>
mov    $0x0,%al
call   1040 <test_bpm_changes@plt>
mov    $0x0,%al
call   1070 <test_bpm_modifier_changes@plt>
mov    $0x0,%al
call   1060 <test_req_iter_changes@plt>
mov    $0x0,%al
call   1030 <test_buzzer_changes@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute_tests>:
push   %rax
xor    %eax,%eax
call   1050 <test_initialization_values@plt>
xor    %eax,%eax
call   1040 <test_bpm_changes@plt>
xor    %eax,%eax
call   1070 <test_bpm_modifier_changes@plt>
xor    %eax,%eax
call   1060 <test_req_iter_changes@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_buzzer_changes@plt>

LLVM IR (-O0):
define void @execute_tests() {
%1 = call i32 (...) @test_initialization_values()
%2 = call i32 (...) @test_bpm_changes()
%3 = call i32 (...) @test_bpm_modifier_changes()
%4 = call i32 (...) @test_req_iter_changes()
%5 = call i32 (...) @test_buzzer_changes()
ret void
}

LLVM IR (-O2):
define void @execute_tests() {
%1 = tail call i32 (...) @test_initialization_values()
%2 = tail call i32 (...) @test_bpm_changes()
%3 = tail call i32 (...) @test_bpm_modifier_changes()
%4 = tail call i32 (...) @test_req_iter_changes()
%5 = tail call i32 (...) @test_buzzer_changes()
ret void
}
/* Variables and functions */
double log(int);
double tclog2d(double num) { return log(num) / log(2); }


x86 assembly (clang, -O0):
<tclog2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%edi
call   1030 <log@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x2,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tclog2d>:
push   %rax
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1030 <log@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @tclog2d(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
%5 = call double @log(i32 %4)
%6 = call double @log(i32 2)
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @tclog2d(double %0) {
%2 = fptosi double %0 to i32
%3 = tail call double @log(i32 %2)
%4 = tail call double @log(i32 2)
%5 = fdiv double %3, %4
ret double %5
}
void vx_handler(struct exception_info *info) {
  asm volatile("" : : :);
  asm volatile("hlt");
}


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

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

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

LLVM IR (-O2):
%struct.exception_info = type opaque
define void @vx_handler(%struct.exception_info* nocapture readnone %0) {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int __isgraph_impl(int);
int isgraph(int c) { return __isgraph_impl(c); }


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

x86 assembly (clang, -O2):
<isgraph>:
jmp    1030 <__isgraph_impl@plt>

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

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = tail call i32 @__isgraph_impl(i32 %0)
ret i32 %2
}
int convertCtoF(int c) {
  int f;
  f = 0;
  f = c * (9.0 / 5.0) + 32;
  return f;
}


x86 assembly (clang, -O0):
<convertCtoF>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xee5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee1(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertCtoF>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @convertCtoF(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = call double @llvm.fmuladd.f64(double %5, double 1.800000e+00, double 3.200000e+01)
%7 = fptosi double %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @convertCtoF(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 1.800000e+00, double 3.200000e+01)
%4 = fptosi double %3 to i32
ret i32 %4
}
/* Variables and functions */
unsigned long nibble_sort(unsigned long);
void nibble_sort_justin(unsigned long *buf) {
  unsigned long *b = buf;
  for (int i = 0; i < 1024; i++) {
    buf[i] = nibble_sort(b[i]);
  }
}


x86 assembly (clang, -O0):
<nibble_sort_justin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    1166 <nibble_sort_justin+0x56>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <nibble_sort@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <nibble_sort_justin+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibble_sort_justin>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <nibble_sort@plt>
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    $0x400,%rbx
jne    1120 <nibble_sort_justin+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @nibble_sort_justin(i64* nocapture %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %8, %3 ]
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
%7 = tail call i64 @nibble_sort(i64 %6)
store i64 %7, i64* %5
%8 = add nuw nsw i64 %4, 1
%9 = icmp eq i64 %8, 1024
br i1 %9, label %2, label %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ strlen(char *);
int system(char *);
int test_if_dir_exists(char *path) {
  char com[strlen(path) + 7];
  sprintf(com, "test -d \"%s\"", path);
  return system(com);
}


x86 assembly (clang, -O0):
<test_if_dir_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x7,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xe8a(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <system@plt>
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_if_dir_exists>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x7,%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xea6(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"test -d \22%s\22\00"
define i32 @test_if_dir_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 7
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %3
%10 = alloca i8, i64 %8
store i64 %8, i64* %4
%11 = load i8*, i8** %2
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @system(i8* %10)
%14 = load i8*, i8** %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [13 x i8] c"test -d \22%s\22\00"
define i32 @test_if_dir_exists(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 7
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = call i32 @system(i8* %5)
ret i32 %7
}
int test_imm_9Fint8_mem(signed char *val) {
  return ((*val) & (-0x9F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_9Fint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff61,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Fint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -159
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t flip_sign_bit(int32_t k) {
  return (int32_t)(((uint32_t)k) ^ ((uint32_t)0x80000000));
}


x86 assembly (clang, -O0):
<flip_sign_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0x80000000,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip_sign_bit>:
movslq %edi,%rax
xor    $0xffffffff80000000,%rax
ret

LLVM IR (-O0):
define i64 @flip_sign_bit(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = xor i32 %4, -2147483648
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @flip_sign_bit(i64 %0) {
%2 = shl i64 %0, 32
%3 = ashr exact i64 %2, 32
%4 = xor i64 %3, -2147483648
ret i64 %4
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t getRed0(int32_t const rgb0) { return ((rgb0 & 16711680) >> 16); }


x86 assembly (clang, -O0):
<getRed0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff0000,%eax
sar    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRed0>:
shr    $0x10,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @getRed0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 16711680
%5 = ashr i32 %4, 16
ret i32 %5
}

LLVM IR (-O2):
define i32 @getRed0(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 255
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ bswap64(int /*<<< orphan*/);
void bswap64s(uint64_t *s) { *s = bswap64(*s); }


x86 assembly (clang, -O0):
<bswap64s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <bswap64@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap64s>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <bswap64@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @bswap64s(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @bswap64(i32 %4)
%6 = load i32*, i32** %2
store i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @bswap64s(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @bswap64(i32 %2)
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int minor_pentatonic(int, int);
int major_pentatonic(int num, int mod) {
  return minor_pentatonic(num + 1, mod) - 3;
}


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

x86 assembly (clang, -O2):
<major_pentatonic>:
push   %rax
add    $0x1,%edi
call   1030 <minor_pentatonic@plt>
add    $0xfffffffd,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @major_pentatonic(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 = add nsw i32 %5, 1
%7 = load i32, i32* %4
%8 = call i32 @minor_pentatonic(i32 %6, i32 %7)
%9 = sub nsw i32 %8, 3
ret i32 %9
}

LLVM IR (-O2):
define i32 @major_pentatonic(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1
%4 = tail call i32 @minor_pentatonic(i32 %3, i32 %1)
%5 = add nsw i32 %4, -3
ret i32 %5
}
int fun1319() { return 1319; }


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

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

LLVM IR (-O0):
define i32 @fun1319() {
ret i32 1319
}

LLVM IR (-O2):
define i32 @fun1319() {
ret i32 1319
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: bin2c [-csvz] <input_file> <output_file>\n"
                  "  <input_file> is the binary file to convert\n"
                  "  <output_file> should not have a .c or .h extension\n"
                  "\n"
                  "  -c - do NOT use const in declaration\n"
                  "  -s - do use static in declaration\n"
                  "  -v - verbose\n"
                  "  -z - add zero terminator\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [265 x i8] c"usage: bin2c [-csvz] <input_file> <output_file>\0A <input_file> is the binary file to convert\0A <output_file> should not have a .c or .h extension\0A\0A -c - do NOT use const in declaration\0A -s - do use static in declaration\0A -v - verbose\0A -z - add zero terminator\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([265 x i8], [265 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [265 x i8] c"usage: bin2c [-csvz] <input_file> <output_file>\0A <input_file> is the binary file to convert\0A <output_file> should not have a .c or .h extension\0A\0A -c - do NOT use const in declaration\0A -s - do use static in declaration\0A -v - verbose\0A -z - add zero terminator\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([265 x i8], [265 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void outOfMemory() {
  char *s = "out of memory";
  write(1, s, strlen(s));
  exit(0);
}


x86 assembly (clang, -O0):
<outOfMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<outOfMemory>:
push   %rbx
lea    0xec8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define void @outOfMemory() {
%1 = alloca i8*
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @strlen(i8* %3)
%5 = call i32 @write(i32 1, i8* %2, i32 %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define void @outOfMemory() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
unsigned int get_sample_rate(const unsigned char sr_index) {
  static const unsigned int sample_rates[] = {96000, 88200, 64000, 48000,
                                              44100, 32000, 24000, 22050,
                                              16000, 12000, 11025, 8000};
  if (sr_index < 12)
    return sample_rates[sr_index];
  return 0;
}


x86 assembly (clang, -O0):
<get_sample_rate>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0xc,%eax
jge    112f <get_sample_rate+0x2f>
movzbl -0x5(%rbp),%eax
mov    %eax,%ecx
lea    0xedc(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <get_sample_rate+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sample_rate>:
xor    %eax,%eax
cmp    $0xb,%dil
ja     1116 <get_sample_rate+0x16>
movzbl %dil,%eax
lea    0xeed(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@get_sample_rate.sample_rates = internal constant [12 x i32] [i32 96000, i32 88200, i32 64000, i32 48000, i32 44100, i32 32000, i32 24000, i32 22050, i32 16000, i32 12000, i32 11025, i32 8000]
define i32 @get_sample_rate(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 12
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i64
%10 = getelementptr inbounds [12 x i32], [12 x i32]* @get_sample_rate.sample_rates, i64 0, i64 %9
%11 = load i32, i32* %10
store i32 %11, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@get_sample_rate.sample_rates = internal unnamed_addr constant [12 x i32] [i32 96000, i32 88200, i32 64000, i32 48000, i32 44100, i32 32000, i32 24000, i32 22050, i32 16000, i32 12000, i32 11025, i32 8000]
define i32 @get_sample_rate(i8 zeroext %0) {
%2 = icmp ult i8 %0, 12
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = zext i8 %0 to i64
%5 = getelementptr inbounds [12 x i32], [12 x i32]* @get_sample_rate.sample_rates, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int thread_id;
  int num_threads;
#pragma omp parallel private(num_threads)
  {
    thread_id = omp_get_thread_num();
    printf("\nHello from thread: %d", thread_id);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"\0AHello from thread: %d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @omp_get_thread_num()
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0AHello from thread: %d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @omp_get_thread_num()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
double atanh(double);
double sqrt(double);
double asinh(double r1) { return atanh(r1 / sqrt(1.0 + r1 * r1)); }


x86 assembly (clang, -O0):
<asinh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb3(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
call   1030 <atanh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asinh>:
push   %rax
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm0
addsd  0xecf(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1141 <asinh+0x21>
sqrtsd %xmm0,%xmm0
jmp    1150 <asinh+0x30>
movsd  %xmm2,(%rsp)
call   1040 <sqrt@plt>
movsd  (%rsp),%xmm2
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
pop    %rax
jmp    1030 <atanh@plt>

LLVM IR (-O0):
define double @asinh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double %4, double %5, double 1.000000e+00)
%7 = call double @sqrt(double %6)
%8 = fdiv double %3, %7
%9 = call double @atanh(double %8)
ret double %9
}

LLVM IR (-O2):
define double @asinh(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 1.000000e+00)
%3 = tail call double @sqrt(double %2)
%4 = fdiv double %0, %3
%5 = tail call double @atanh(double %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void fatal(char const *s) {
  fprintf(stderr, "error: %s", s);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"error: %s\00"
define void @fatal(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 ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"error: %s\00"
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}