xunge/DecIR huggingface dataset:
/* Type definitions */
typedef double clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
double clock();
int /*<<< orphan*/ int_bubble_sort_1(int *, int);
double messe_int_bubble_sort_1(int array[], int laenge) {
  clock_t start = clock();
  int_bubble_sort_1(array, laenge);
  clock_t stop = clock();
  return (stop - start) / (1.0 * CLOCKS_PER_SEC);
}


x86 assembly (clang, -O0):
<messe_int_bubble_sort_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <int_bubble_sort_1@plt>
mov    $0x0,%al
call   1030 <clock@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xe9b(%rip),%xmm1
mov    0x2e7c(%rip),%rax
mulsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<messe_int_bubble_sort_1>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <clock@plt>
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <int_bubble_sort_1@plt>
xor    %eax,%eax
call   1030 <clock@plt>
subsd  (%rsp),%xmm0
mov    0x2e97(%rip),%rax
divsd  (%rax),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @messe_int_bubble_sort_1(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = call double (...) @clock()
store double %7, double* %5
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = call i32 @int_bubble_sort_1(i32* %8, i32 %9)
%11 = call double (...) @clock()
store double %11, double* %6
%12 = load double, double* %6
%13 = load double, double* %5
%14 = fsub double %12, %13
%15 = load double, double* @CLOCKS_PER_SEC
%16 = fmul double 1.000000e+00, %15
%17 = fdiv double %14, %16
ret double %17
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @messe_int_bubble_sort_1(i32* %0, i32 %1) {
%3 = tail call double (...) @clock()
%4 = tail call i32 @int_bubble_sort_1(i32* %0, i32 %1)
%5 = tail call double (...) @clock()
%6 = fsub double %5, %3
%7 = load double, double* @CLOCKS_PER_SEC
%8 = fdiv double %6, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ lgen(char *, char *, int);
void cgldsw(int n) { lgen("%s\t%c%d,%%rax", "movq", n); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"%s\09%c%d,%%rax\00"
@.str.1 = [5 x i8] c"movq\00"
define void @cgldsw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @lgen(i8* getelementptr inbounds ([14 x i8], [14 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 = [14 x i8] c"%s\09%c%d,%%rax\00"
@.str.1 = [5 x i8] c"movq\00"
define void @cgldsw(i32 %0) {
%2 = tail call i32 @lgen(i8* getelementptr inbounds ([14 x i8], [14 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
}
/* Type definitions */
struct Data {
  int i_;
  float f_;
  unsigned char *str;
};
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  union Data {
    int i_;
    float f_;
    unsigned char str[20];
  } data;
  printf("size = %d\n", sizeof(data));
  data.i_ = 10;
  data.f_ = 220.5;
  printf("data.i_ = %d\n", data.i_);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xede(%rip),%rdi
mov    $0x14,%esi
call   1030 <printf@plt>
movl   $0xa,-0x18(%rbp)
movss  0xec1(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x14,%esi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x435c8000,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%union.Data = type { i32, [16 x i8] }
@.str = [11 x i8] c"size = %d\0A\00"
@.str.1 = [14 x i8] c"data.i_ = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.Data
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 20)
%4 = bitcast %union.Data* %2 to i32*
store i32 10, i32* %4
%5 = bitcast %union.Data* %2 to float*
store float 2.205000e+02, float* %5
%6 = bitcast %union.Data* %2 to i32*
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"size = %d\0A\00"
@.str.1 = [14 x i8] c"data.i_ = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 1130135552)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ echo();
int /*<<< orphan*/ *initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/ *, int /*<<< orphan*/);
void init_screen(WINDOW **s) {
  *s = initscr();
  cbreak();
  echo();
  keypad(*s, TRUE);
}


x86 assembly (clang, -O0):
<init_screen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1060 <initscr@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1040 <cbreak@plt>
mov    $0x0,%al
call   1030 <echo@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    0x2e6f(%rip),%rax
mov    (%rax),%esi
call   1050 <keypad@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_screen>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <initscr@plt>
mov    %rax,(%rbx)
xor    %eax,%eax
call   1040 <cbreak@plt>
xor    %eax,%eax
call   1030 <echo@plt>
mov    (%rbx),%rdi
mov    0x2e82(%rip),%rax
mov    (%rax),%esi
pop    %rbx
jmp    1050 <keypad@plt>

LLVM IR (-O0):
@TRUE = global i32 0
define void @init_screen(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = call i32* (...) @initscr()
%4 = load i32**, i32*** %2
store i32* %3, i32** %4
%5 = call i32 (...) @cbreak()
%6 = call i32 (...) @echo()
%7 = load i32**, i32*** %2
%8 = load i32*, i32** %7
%9 = load i32, i32* @TRUE
%10 = call i32 @keypad(i32* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@TRUE = global i32 0
define void @init_screen(i32** nocapture %0) {
%2 = tail call i32* (...) @initscr()
store i32* %2, i32** %0
%3 = tail call i32 (...) @cbreak()
%4 = tail call i32 (...) @echo()
%5 = load i32*, i32** %0
%6 = load i32, i32* @TRUE
%7 = tail call i32 @keypad(i32* %5, i32 %6)
ret void
}
/* Variables and functions */
float sin(float);
float BackEaseIn(float p) {
  return p * p * p - p * sin(p * 3.14159265358979323846);
}


x86 assembly (clang, -O0):
<BackEaseIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeaf(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <sin@plt>
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movaps %xmm0,%xmm3
movss  -0x8(%rbp),%xmm0
mulss  %xmm3,%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BackEaseIn>:
push   %rax
movss  %xmm0,(%rsp)
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
mulsd  0xece(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
call   1030 <sin@plt>
movss  (%rsp),%xmm2
mulss  %xmm2,%xmm0
movss  0x4(%rsp),%xmm1
mulss  %xmm2,%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @BackEaseIn(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = load float, float* %2
%7 = load float, float* %2
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = fmul double %9, 0x400921FB54442D18
%11 = fptrunc double %10 to float
%12 = call float @sin(float %11)
%13 = fmul float %7, %12
%14 = fneg float %13
%15 = call float @llvm.fmuladd.f32(float %5, float %6, float %14)
ret float %15
}

LLVM IR (-O2):
define float @BackEaseIn(float %0) {
%2 = fmul float %0, %0
%3 = fpext float %0 to double
%4 = fmul double %3, 0x400921FB54442D18
%5 = fptrunc double %4 to float
%6 = tail call float @sin(float %5)
%7 = fneg float %6
%8 = fmul float %7, %0
%9 = tail call float @llvm.fmuladd.f32(float %2, float %0, float %8)
ret float %9
}
void chipInit(void) {}


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

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

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

LLVM IR (-O2):
define void @chipInit() {
ret void
}
/* Variables and functions */
int _xhasher(char const *);
int str_hash_code(const char *s) { return _xhasher(s); }


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

x86 assembly (clang, -O2):
<str_hash_code>:
jmp    1030 <_xhasher@plt>

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

LLVM IR (-O2):
define i32 @str_hash_code(i8* %0) {
%2 = tail call i32 @_xhasher(i8* %0)
ret i32 %2
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ assert(int);
int errno;
int puts(char *);
int main() {
  int ret;
  ret = puts("hello world 1");
  assert(ret == EOF);
  ret = puts("hello world 2");
  assert(ret == EOF);
  return errno;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ea0(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2e78(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eb4(%rip),%rbx
xor    %edi,%edi
cmp    (%rbx),%eax
sete   %dil
call   1040 <assert@plt>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
cmp    (%rbx),%eax
sete   %dil
call   1040 <assert@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"hello world 1\00"
@EOF = global i32 0
@.str.1 = [14 x i8] c"hello world 2\00"
@errno = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* @errno
ret i32 %15
}

LLVM IR (-O2):
@.str = [14 x i8] c"hello world 1\00"
@EOF = global i32 0
@.str.1 = [14 x i8] c"hello world 2\00"
@errno = global i32 0
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @EOF
%8 = icmp eq i32 %6, %7
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = load i32, i32* @errno
ret i32 %11
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int UINT16(void const *const);
uint16_t DVB_LENGTH(const void *const ptr) { return UINT16(ptr) & 0x0fff; }


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

x86 assembly (clang, -O2):
<DVB_LENGTH>:
push   %rax
call   1030 <UINT16@plt>
and    $0xfff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @DVB_LENGTH(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @UINT16(i8* %3)
%5 = and i32 %4, 4095
ret i32 %5
}

LLVM IR (-O2):
define i32 @DVB_LENGTH(i8* %0) {
%2 = tail call i32 @UINT16(i8* %0)
%3 = and i32 %2, 4095
ret i32 %3
}
int test1(int a, int b) { return (a < b || a == b); }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
cmp    -0x8(%rbp),%ecx
mov    %al,-0x9(%rbp)
jl     1127 <test1+0x27>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
xor    %eax,%eax
cmp    %esi,%edi
setle  %al
ret

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

LLVM IR (-O2):
define i32 @test1(i32 %0, i32 %1) {
%3 = icmp sle i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void setCookie(char name[], char content[]) {
  if (name == NULL || content == NULL) {
    return;
  } else {
    printf("Set-Cookie: %s=%s\n", name, content);
  }
}


x86 assembly (clang, -O0):
<setCookie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1136 <setCookie+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    113b <setCookie+0x2b>
jmp    114f <setCookie+0x3f>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setCookie>:
test   %rdi,%rdi
je     112c <setCookie+0x1c>
mov    %rsi,%rdx
test   %rsi,%rsi
je     112c <setCookie+0x1c>
mov    %rdi,%rsi
lea    0xed9(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Set-Cookie: %s=%s\0A\00"
define void @setCookie(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 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %7, %2
br label %15
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
br label %15
15: ; preds = %10, %11
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Set-Cookie: %s=%s\0A\00"
define void @setCookie(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %8
8: ; preds = %2, %6
ret void
}
/* Variables and functions */
scalar_t__ check_ok_packet();
int /*<<< orphan*/ parse_error_packet();
int /*<<< orphan*/ read_packet();
int clear_ok_packet() {
  int num = 0;
  do {
    num = 1;
    if (num > 0) {
      read_packet();
      if (check_ok_packet() != 0) {
        parse_error_packet();
        return 0;
      }
    }
  } while (num > 0);
  return 1;
}


x86 assembly (clang, -O0):
<clear_ok_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1180 <clear_ok_packet+0x50>
mov    $0x0,%al
call   1040 <read_packet@plt>
mov    $0x0,%al
call   1050 <check_ok_packet@plt>
cmp    $0x0,%rax
je     117b <clear_ok_packet+0x4b>
mov    $0x0,%al
call   1030 <parse_error_packet@plt>
movl   $0x0,-0x4(%rbp)
jmp    1196 <clear_ok_packet+0x66>
jmp    1180 <clear_ok_packet+0x50>
jmp    1185 <clear_ok_packet+0x55>
cmpl   $0x0,-0x8(%rbp)
jg     113f <clear_ok_packet+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_ok_packet>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <read_packet@plt>
xor    %eax,%eax
call   1050 <check_ok_packet@plt>
test   %rax,%rax
je     1140 <clear_ok_packet+0x10>
xor    %eax,%eax
call   1030 <parse_error_packet@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @clear_ok_packet() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @read_packet()
%3 = tail call i64 (...) @check_ok_packet()
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = tail call i32 (...) @parse_error_packet()
ret i32 0
}
/* Variables and functions */
float sqrtf(float);
__attribute__((__weak__, __always___)) float softboundmpx_sqrtf(float x) {
  return sqrtf(x);
}


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

x86 assembly (clang, -O2):
<softboundmpx_sqrtf>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111d <softboundmpx_sqrtf+0xd>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

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

LLVM IR (-O2):
define weak float @softboundmpx_sqrtf(float %0) {
%2 = tail call float @sqrtf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Main!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"Main!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int partition_version2(int *, int, int);
void quick_sort(int *nums, int begin, int end) {
  int i;
  if (begin >= end)
    return;
  i = partition_version2(nums, begin, end);
  quick_sort(nums, begin, i - 1);
  quick_sort(nums, i + 1, end);
}


x86 assembly (clang, -O0):
<quick_sort>:
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
jl     1143 <quick_sort+0x23>
jmp    1179 <quick_sort+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition_version2@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+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_version2@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quick_sort(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 sge i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %25
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @partition_version2(i32* %13, i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = load i32*, i32** %4
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %6
br label %25
25: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @quick_sort(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_version2(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(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 strlen(char *);
void trim_char(char *str, char c) {
  int len;
  len = strlen(str) - 1;
  if (str[len] != c)
    return;
  str[len] = '\0';
  return;
}


x86 assembly (clang, -O0):
<trim_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
je     114e <trim_char+0x3e>
jmp    115a <trim_char+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_char>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmp    %bpl,-0x1(%rax,%rbx,1)
jne    112b <trim_char+0x1b>
movb   $0x0,-0x1(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @trim_char(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, %1
br i1 %8, label %9, label %10
9: ; preds = %2
store i8 0, i8* %6
br label %10
10: ; preds = %2, %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat_s(char *, size_t, char *);
void uninitvar_strcat_s(char *Ct, size_t N, char *S) {
  char *ct;
  char *s;
  size_t n;
  (void)strcat_s(ct, n, s);
  (void)strcat_s(ct, N, S);
  (void)strcat_s(Ct, N, s);
  (void)strcat_s(Ct, n, S);
  (void)strcat_s(Ct, N, S);
}


x86 assembly (clang, -O0):
<uninitvar_strcat_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <strcat_s@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strcat_s@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <strcat_s@plt>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strcat_s@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strcat_s@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_strcat_s>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <strcat_s@plt>
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strcat_s@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcat_s@plt>
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <strcat_s@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strcat_s@plt>

LLVM IR (-O0):
define void @uninitvar_strcat_s(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%10 = load i8*, i8** %7
%11 = load i64, i64* %9
%12 = load i8*, i8** %8
%13 = call i32 @strcat_s(i8* %10, i64 %11, i8* %12)
%14 = load i8*, i8** %7
%15 = load i64, i64* %5
%16 = load i8*, i8** %6
%17 = call i32 @strcat_s(i8* %14, i64 %15, i8* %16)
%18 = load i8*, i8** %4
%19 = load i64, i64* %5
%20 = load i8*, i8** %8
%21 = call i32 @strcat_s(i8* %18, i64 %19, i8* %20)
%22 = load i8*, i8** %4
%23 = load i64, i64* %9
%24 = load i8*, i8** %6
%25 = call i32 @strcat_s(i8* %22, i64 %23, i8* %24)
%26 = load i8*, i8** %4
%27 = load i64, i64* %5
%28 = load i8*, i8** %6
%29 = call i32 @strcat_s(i8* %26, i64 %27, i8* %28)
ret void
}

LLVM IR (-O2):
define void @uninitvar_strcat_s(i8* %0, i64 %1, i8* %2) {
%4 = tail call i32 @strcat_s(i8* undef, i64 undef, i8* undef)
%5 = tail call i32 @strcat_s(i8* undef, i64 %1, i8* %2)
%6 = tail call i32 @strcat_s(i8* %0, i64 %1, i8* undef)
%7 = tail call i32 @strcat_s(i8* %0, i64 undef, i8* %2)
%8 = tail call i32 @strcat_s(i8* %0, i64 %1, i8* %2)
ret void
}
/* Variables and functions */
size_t st_intsize(const void *k) { return sizeof(int); }


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

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

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

LLVM IR (-O2):
define i64 @st_intsize(i8* nocapture readnone %0) {
ret i64 4
}
ptstash(adr, val) int *adr;
{
  register int *a;
  if (*(a = adr) != (-1))
    return (*a != val);
  *a = val;
  return (0);
}


x86 assembly (clang, -O0):
<ptstash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0xffffffff,(%rax)
je     1135 <ptstash+0x35>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
cmp    -0x14(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1145 <ptstash+0x45>
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptstash>:
mov    (%rdi),%ecx
cmp    $0xffffffff,%ecx
je     110f <ptstash+0xf>
xor    %eax,%eax
cmp    %esi,%ecx
setne  %al
ret
mov    %esi,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ptstash(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, -1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = icmp ne i32 %3, %1
%7 = zext i1 %6 to i32
br label %9
8: ; preds = %2
store i32 %1, i32* %0
br label %9
9: ; preds = %8, %5
%10 = phi i32 [ %7, %5 ], [ 0, %8 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(char *);
scalar_t__ malloc(int);
void *xmalloc(int size) {
  void *x = (void *)malloc(size);
  if (x == 0)
    fatal_error("Out of memory at request for %d bytes.\n");
  return (x);
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <xmalloc+0x2e>
lea    0xeb7(%rip),%rdi
call   1030 <fatal_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <fatal_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Out of memory at request for %d bytes.\0A\00"
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @fatal_error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [40 x i8] c"Out of memory at request for %d bytes.\0A\00"
define i8* @xmalloc(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal_error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i8*
ret i8* %7
}
int __of_add_property_sysfs(struct device_node *np, struct property *pp) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.device_node = type opaque
%struct.property = type opaque
define i32 @__of_add_property_sysfs(%struct.device_node* %0, %struct.property* %1) {
%3 = alloca %struct.device_node*
%4 = alloca %struct.property*
store %struct.device_node* %0, %struct.device_node** %3
store %struct.property* %1, %struct.property** %4
ret i32 0
}

LLVM IR (-O2):
%struct.device_node = type opaque
%struct.property = type opaque
define i32 @__of_add_property_sysfs(%struct.device_node* nocapture readnone %0, %struct.property* nocapture readnone %1) {
ret i32 0
}
int test4(char x) { return x / 100 <= 3; }


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x3,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test4(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sdiv i32 %4, 100
%6 = icmp sle i32 %5, 3
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @test4(i8 signext %0) {
ret i32 1
}
int strAreEquals(char str1[], char str2[], int maxSize) {
  int i;
  for (i = 0; i < maxSize; i++) {
    if (str1[i] != str2[i])
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<strAreEquals>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1161 <strAreEquals+0x61>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     114e <strAreEquals+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1168 <strAreEquals+0x68>
jmp    1153 <strAreEquals+0x53>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <strAreEquals+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strAreEquals>:
mov    $0x1,%eax
test   %edx,%edx
jle    1122 <strAreEquals+0x22>
mov    %edx,%r8d
xor    %edx,%edx
xchg   %ax,%ax
movzbl (%rdi,%rdx,1),%ecx
cmp    (%rsi,%rdx,1),%cl
jne    1123 <strAreEquals+0x23>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1110 <strAreEquals+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strAreEquals(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %1, i64 %10
%14 = load i8, i8* %13
%15 = icmp eq i8 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9, %7, %3
%18 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ func(int);
main() { func(5); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <func@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @func(i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func(i32 5)
ret i32 0
}
/* Variables and functions */
int sprintf(char *, char *, void *);
int print_p(char *buf, void *val) {
  return sprintf(buf,
                 "%"
                 "p",
                 val);
}


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

x86 assembly (clang, -O2):
<print_p>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%p\00"
define i32 @print_p(i8* nocapture writeonly %0, i8* %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 %3
}
/* Variables and functions */
bool x86_is_call(unsigned char *insn) { return *insn == 0xe8; }


x86 assembly (clang, -O0):
<x86_is_call>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xe8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<x86_is_call>:
xor    %eax,%eax
cmpb   $0xe8,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @x86_is_call(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 232
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @x86_is_call(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, -24
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void stw_le_p(void *ptr, int v) { *(uint16_t *)ptr = v; }


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

x86 assembly (clang, -O2):
<stw_le_p>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @stw_le_p(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @stw_le_p(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ angine_start();
void angine_restart() { angine_start(); }


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

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

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

LLVM IR (-O2):
define void @angine_restart() {
%1 = tail call i32 (...) @angine_start()
ret void
}
int test_imm_F7int32_mem(int *val) {
  return ((*val) & (0xF7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F7int32_mem>:
testb  $0xf7,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F7int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 247
%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_F7int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 247
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void RTTarFileClose(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTarFileClose() {
ret void
}
void gendsra() {}


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

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

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

LLVM IR (-O2):
define void @gendsra() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ descending2(int *, int *);
void descending3(int *a, int *b, int *c) {
  descending2(a, b);
  descending2(a, c);
  descending2(b, c);
}


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

x86 assembly (clang, -O2):
<descending3>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <descending2@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <descending2@plt>
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <descending2@plt>

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

LLVM IR (-O2):
define void @descending3(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @descending2(i32* %0, i32* %1)
%5 = tail call i32 @descending2(i32* %0, i32* %2)
%6 = tail call i32 @descending2(i32* %1, i32* %2)
ret void
}
/* Type definitions */
typedef int __int64_t;

/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void display_i64(__int64_t it) {
  int c = '0' + it % 10;
  it /= 10;
  if (it > 0)
    display_i64(it);
  putchar(c);
}


x86 assembly (clang, -O0):
<display_i64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    115c <display_i64+0x3c>
mov    -0x4(%rbp),%edi
call   1040 <display_i64@plt>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_i64>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%edi
jl     113c <display_i64+0x1c>
mov    %ebx,%eax
mov    $0xcccccccd,%edi
imul   %rax,%rdi
shr    $0x23,%rdi
call   1040 <display_i64@plt>
movslq %ebx,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
neg    %eax
lea    (%rbx,%rax,1),%edi
add    $0x30,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @display_i64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 10
%6 = add nsw i32 48, %5
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 10
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %1
%14 = load i32, i32* %3
%15 = call i32 @putchar(i32 %14)
ret void
}

LLVM IR (-O2):
define void @display_i64(i32 %0) {
%2 = icmp sgt i32 %0, 9
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = udiv i32 %0, 10
tail call void @display_i64(i32 %4)
br label %5
5: ; preds = %3, %1
%6 = srem i32 %0, 10
%7 = add nsw i32 %6, 48
%8 = tail call i32 @putchar(i32 %7)
ret void
}
void strcat_user(char *s, char *t) {
  for (; *s != '\0'; s++)
    ;
  for (; (*s = *t) != '\0'; s++, t++)
    ;
}


x86 assembly (clang, -O0):
<strcat_user>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1132 <strcat_user+0x32>
jmp    1121 <strcat_user+0x21>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <strcat_user+0xc>
jmp    1137 <strcat_user+0x37>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1171 <strcat_user+0x71>
jmp    1154 <strcat_user+0x54>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <strcat_user+0x37>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat_user>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <strcat_user>
mov    (%rsi),%al
mov    %al,-0x1(%rdi)
test   %al,%al
je     1130 <strcat_user+0x30>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x1(%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1120 <strcat_user+0x20>
ret

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

LLVM IR (-O2):
define void @strcat_user(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
store i8 %9, i8* %4
%10 = icmp eq i8 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %8, %11
%12 = phi i8* [ %15, %11 ], [ %1, %8 ]
%13 = phi i8* [ %14, %11 ], [ %4, %8 ]
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = getelementptr inbounds i8, i8* %12, i64 1
%16 = load i8, i8* %15
store i8 %16, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %11
18: ; preds = %11, %8
ret void
}