xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void print_number(int *myInt) {
  assert(myInt != NULL);
  printf("%d\n", *myInt);
}


x86 assembly (clang, -O0):
<print_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_number>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    (%rbx),%esi
lea    0xec5(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @print_number(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_number(i32* %0) {
%2 = icmp ne i32* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i32, i32* %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_pixel(int, int, int /*<<< orphan*/);
void clear_screen() {
  int x, y;
  for (x = 0; x < 320; x++) {
    for (y = 0; y < 240; y++) {
      write_pixel(x, y, 0);
    }
  }
}


x86 assembly (clang, -O0):
<clear_screen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x140,-0x4(%rbp)
jge    116e <clear_screen+0x5e>
movl   $0x0,-0x8(%rbp)
cmpl   $0xf0,-0x8(%rbp)
jge    115b <clear_screen+0x4b>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1030 <write_pixel@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <clear_screen+0x23>
jmp    1160 <clear_screen+0x50>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <clear_screen+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_screen>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
mov    %ebp,%esi
xor    %edx,%edx
call   1030 <write_pixel@plt>
add    $0x1,%ebp
cmp    $0xf0,%ebp
jne    1130 <clear_screen+0x20>
add    $0x1,%ebx
cmp    $0x140,%ebx
jne    1120 <clear_screen+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @clear_screen() {
br label %1
1: ; preds = %0, %8
%2 = phi i32 [ 0, %0 ], [ %9, %8 ]
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %6, %3 ]
%5 = tail call i32 @write_pixel(i32 %2, i32 %4, i32 0)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 240
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = add nuw nsw i32 %2, 1
%10 = icmp eq i32 %9, 320
br i1 %10, label %11, label %1
11: ; preds = %8
ret void
}
int i2a(char *dest, unsigned int x) {
  int div = 10;
  *dest++ = x / div + '0';
  *dest++ = x % div + '0';
  *dest++ = '\0';
  return 2;
}


x86 assembly (clang, -O0):
<i2a>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    %edx,%edx
divl   -0x10(%rbp)
add    $0x30,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
xor    %edx,%edx
divl   -0x10(%rbp)
add    $0x30,%edx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2a>:
mov    %esi,%eax
mov    $0xcccccccd,%ecx
imul   %rax,%rcx
shr    $0x23,%rcx
lea    0x30(%rcx),%eax
mov    %al,(%rdi)
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%eax
sub    %eax,%esi
or     $0x30,%sil
mov    %sil,0x1(%rdi)
movb   $0x0,0x2(%rdi)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @i2a(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 10, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = udiv i32 %6, %7
%9 = add i32 %8, 48
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
store i8 %10, i8* %11
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = urem i32 %13, %14
%16 = add i32 %15, 48
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
store i8 %17, i8* %18
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %3
store i8 0, i8* %20
ret i32 2
}

LLVM IR (-O2):
define i32 @i2a(i8* nocapture writeonly %0, i32 %1) {
%3 = udiv i32 %1, 10
%4 = trunc i32 %3 to i8
%5 = add i8 %4, 48
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %0
%7 = urem i32 %1, 10
%8 = trunc i32 %7 to i8
%9 = or i8 %8, 48
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %6
store i8 0, i8* %10
ret i32 2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int HadTu_hdrLen();
size_t HadTu_hdrSize(void) { return HadTu_hdrLen() * sizeof(uint32_t); }


x86 assembly (clang, -O0):
<HadTu_hdrSize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <HadTu_hdrLen@plt>
cltq
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HadTu_hdrSize>:
push   %rax
xor    %eax,%eax
call   1030 <HadTu_hdrLen@plt>
cltq
shl    $0x2,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @HadTu_hdrSize() {
%1 = call i32 (...) @HadTu_hdrLen()
%2 = sext i32 %1 to i64
%3 = mul i64 %2, 4
ret i64 %3
}

LLVM IR (-O2):
define i64 @HadTu_hdrSize() {
%1 = tail call i32 (...) @HadTu_hdrLen()
%2 = sext i32 %1 to i64
%3 = shl nsw i64 %2, 2
ret i64 %3
}
int test_imm_B3uint16_reg(unsigned short val) {
  return ((val) & (0xB3 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B3uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 179
%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_B3uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 179
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *);
main() { foo("hello"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 @foo(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void X509_check_ca(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_check_ca() {
ret void
}
void NoSoundDrv_PCM_Unlock(void) {}


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

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

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

LLVM IR (-O2):
define void @NoSoundDrv_PCM_Unlock() {
ret void
}
int intGq(const void *i1, const void *i2) {
  return (*((int *)i1) >= *((int *)i2));
  ;
}


x86 assembly (clang, -O0):
<intGq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intGq>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setge  %al
ret

LLVM IR (-O0):
define i32 @intGq(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp sge i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @intGq(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sge i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int test_bitOr(int x, int y) { return x | y; }


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

x86 assembly (clang, -O2):
<test_bitOr>:
mov    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @test_bitOr(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 = or i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_bitOr(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void print_color_test(void) { abort(); }


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

x86 assembly (clang, -O2):
<print_color_test>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @print_color_test() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @print_color_test() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
double arcsinh(int);
double arccsch(double n) { return arcsinh(1 / n); }


x86 assembly (clang, -O0):
<arccsch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <arcsinh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arccsch>:
movsd  0xee8(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
jmp    1030 <arcsinh@plt>

LLVM IR (-O0):
define double @arccsch(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
%5 = fptosi double %4 to i32
%6 = call double @arcsinh(i32 %5)
ret double %6
}

LLVM IR (-O2):
define double @arccsch(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = fptosi double %2 to i32
%4 = tail call double @arcsinh(i32 %3)
ret double %4
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ hashlittle2(char const *, size_t, int *, int *);
u_int32_t memhash32(const char *buf, size_t n) {
  u_int32_t c = 0xcafe8881, b = 0x4d6a087c;
  hashlittle2(buf, n, &c, &b);
  return c;
}


x86 assembly (clang, -O0):
<memhash32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xcafe8881,-0x14(%rbp)
movl   $0x4d6a087c,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1030 <hashlittle2@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memhash32>:
push   %rax
movl   $0xcafe8881,(%rsp)
movl   $0x4d6a087c,0x4(%rsp)
4d
mov    %rsp,%rdx
lea    0x4(%rsp),%rcx
call   1030 <hashlittle2@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @memhash32(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
store i32 -889288575, i32* %5
store i32 1298794620, i32* %6
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i32 @hashlittle2(i8* %7, i64 %8, i32* %5, i32* %6)
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @memhash32(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 -889288575, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 1298794620, i32* %4
%7 = call i32 @hashlittle2(i8* %0, i64 %1, i32* %3, i32* %4)
%8 = load i32, i32* %3
ret i32 %8
}
void write_mxcsr(unsigned long long val) {
  asm volatile("ldmxcsr %0" ::"m"(val));
}


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

x86 assembly (clang, -O2):
<write_mxcsr>:
mov    %rdi,-0x8(%rsp)
ldmxcsr -0x8(%rsp)
ret

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

LLVM IR (-O2):
define void @write_mxcsr(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret void
}
/* Variables and functions */
double const pow(double, int);
double berechne_oberflaeche_kugel_mit_durchmesser(double durchmesser) {
  const double pi = 3.141592654;
  double oberflaeche = pow(durchmesser, 2) * pi;
  return oberflaeche;
}


x86 assembly (clang, -O0):
<berechne_oberflaeche_kugel_mit_durchmesser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  0xebf(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<berechne_oberflaeche_kugel_mit_durchmesser>:
push   %rax
mov    $0x2,%edi
call   1030 <pow@plt>
mulsd  0xedd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @berechne_oberflaeche_kugel_mit_durchmesser(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 0x400921FB54524550, double* %3
%5 = load double, double* %2
%6 = call double @pow(double %5, i32 2)
%7 = fmul double %6, 0x400921FB54524550
store double %7, double* %4
%8 = load double, double* %4
ret double %8
}

LLVM IR (-O2):
define double @berechne_oberflaeche_kugel_mit_durchmesser(double %0) {
%2 = tail call double @pow(double %0, i32 2)
%3 = fmul double %2, 0x400921FB54524550
ret double %3
}
void intr(dummy) int dummy __attribute__((__unused__));
{
  showstats(1);
  exit(0);
}


x86 assembly (clang, -O0):
<intr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <showstats@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<intr>:
push   %rax
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <showstats@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @intr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @showstats to i32 (i32, ...)*)(i32 1)
unreachable
}

LLVM IR (-O2):
define void @intr(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @showstats to i32 (i32, ...)*)(i32 1)
tail call void @exit(i32 0)
unreachable
}
/* Variables and functions */
int partition(int *, int, int);
void quicksort(int *array, int left, int right) {
  int j;
  if (left < right) {
    j = partition(array, left, right);
    quicksort(array, left, (j - 1));
    quicksort(array, (j + 1), right);
  }
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quicksort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quicksort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quicksort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quicksort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int assign_val();
int main() {
  int card_val = assign_val();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @assign_val()
ret i32 0
}
/* Variables and functions */
unsigned int rand();
unsigned int GEN_rand() { return rand(); }


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

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

LLVM IR (-O0):
define i32 @GEN_rand() {
%1 = call i32 (...) @rand()
ret i32 %1
}

LLVM IR (-O2):
define i32 @GEN_rand() {
%1 = tail call i32 (...) @rand()
ret i32 %1
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
extern void *calloc(size_t nmemb, size_t size) {
  void *ret;
  size *= nmemb;
  if (!size)
    return NULL;
  ret = malloc(size);
  memset(ret, 0, size);
  return ret;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1155 <calloc+0x35>
movq   $0x0,-0x8(%rbp)
jmp    1179 <calloc+0x59>
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
test   %rbx,%rbx
je     114a <calloc+0x2a>
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
jmp    114d <calloc+0x2d>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i8* @malloc(i64 %3)
%7 = tail call i32 @memset(i8* %6, i32 0, i64 %3)
br label %8
8: ; preds = %2, %5
%9 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %9
}
void Copy() {
  int i;
  short x[64] = {0};
  short y[64];
  for (i = 0; i < 64; i++) {
    x[i] = i;
  }
  for (i = 0; i < 128; i++) {
    y[i] = x[i];
  }
}


x86 assembly (clang, -O0):
<Copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jge    115f <Copy+0x4f>
mov    -0x4(%rbp),%eax
mov    %ax,%cx
movslq -0x4(%rbp),%rax
mov    %cx,-0x90(%rbp,%rax,2)
ff
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <Copy+0x25>
movl   $0x0,-0x4(%rbp)
cmpl   $0x80,-0x4(%rbp)
jge    1199 <Copy+0x89>
movslq -0x4(%rbp),%rax
mov    -0x90(%rbp,%rax,2),%cx
ff
movslq -0x4(%rbp),%rax
mov    %cx,-0x110(%rbp,%rax,2)
ff
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <Copy+0x56>
add    $0x110,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Copy() {
%1 = alloca i32
%2 = alloca [64 x i16]
%3 = alloca [64 x i16]
%4 = bitcast [64 x i16]* %2 to i8*
store i32 0, i32* %1
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 64
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %1
%10 = trunc i32 %9 to i16
%11 = load i32, i32* %1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [64 x i16], [64 x i16]* %2, i64 0, i64 %12
store i16 %10, i16* %13
br label %14
14: ; preds = %8
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %5
17: ; preds = %5
store i32 0, i32* %1
br label %18
18: ; preds = %29, %17
%19 = load i32, i32* %1
%20 = icmp slt i32 %19, 128
br i1 %20, label %21, label %32
21: ; preds = %18
%22 = load i32, i32* %1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [64 x i16], [64 x i16]* %2, i64 0, i64 %23
%25 = load i16, i16* %24
%26 = load i32, i32* %1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [64 x i16], [64 x i16]* %3, i64 0, i64 %27
store i16 %25, i16* %28
br label %29
29: ; preds = %21
%30 = load i32, i32* %1
%31 = add nsw i32 %30, 1
store i32 %31, i32* %1
br label %18
32: ; preds = %18
ret void
}

LLVM IR (-O2):
define void @Copy() {
ret void
}
float SymwExtension(const float *Src, int Stride, int N, int n) {
  while (1) {
    if (n < 0)
      n = -n;
    else if (n >= N)
      n = 2 * (N - 1) - n;
    else
      break;
  }
  return Src[Stride * n];
}


x86 assembly (clang, -O0):
<SymwExtension>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1128 <SymwExtension+0x28>
xor    %eax,%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1152 <SymwExtension+0x52>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1148 <SymwExtension+0x48>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
shl    $0x1,%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    114d <SymwExtension+0x4d>
jmp    1157 <SymwExtension+0x57>
jmp    1152 <SymwExtension+0x52>
jmp    1111 <SymwExtension+0x11>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SymwExtension>:
lea    (%rdx,%rdx,1),%r8d
add    $0xfffffffe,%r8d
jmp    1116 <SymwExtension+0x16>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,%ecx
test   %ecx,%ecx
js     1110 <SymwExtension+0x10>
mov    %r8d,%eax
cmp    %edx,%ecx
jge    1112 <SymwExtension+0x12>
imul   %esi,%ecx
movslq %ecx,%rax
movss  (%rdi,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @SymwExtension(float* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca float*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store float* %0, float** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
br label %9
9: ; preds = %4, %27
%10 = load i32, i32* %8
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %8
%14 = sub nsw i32 0, %13
store i32 %14, i32* %8
br label %27
15: ; preds = %9
%16 = load i32, i32* %8
%17 = load i32, i32* %7
%18 = icmp sge i32 %16, %17
br i1 %18, label %19, label %25
19: ; preds = %15
%20 = load i32, i32* %7
%21 = sub nsw i32 %20, 1
%22 = mul nsw i32 2, %21
%23 = load i32, i32* %8
%24 = sub nsw i32 %22, %23
store i32 %24, i32* %8
br label %26
25: ; preds = %15
br label %28
26: ; preds = %19
br label %27
27: ; preds = %26, %12
br label %9
28: ; preds = %25
%29 = load float*, float** %5
%30 = load i32, i32* %6
%31 = load i32, i32* %8
%32 = mul nsw i32 %30, %31
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds float, float* %29, i64 %33
%35 = load float, float* %34
ret float %35
}

LLVM IR (-O2):
define float @SymwExtension(float* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %2, 1
%6 = add i32 %5, -2
br label %7
7: ; preds = %4, %12
%8 = phi i32 [ %3, %4 ], [ %14, %12 ]
%9 = icmp slt i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = icmp slt i32 %8, %2
br i1 %11, label %15, label %12
12: ; preds = %10, %7
%13 = phi i32 [ 0, %7 ], [ %6, %10 ]
%14 = sub nsw i32 %13, %8
br label %7
15: ; preds = %10
%16 = mul nsw i32 %8, %1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float, float* %0, i64 %17
%19 = load float, float* %18
ret float %19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
void myprintf(char *fmt, int value) {
  printf(fmt, value);
  putchar(' ');
}


x86 assembly (clang, -O0):
<myprintf>:
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   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myprintf>:
push   %rax
call   1040 <printf@plt>
mov    $0x20,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @myprintf(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 @printf(i8* %5, i32 %6)
%8 = call i32 @putchar(i8 signext 32)
ret void
}

LLVM IR (-O2):
define void @myprintf(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* %0, i32 %1)
%4 = tail call i32 @putchar(i8 signext 32)
ret void
}
/* Variables and functions */
long long PAPI_get_real_usec();
void papif_get_real_usec(long long *time) { *time = PAPI_get_real_usec(); }


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

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

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

LLVM IR (-O2):
define void @papif_get_real_usec(i64* nocapture writeonly %0) {
%2 = tail call i64 (...) @PAPI_get_real_usec()
store i64 %2, i64* %0
ret void
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
int getdelimiterpos(uint8_t *in_buf, char delimiter) {
  int c = 0;
  while (in_buf[c] != 0) {
    if (in_buf[c] == delimiter)
      return c;
    c++;
  }
  return c;
}


x86 assembly (clang, -O0):
<getdelimiterpos>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115b <getdelimiterpos+0x5b>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    114d <getdelimiterpos+0x4d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <getdelimiterpos+0x61>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <getdelimiterpos+0x15>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getdelimiterpos(i8* %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 0, i32* %6
br label %7
7: ; preds = %27, %2
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %30
15: ; preds = %7
%16 = load i8*, i8** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = load i8, i8* %5
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %21, %23
br i1 %24, label %25, label %27
25: ; preds = %15
%26 = load i32, i32* %6
store i32 %26, i32* %3
br label %32
27: ; preds = %15
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %7
30: ; preds = %7
%31 = load i32, i32* %6
store i32 %31, i32* %3
br label %32
32: ; preds = %30, %25
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @getdelimiterpos(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %10, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = icmp eq i8 %6, %1
%9 = or i1 %7, %8
%10 = add nuw i64 %4, 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = trunc i64 %4 to i32
ret i32 %12
}
/* Type definitions */
struct forth_instance {
  int dummy;
};

/* Variables and functions */
intptr_t st_pop(struct forth_instance *);
void store(struct forth_instance *fi) {
  intptr_t *tp;
  tp = (intptr_t *)st_pop(fi);
  tp[0] = st_pop(fi);
}


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

x86 assembly (clang, -O2):
<store>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <st_pop@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <st_pop@plt>
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.forth_instance = type { i32 }
define void @store(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
%3 = alloca i64*
store %struct.forth_instance* %0, %struct.forth_instance** %2
%4 = load %struct.forth_instance*, %struct.forth_instance** %2
%5 = call i64 @st_pop(%struct.forth_instance* %4)
%6 = inttoptr i64 %5 to i64*
store i64* %6, i64** %3
%7 = load %struct.forth_instance*, %struct.forth_instance** %2
%8 = call i64 @st_pop(%struct.forth_instance* %7)
%9 = load i64*, i64** %3
%10 = getelementptr inbounds i64, i64* %9, i64 0
store i64 %8, i64* %10
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type { i32 }
define void @store(%struct.forth_instance* %0) {
%2 = tail call i64 @st_pop(%struct.forth_instance* %0)
%3 = inttoptr i64 %2 to i64*
%4 = tail call i64 @st_pop(%struct.forth_instance* %0)
store i64 %4, i64* %3
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int equal_string(void *a, void *b) {
  char *aa, *bb;
  aa = (char *)a;
  bb = (char *)b;
  return strcmp(aa, bb) == 0;
}


x86 assembly (clang, -O0):
<equal_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
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),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @equal_string(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i64 @strcmp(i8* %9, i8* %10)
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @equal_string(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int main(void) {
  char our_string[] = "Halli Hallo";
  int index = 0;
  while (our_string[index] != '\0') {
    index += 1;
  }
  printf("'%s' is %d char(s) long!\n", our_string, index);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
movsbl -0x10(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     115a <main+0x4a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113a <main+0x2a>
lea    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x614820696c6c6148,%rax
20 48 61
mov    %rax,0x8(%rsp)
movl   $0x6f6c6c,0x10(%rsp)
xor    %edx,%edx
nopl   (%rax)
cmpb   $0x0,0x9(%rsp,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1130 <main+0x20>
lea    0xeca(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.our_string = [12 x i8] c"Halli Hallo\00"
@.str = [26 x i8] c"'%s' is %d char(s) long!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [12 x i8]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %12, %0
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %5
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
%16 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%17 = load i32, i32* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %16, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@__const.main.our_string = [12 x i8] c"Halli Hallo\00"
@.str = [26 x i8] c"'%s' is %d char(s) long!\0A\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %3
%4 = phi i64 [ 1, %0 ], [ %8, %3 ]
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %10)
ret i32 0
}
unsigned char Hex2Char(char hex_upper, char hex_lower) {
  char result_char;
  result_char =
      (hex_upper >= 'A' ? ((hex_upper & 0xdf) - 'A') + 10 : (hex_upper - '0'));
  result_char *= 16;
  result_char +=
      (hex_lower >= 'A' ? ((hex_lower & 0xdf) - 'A') + 10 : (hex_lower - '0'));
  return result_char;
}


x86 assembly (clang, -O0):
<Hex2Char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1134 <Hex2Char+0x34>
movsbl -0x1(%rbp),%eax
and    $0xdf,%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <Hex2Char+0x3e>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
shl    $0x4,%eax
mov    %al,-0x3(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1172 <Hex2Char+0x72>
movsbl -0x2(%rbp),%eax
and    $0xdf,%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
jmp    117c <Hex2Char+0x7c>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
movsbl -0x3(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Hex2Char>:
mov    %esi,%eax
and    $0xdf,%al
add    $0xc9,%al
lea    -0x30(%rsi),%ecx
cmp    $0x41,%sil
movzbl %cl,%ecx
movzbl %al,%edx
cmovl  %ecx,%edx
mov    %edi,%eax
shl    $0x4,%al
lea    -0x70(%rax),%ecx
cmp    $0x41,%dil
movzbl %al,%esi
movzbl %cl,%eax
cmovl  %esi,%eax
add    %dl,%al
ret

LLVM IR (-O0):
define zeroext i8 @Hex2Char(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 65
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = and i32 %11, 223
%13 = sub nsw i32 %12, 65
%14 = add nsw i32 %13, 10
br label %19
15: ; preds = %2
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = sub nsw i32 %17, 48
br label %19
19: ; preds = %15, %9
%20 = phi i32 [ %14, %9 ], [ %18, %15 ]
%21 = trunc i32 %20 to i8
store i8 %21, i8* %5
%22 = load i8, i8* %5
%23 = sext i8 %22 to i32
%24 = mul nsw i32 %23, 16
%25 = trunc i32 %24 to i8
store i8 %25, i8* %5
%26 = load i8, i8* %4
%27 = sext i8 %26 to i32
%28 = icmp sge i32 %27, 65
br i1 %28, label %29, label %35
29: ; preds = %19
%30 = load i8, i8* %4
%31 = sext i8 %30 to i32
%32 = and i32 %31, 223
%33 = sub nsw i32 %32, 65
%34 = add nsw i32 %33, 10
br label %39
35: ; preds = %19
%36 = load i8, i8* %4
%37 = sext i8 %36 to i32
%38 = sub nsw i32 %37, 48
br label %39
39: ; preds = %35, %29
%40 = phi i32 [ %34, %29 ], [ %38, %35 ]
%41 = load i8, i8* %5
%42 = sext i8 %41 to i32
%43 = add nsw i32 %42, %40
%44 = trunc i32 %43 to i8
store i8 %44, i8* %5
%45 = load i8, i8* %5
ret i8 %45
}

LLVM IR (-O2):
define zeroext i8 @Hex2Char(i8 signext %0, i8 signext %1) {
%3 = icmp sgt i8 %0, 64
%4 = icmp sgt i8 %1, 64
%5 = and i8 %1, -33
%6 = add i8 %5, -55
%7 = add i8 %1, -48
%8 = select i1 %4, i8 %6, i8 %7
%9 = shl i8 %0, 4
%10 = add i8 %9, -112
%11 = select i1 %3, i8 %10, i8 %9
%12 = add i8 %8, %11
ret i8 %12
}
int mklower(ch)
int ch;
{
  if (isascii(ch) && isupper(ch))
    return (tolower(ch));
  return (ch);
}


x86 assembly (clang, -O0):
<mklower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1050 <isascii@plt>
cmp    $0x0,%eax
je     116f <mklower+0x3f>
mov    -0x8(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%eax
je     116f <mklower+0x3f>
mov    -0x8(%rbp),%edi
call   1030 <tolower@plt>
mov    %eax,-0x4(%rbp)
jmp    1175 <mklower+0x45>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mklower>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <isascii@plt>
test   %eax,%eax
je     1151 <mklower+0x21>
mov    %ebx,%edi
call   1040 <isupper@plt>
test   %eax,%eax
je     1151 <mklower+0x21>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <tolower@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @mklower(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @isascii to i32 (i32, ...)*)(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @isupper(i32 %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @tolower(i32 %0)
br label %9
9: ; preds = %1, %4, %7
%10 = phi i32 [ %8, %7 ], [ %0, %4 ], [ %0, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_AVTransport_Next(void *);
int /*<<< orphan*/ printf(char *, unsigned int);
void UPnPAVTransport_Next(void *upnptoken, unsigned int InstanceID) {
  printf("Invoke: UPnPAVTransport_Next(%u);\r\n", InstanceID);
  UPnPResponse_AVTransport_Next(upnptoken);
}


x86 assembly (clang, -O0):
<UPnPAVTransport_Next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UPnPResponse_AVTransport_Next@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [36 x i8] c"Invoke: UPnPAVTransport_Next(%u);\0D\0A\00"
define void @UPnPAVTransport_Next(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @UPnPResponse_AVTransport_Next(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Invoke: UPnPAVTransport_Next(%u);\0D\0A\00"
define void @UPnPAVTransport_Next(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UPnPResponse_AVTransport_Next(i8* %0)
ret void
}
/* Variables and functions */
int listen(int, int);
int ilisten(int sock, int count) { return listen(sock, count); }


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

x86 assembly (clang, -O2):
<ilisten>:
jmp    1030 <listen@plt>

LLVM IR (-O0):
define i32 @ilisten(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 @listen(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ilisten(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ chk_flg_resize_map();
long get_screen_row();
long get_screen_size_message();
scalar_t__ get_stat_bar_row();
long get_message_row(void) {
  if (chk_flg_resize_map()) {
    return get_screen_size_message();
  } else {
    long n;
    n = get_screen_row();
    n -= 20 + 1;
    n -= get_stat_bar_row();
    return n;
  }
  return 1;
}


x86 assembly (clang, -O0):
<get_message_row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <chk_flg_resize_map@plt>
cmp    $0x0,%rax
je     1169 <get_message_row+0x29>
mov    $0x0,%al
call   1040 <get_screen_size_message@plt>
mov    %rax,-0x8(%rbp)
jmp    119d <get_message_row+0x5d>
mov    $0x0,%al
call   1030 <get_screen_row@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x15,%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <get_stat_bar_row@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_message_row>:
push   %rbx
xor    %eax,%eax
call   1050 <chk_flg_resize_map@plt>
test   %rax,%rax
je     1155 <get_message_row+0x15>
xor    %eax,%eax
pop    %rbx
jmp    1040 <get_screen_size_message@plt>
xor    %eax,%eax
call   1030 <get_screen_row@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <get_stat_bar_row@plt>
sub    %rax,%rbx
add    $0xffffffffffffffeb,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @get_message_row() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @chk_flg_resize_map()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i64 (...) @get_screen_size_message()
store i64 %6, i64* %1
br label %15
7: ; preds = %0
%8 = call i64 (...) @get_screen_row()
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = sub nsw i64 %9, 21
store i64 %10, i64* %2
%11 = call i64 (...) @get_stat_bar_row()
%12 = load i64, i64* %2
%13 = sub nsw i64 %12, %11
store i64 %13, i64* %2
%14 = load i64, i64* %2
store i64 %14, i64* %1
br label %15
15: ; preds = %7, %5
%16 = load i64, i64* %1
ret i64 %16
}

LLVM IR (-O2):
define i64 @get_message_row() {
%1 = tail call i64 (...) @chk_flg_resize_map()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i64 (...) @get_screen_size_message()
br label %10
5: ; preds = %0
%6 = tail call i64 (...) @get_screen_row()
%7 = add nsw i64 %6, -21
%8 = tail call i64 (...) @get_stat_bar_row()
%9 = sub i64 %7, %8
br label %10
10: ; preds = %5, %3
%11 = phi i64 [ %4, %3 ], [ %9, %5 ]
ret i64 %11
}