xunge/DecIR huggingface dataset:
int f(const char *s) {
  int product = 1;
  for (const char *p = s; *p; ++p)
    product *= *p - 'A' + 1;
  return product % 47;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <f+0x49>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
sub    $0x41,%eax
add    $0x1,%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <f+0x17>
mov    -0xc(%rbp),%eax
mov    $0x2f,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    (%rdi),%cl
test   %cl,%cl
je     1143 <f+0x43>
add    $0x1,%rdi
mov    $0x1,%eax
nop
movsbl %cl,%ecx
add    $0xffffffc0,%ecx
imul   %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <f+0x10>
cltq
imul   $0xffffffffae4c415d,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x2f,%ecx,%ecx
sub    %ecx,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %6, label %8
4: ; preds = %8
%5 = srem i32 %14, 47
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ 1, %1 ], [ %5, %4 ]
ret i32 %7
8: ; preds = %1, %8
%9 = phi i8 [ %16, %8 ], [ %2, %1 ]
%10 = phi i8* [ %15, %8 ], [ %0, %1 ]
%11 = phi i32 [ %14, %8 ], [ 1, %1 ]
%12 = sext i8 %9 to i32
%13 = add nsw i32 %12, -64
%14 = mul nsw i32 %13, %11
%15 = getelementptr inbounds i8, i8* %10, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %4, label %8
}
/* Variables and functions */
int /*<<< orphan*/ packi64(unsigned char *, unsigned long long);
extern void serialize_int64(unsigned char *buf, unsigned long long int i) {
  packi64(buf, i);
}


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

x86 assembly (clang, -O2):
<serialize_int64>:
jmp    1030 <packi64@plt>

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

LLVM IR (-O2):
define void @serialize_int64(i8* %0, i64 %1) {
%3 = tail call i32 @packi64(i8* %0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int *ignore1(void) {
  int *ignored_x1 = malloc(400);
  int *ignored_x2 = malloc(400);
  free(ignored_x2);
  return ignored_x1;
}


x86 assembly (clang, -O0):
<ignore1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x190,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x190,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore1>:
push   %rbx
mov    $0x190,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    $0x190,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @ignore1() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* @malloc(i32 400)
store i32* %3, i32** %1
%4 = call i32* @malloc(i32 400)
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @free(i32* %5)
%7 = load i32*, i32** %1
ret i32* %7
}

LLVM IR (-O2):
define noalias i32* @ignore1() {
%1 = tail call i32* @malloc(i32 400)
%2 = tail call i32* @malloc(i32 400)
%3 = tail call i32 @free(i32* %2)
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: injail\n");
  exit(2);
}


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    $0x2,%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    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"usage: injail\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"usage: injail\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char *);
int is_deprecated_option(const char *name) {
  if (!strcmp(name, "TagsIconv"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_deprecated_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1141 <is_deprecated_option+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <is_deprecated_option+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_deprecated_option>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"TagsIconv\00"
define i32 @is_deprecated_option(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strcmp(i8* %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [10 x i8] c"TagsIconv\00"
define i32 @is_deprecated_option(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void StartIntervalTimer() {}


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

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

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

LLVM IR (-O2):
define void @StartIntervalTimer() {
ret void
}
int inotify_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @inotify_init() {
ret i32 0
}
float MIN(float a, float b) {
  if (a == -1)
    return b;
  if (b == -1)
    return a;
  if (a < b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<MIN>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xee5(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    1139 <MIN+0x39>
jp     1139 <MIN+0x39>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1190 <MIN+0x90>
movss  -0xc(%rbp),%xmm0
movss  0xeba(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    1164 <MIN+0x64>
jp     1164 <MIN+0x64>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1190 <MIN+0x90>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1186 <MIN+0x86>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1190 <MIN+0x90>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MIN>:
ucomiss 0xef9(%rip),%xmm0
jne    110f <MIN+0xf>
jp     110f <MIN+0xf>
movaps %xmm1,%xmm0
ret
ucomiss 0xeea(%rip),%xmm1
jne    111a <MIN+0x1a>
jnp    111e <MIN+0x1e>
minss  %xmm1,%xmm0
movaps %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @MIN(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = fcmp oeq float %6, -1.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %5
store float %9, float* %3
br label %23
10: ; preds = %2
%11 = load float, float* %5
%12 = fcmp oeq float %11, -1.000000e+00
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load float, float* %4
store float %14, float* %3
br label %23
15: ; preds = %10
%16 = load float, float* %4
%17 = load float, float* %5
%18 = fcmp olt float %16, %17
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = load float, float* %4
store float %20, float* %3
br label %23
21: ; preds = %15
%22 = load float, float* %5
store float %22, float* %3
br label %23
23: ; preds = %21, %19, %13, %8
%24 = load float, float* %3
ret float %24
}

LLVM IR (-O2):
define float @MIN(float %0, float %1) {
%3 = fcmp oeq float %0, -1.000000e+00
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = fcmp oeq float %1, -1.000000e+00
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = fcmp olt float %0, %1
%8 = select i1 %7, float %0, float %1
br label %9
9: ; preds = %6, %4, %2
%10 = phi float [ %1, %2 ], [ %0, %4 ], [ %8, %6 ]
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ DP();
int /*<<< orphan*/ L();
int /*<<< orphan*/ T();
int /*<<< orphan*/ eat(int);
int /*<<< orphan*/ printf(char *);
void D() {
  printf("D -> TL;D'\n");
  T();
  L();
  eat(14);
  DP();
}


x86 assembly (clang, -O0):
<D>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1040 <T@plt>
mov    $0x0,%al
call   1050 <L@plt>
mov    $0xe,%edi
call   1030 <eat@plt>
mov    $0x0,%al
call   1070 <DP@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<D>:
push   %rax
lea    0xea8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <T@plt>
xor    %eax,%eax
call   1060 <L@plt>
mov    $0xe,%edi
call   1030 <eat@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <DP@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"D -> TL;D'\0A\00"
define void @D() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @T()
%3 = call i32 (...) @L()
%4 = call i32 @eat(i32 14)
%5 = call i32 (...) @DP()
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"D -> TL;D'\00"
define void @D() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @T()
%3 = tail call i32 (...) @L()
%4 = tail call i32 @eat(i32 14)
%5 = tail call i32 (...) @DP()
ret void
}
int test_imm_50int16_reg(short val) {
  return ((val) & (0x50 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_50int16_reg(i16 signext %0) {
%2 = and i16 %0, 80
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ memset_benchmark(int);
int main(int argc, char **argv) {
  int32_t reps;
  if (argc > 1) {
    reps = atoi(argv[1]);
  } else {
    reps = 16;
  }
  memset_benchmark(reps);
  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)
cmpl   $0x1,-0x8(%rbp)
jle    1155 <main+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    115c <main+0x3c>
movl   $0x10,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <memset_benchmark@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%eax
mov    $0x10,%edi
cmp    $0x2,%eax
jl     1138 <main+0x18>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <memset_benchmark@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 16, %2 ]
%10 = tail call i32 @memset_benchmark(i32 %9)
ret i32 0
}
/* Variables and functions */
int isnan(float);
int __pruabi_isnanf(float a) { return isnan(a); }


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

x86 assembly (clang, -O2):
<__pruabi_isnanf>:
jmp    1030 <isnan@plt>

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

LLVM IR (-O2):
define i32 @__pruabi_isnanf(float %0) {
%2 = tail call i32 @isnan(float %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int pthread_mutexattr_settype(pthread_mutexattr_t *__attr, int __kind) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutexattr_settype(i32* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
double pow(double, double);
double pitchShiftMultiplier(double dPitchShiftSemitones) {
  if (dPitchShiftSemitones == 0)
    return 1.0;
  return pow(2.0, dPitchShiftSemitones / 12.0);
}


x86 assembly (clang, -O0):
<pitchShiftMultiplier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1147 <pitchShiftMultiplier+0x37>
jp     1147 <pitchShiftMultiplier+0x37>
movsd  0xed3(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116a <pitchShiftMultiplier+0x5a>
movsd  -0x10(%rbp),%xmm1
movsd  0xeb4(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xea0(%rip),%xmm0
call   1030 <pow@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pitchShiftMultiplier>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1125 <pitchShiftMultiplier+0x15>
jp     1125 <pitchShiftMultiplier+0x15>
movsd  0xee4(%rip),%xmm0
ret
divsd  0xed3(%rip),%xmm0
jmp    1030 <exp2@plt>

LLVM IR (-O0):
define double @pitchShiftMultiplier(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %11
7: ; preds = %1
%8 = load double, double* %3
%9 = fdiv double %8, 1.200000e+01
%10 = call double @pow(double 2.000000e+00, double %9)
store double %10, double* %2
br label %11
11: ; preds = %7, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @pitchShiftMultiplier(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = fdiv double %0, 1.200000e+01
%5 = tail call double @exp2(double %4)
br label %6
6: ; preds = %1, %3
%7 = phi double [ %5, %3 ], [ 1.000000e+00, %1 ]
ret double %7
}
void perror() {}


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

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

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

LLVM IR (-O2):
define void @perror() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void imprimeSubtracao(int valor1, int valor2) {
  printf("\n\nSubtracao: %d", valor1 - valor2);
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"\0A\0ASubtracao: %d\00"
define void @imprimeSubtracao(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 = sub nsw i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0A\0ASubtracao: %d\00"
define void @imprimeSubtracao(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/
convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_bt601_sse2_ssse3(
    int /*<<< orphan*/ *, int /*<<< orphan*/ *);
extern void
convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_bt601_sse2_ssse3_sse41(
    __m128i *in, __m128i *out) {
  convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_bt601_sse2_ssse3(in, out);
}


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

x86 assembly (clang, -O2):
<convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_bt601_sse2_ssse3_sse41>:
jmp    1030 <convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_bt601_sse2_ssse3@plt>

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

LLVM IR (-O2):
define void @convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_bt601_sse2_ssse3_sse41(i32* %0, i32* %1) {
%3 = tail call i32 @convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_bt601_sse2_ssse3(i32* %0, i32* %1)
ret void
}
void set_ibn(int *i, int *bn) {
  *i += 1;
  *bn = 0;
}


x86 assembly (clang, -O0):
<set_ibn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_ibn>:
addl   $0x1,(%rdi)
movl   $0x0,(%rsi)
ret

LLVM IR (-O0):
define void @set_ibn(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* %5
%7 = add nsw i32 %6, 1
store i32 %7, i32* %5
%8 = load i32*, i32** %4
store i32 0, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_ibn(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, 1
store i32 %4, i32* %0
store i32 0, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) {
  jmp_buf buf;
  longjmp(buf, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <longjmp@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %esi,%esi
call   1030 <longjmp@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* %2
%4 = call i32 @longjmp(i32 %3, i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @longjmp(i32 undef, i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void assume_abort_if_not(int cond) {
  if (!cond) {
    abort();
  }
}


x86 assembly (clang, -O0):
<assume_abort_if_not>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112c <assume_abort_if_not+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assume_abort_if_not>:
test   %edi,%edi
je     1115 <assume_abort_if_not+0x5>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @assume_abort_if_not(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @assume_abort_if_not(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgstorlw(int n) { ngen("%s\t%%rax,%d(%%rbp)", "movq", n); }


x86 assembly (clang, -O0):
<cgstorlw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee7(%rip),%rsi
call   1030 <ngen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgstorlw>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xef3(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%s\09%%rax,%d(%%rbp)\00"
@.str.1 = [5 x i8] c"movq\00"
define void @cgstorlw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%s\09%%rax,%d(%%rbp)\00"
@.str.1 = [5 x i8] c"movq\00"
define void @cgstorlw(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
int add(int x, int y) {
  int a, b;
  do {
    a = x & y;
    b = x ^ y;
    x = a << 1;
    y = b;
  } while (a);
  return b;
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    110a <add+0xa>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
mov    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
mov    %edi,%eax
mov    %edi,%edx
and    %ecx,%edx
xor    %ecx,%eax
lea    (%rdx,%rdx,1),%edi
test   %edx,%edx
jne    1110 <add+0x10>
ret

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

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %1, %2 ], [ %7, %3 ]
%5 = phi i32 [ %0, %2 ], [ %8, %3 ]
%6 = and i32 %5, %4
%7 = xor i32 %5, %4
%8 = shl i32 %6, 1
%9 = icmp eq i32 %6, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32 %7
}
/* Variables and functions */
scalar_t__ get_val(int *, int);
int get_val_default(int x) {
  int res;
  if (0 == get_val(&res, x)) {
    return res;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_val_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    -0xc(%rbp),%rdi
call   1030 <get_val@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1140 <get_val_default+0x30>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <get_val_default+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_val_default>:
push   %rax
mov    %edi,%esi
lea    0x4(%rsp),%rdi
call   1030 <get_val@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    112b <get_val_default+0x1b>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_val_default(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i64 @get_val(i32* %4, i32 %5)
%7 = icmp eq i64 0, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %4
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @get_val_default(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i64 @get_val(i32* %2, i32 %0)
%5 = icmp eq i64 %4, 0
%6 = load i32, i32* %2
%7 = select i1 %5, i32 %6, i32 0
ret i32 %7
}
indreg0indreg1_set(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (*p0) = (*p1); }


x86 assembly (clang, -O0):
<indreg0indreg1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0indreg1_set>:
movzwl (%r9),%eax
mov    %ax,(%r8)
ret

LLVM IR (-O0):
define i32 @indreg0indreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %13
%17 = load i16, i16* %16
%18 = load i16*, i16** %12
store i16 %17, i16* %18
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @indreg0indreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture writeonly %4, i16* nocapture %5) {
%7 = load i16, i16* %5
store i16 %7, i16* %4
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ randomize_entry(int);
void generate_data(void) {
  int i;
  for (i = 0; i < 100; ++i)
    randomize_entry(i);
}


x86 assembly (clang, -O0):
<generate_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    113f <generate_data+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <randomize_entry@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <generate_data+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_data>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <randomize_entry@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1120 <generate_data+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @generate_data() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @randomize_entry(i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
int sub2(int a, int b) { return a + 2 * b; }


x86 assembly (clang, -O0):
<sub2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub2>:
lea    (%rdi,%rsi,2),%eax
ret

LLVM IR (-O0):
define i32 @sub2(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 = mul nsw i32 2, %6
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @sub2(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = add nsw i32 %3, %0
ret i32 %4
}
int sgx_thread_wait_untrusted_event_ocall(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @sgx_thread_wait_untrusted_event_ocall() {
ret i32 1
}
/* Variables and functions */
char *strrchr(const char *s, int c) {
  const char *lastOccurrence = NULL;
  while (*s != '\0') {
    if (((unsigned char)*s) == ((unsigned char)c)) {
      lastOccurrence = s;
    }
    s++;
  }
  return (char *)lastOccurrence;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <strrchr+0x51>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0xc(%rbp),%ecx
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    1140 <strrchr+0x40>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <strrchr+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1123 <strrchr+0x23>
nopl   0x0(%rax,%rax,1)
cmp    %sil,%cl
cmove  %rdi,%rax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %7
%8 = phi i8 [ %3, %5 ], [ %14, %7 ]
%9 = phi i8* [ null, %5 ], [ %12, %7 ]
%10 = phi i8* [ %0, %5 ], [ %13, %7 ]
%11 = icmp eq i8 %8, %6
%12 = select i1 %11, i8* %10, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %2
%17 = phi i8* [ null, %2 ], [ %12, %7 ]
ret i8* %17
}
double PowerOfTwo(int n) {
  double r = 1;
  for (int i = 1; i <= (n + 1); ++i) {
    r *= 2;
  }
  return r;
}


x86 assembly (clang, -O0):
<PowerOfTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  0xef1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     114c <PowerOfTwo+0x4c>
movsd  0xed4(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <PowerOfTwo+0x1b>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<PowerOfTwo>:
test   %edi,%edi
js     111b <PowerOfTwo+0x1b>
lea    0x1(%rdi),%ecx
mov    %ecx,%eax
and    $0x7,%eax
cmp    $0x7,%edi
jae    1124 <PowerOfTwo+0x24>
movsd  0xee7(%rip),%xmm0
jmp    1155 <PowerOfTwo+0x55>
movsd  0xedd(%rip),%xmm0
ret
and    $0xfffffff8,%ecx
movsd  0xed1(%rip),%xmm0
nop
addsd  %xmm0,%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm0,%xmm0
add    $0xfffffff8,%ecx
jne    1130 <PowerOfTwo+0x30>
test   %eax,%eax
je     1169 <PowerOfTwo+0x69>
nopl   0x0(%rax)
addsd  %xmm0,%xmm0
add    $0xffffffff,%eax
jne    1160 <PowerOfTwo+0x60>
ret

LLVM IR (-O0):
define double @PowerOfTwo(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca i32
store i32 %0, i32* %2
store double 1.000000e+00, double* %3
store i32 1, i32* %4
br label %5
5: ; preds = %13, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
%9 = icmp sle i32 %6, %8
br i1 %9, label %10, label %16
10: ; preds = %5
%11 = load double, double* %3
%12 = fmul double %11, 2.000000e+00
store double %12, double* %3
br label %13
13: ; preds = %10
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %5
16: ; preds = %5
%17 = load double, double* %3
ret double %17
}

LLVM IR (-O2):
define double @PowerOfTwo(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %19, label %3
3: ; preds = %1
%4 = add i32 %0, 1
%5 = and i32 %4, 7
%6 = icmp ult i32 %0, 7
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = and i32 %4, -8
br label %21
9: ; preds = %21, %3
%10 = phi double [ undef, %3 ], [ %31, %21 ]
%11 = phi double [ 1.000000e+00, %3 ], [ %31, %21 ]
%12 = icmp eq i32 %5, 0
br i1 %12, label %19, label %13
13: ; preds = %9, %13
%14 = phi double [ %16, %13 ], [ %11, %9 ]
%15 = phi i32 [ %17, %13 ], [ 0, %9 ]
%16 = fmul double %14, 2.000000e+00
%17 = add i32 %15, 1
%18 = icmp eq i32 %17, %5
br i1 %18, label %19, label %13
19: ; preds = %9, %13, %1
%20 = phi double [ 1.000000e+00, %1 ], [ %10, %9 ], [ %16, %13 ]
ret double %20
21: ; preds = %21, %7
%22 = phi double [ 1.000000e+00, %7 ], [ %31, %21 ]
%23 = phi i32 [ 0, %7 ], [ %32, %21 ]
%24 = fmul double %22, 2.000000e+00
%25 = fmul double %24, 2.000000e+00
%26 = fmul double %25, 2.000000e+00
%27 = fmul double %26, 2.000000e+00
%28 = fmul double %27, 2.000000e+00
%29 = fmul double %28, 2.000000e+00
%30 = fmul double %29, 2.000000e+00
%31 = fmul double %30, 2.000000e+00
%32 = add i32 %23, 8
%33 = icmp eq i32 %32, %8
br i1 %33, label %9, label %21
}
int gcd(int a, int b) {
  while (a != 0) {
    int c = a;
    a = b % a;
    b = c;
  }
  return b;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <gcd+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%eax
test   %edi,%edi
je     111d <gcd+0x1d>
mov    %edi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
%6 = phi i32 [ %5, %4 ], [ %1, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %1, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int PAPI_num_counters();
void PAPIF_NUM_COUNTERS(int *numevents) { *numevents = PAPI_num_counters(); }


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

x86 assembly (clang, -O2):
<PAPIF_NUM_COUNTERS>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <PAPI_num_counters@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @PAPIF_NUM_COUNTERS(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @PAPI_num_counters()
store i32 %2, i32* %0
ret void
}
/* Variables and functions */
int equal(char *, char *);
int /*<<< orphan*/ reverse(char *);
int test_reverse_odd_chars() {
  char string[] = "abc";
  reverse(string);
  return equal("cba", string);
}


x86 assembly (clang, -O0):
<test_reverse_odd_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x4(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1040 <equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_reverse_odd_chars>:
push   %rbx
sub    $0x10,%rsp
movl   $0x636261,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1040 <equal@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_reverse_odd_chars.string = [4 x i8] c"abc\00"
@.str = [4 x i8] c"cba\00"
define i32 @test_reverse_odd_chars() {
%1 = alloca [4 x i8]
%2 = bitcast [4 x i8]* %1 to i8*
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%4 = call i32 @reverse(i8* %3)
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%6 = call i32 @equal(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"cba\00"
define i32 @test_reverse_odd_chars() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 6513249, i32* %1
%3 = call i32 @reverse(i8* %2)
%4 = call i32 @equal(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 %4
}
void t(int a) {
  if (a)
    printf("I Am Completely Operational,"),
        printf("And All My Circuits Are Functioning Perfectly\n");
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1141 <t+0x31>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
test   %edi,%edi
je     1140 <t+0x20>
push   %rax
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@.str = [29 x i8] c"I Am Completely Operational,\00"
@.str.1 = [47 x i8] c"And All My Circuits Are Functioning Perfectly\0A\00"
define void @t(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"I Am Completely Operational,\00"
@str = [46 x i8] c"And All My Circuits Are Functioning Perfectly\00"
define void @t(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int input_timeout(int /*<<< orphan*/, int);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int ret = input_timeout(STDIN_FILENO, 5);
  fprintf(stderr, "select returned %d.\n", ret);
  return ret == 1 ? 0 : 1;
}


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    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    $0x5,%esi
call   1040 <input_timeout@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    $0x5,%esi
call   1040 <input_timeout@plt>
mov    %eax,%ebx
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
xor    %eax,%eax
cmp    $0x1,%ebx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
@stderr = global i32 0
@.str = [21 x i8] c"select returned %d.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @STDIN_FILENO
%8 = call i32 @input_timeout(i32 %7, i32 5)
store i32 %8, i32* %6
%9 = load i32, i32* @stderr
%10 = load i32, i32* %6
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %6
%13 = icmp eq i32 %12, 1
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 0, i32 1
ret i32 %15
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@stderr = global i32 0
@.str = [21 x i8] c"select returned %d.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @STDIN_FILENO
%4 = tail call i32 @input_timeout(i32 %3, i32 5)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
%7 = icmp ne i32 %4, 1
%8 = zext i1 %7 to i32
ret i32 %8
}
unsigned int f73(unsigned int x, int y) {
  return (x << y) + (x >> (8 * sizeof(unsigned int) - y));
}


x86 assembly (clang, -O0):
<f73>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
movslq -0x8(%rbp),%rsi
mov    $0x20,%ecx
sub    %rsi,%rcx
shr    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f73>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f73(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = sub i64 32, %10
%12 = trunc i64 %11 to i32
%13 = lshr i32 %8, %12
%14 = add i32 %7, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f73(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 32, %1
%5 = lshr i32 %0, %4
%6 = add i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int sblib_proc_getname(int index, char *proc_name) {
  switch (index) {
  case 0:
    strcpy(proc_name, "LIBTEST");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sblib_proc_getname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
test   %eax,%eax
jne    114b <sblib_proc_getname+0x3b>
jmp    112f <sblib_proc_getname+0x1f>
mov    -0x10(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <strcpy@plt>
movl   $0x1,-0x4(%rbp)
jmp    1152 <sblib_proc_getname+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sblib_proc_getname>:
xor    %eax,%eax
test   %edi,%edi
je     1117 <sblib_proc_getname+0x7>
ret
push   %rax
lea    0xee1(%rip),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"LIBTEST\00"
define i32 @sblib_proc_getname(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
switch i32 %6, label %10 [
i32 0, label %7
]
7: ; preds = %2
%8 = load i8*, i8** %5
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %11
10: ; preds = %2
store i32 0, i32* %3
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [8 x i8] c"LIBTEST\00"
define i32 @sblib_proc_getname(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %7
}