xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ tty_mode(int);
extern void ctrl_c_handler(int signum) {
  tty_mode(1);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<ctrl_c_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <tty_mode@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ctrl_c_handler>:
push   %rax
mov    $0x1,%edi
call   1030 <tty_mode@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @ctrl_c_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @tty_mode(i32 1)
%4 = load i32, i32* @EXIT_FAILURE
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @ctrl_c_handler(i32 %0) {
%2 = tail call i32 @tty_mode(i32 1)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void yydestruct(const char *yymsg, int yytype, char **yyvaluep) {
  ((void)(yyvaluep));
  if (!yymsg)
    yymsg = "Deleting";
  ;

#pragma GCC diagnostic push

#pragma GCC diagnostic ignored "-Wuninitialized"

#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"

  ((void)(yytype));

#pragma GCC diagnostic pop
}


x86 assembly (clang, -O0):
<yydestruct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1125 <yydestruct+0x25>
lea    0xedf(%rip),%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @yydestruct(i8* nocapture %0, i32 %1, i8** nocapture %2) {
ret void
}
const void *n2key_direct(const void *node) { return node; }


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

x86 assembly (clang, -O2):
<n2key_direct>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @n2key_direct(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i8* %3
}

LLVM IR (-O2):
define i8* @n2key_direct(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned int, int);
void enable_dma(unsigned int dmanr) {
  if (dmanr <= 3)
    outb(dmanr, 0x0A);
  else
    outb(dmanr & 3, 0xD4);
}


x86 assembly (clang, -O0):
<enable_dma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
ja     1137 <enable_dma+0x27>
mov    -0x4(%rbp),%edi
mov    $0xa,%esi
call   1030 <outb@plt>
jmp    1147 <enable_dma+0x37>
mov    -0x4(%rbp),%edi
and    $0x3,%edi
mov    $0xd4,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_dma>:
cmp    $0x3,%edi
ja     111f <enable_dma+0xf>
mov    $0xa,%esi
jmp    1030 <outb@plt>
and    $0x3,%edi
mov    $0xd4,%esi
jmp    1030 <outb@plt>

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

LLVM IR (-O2):
define void @enable_dma(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @outb(i32 %0, i32 10)
br label %8
5: ; preds = %1
%6 = and i32 %0, 3
%7 = tail call i32 @outb(i32 %6, i32 212)
br label %8
8: ; preds = %5, %3
ret void
}
void Help() {}


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

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

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

LLVM IR (-O2):
define void @Help() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int strlen(char *);
int revisarNombreDeArchivo(char *nombreArchivo) {
  return !(strcmp(nombreArchivo + strlen(nombreArchivo) - 3, ".xx"));
}


x86 assembly (clang, -O0):
<revisarNombreDeArchivo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
cltq
add    %rax,%rdi
add    $0xfffffffffffffffd,%rdi
lea    0xeaf(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<revisarNombreDeArchivo>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
lea    (%rbx,%rax,1),%rdi
add    $0xfffffffffffffffd,%rdi
lea    0xec6(%rip),%rsi
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c".xx\00"
define i32 @revisarNombreDeArchivo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
%8 = getelementptr inbounds i8, i8* %7, i64 -3
%9 = call i32 @strcmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [4 x i8] c".xx\00"
define i32 @revisarNombreDeArchivo(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -3
%6 = tail call i32 @strcmp(i8* %5, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
double tdbl(struct timeval *a) { return a->tv_sec + a->tv_usec / 1e6; }


x86 assembly (clang, -O0):
<tdbl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
cvtsi2sdl 0x8(%rax),%xmm1
movsd  0xedf(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tdbl>:
cvtsi2sdl 0x8(%rdi),%xmm0
divsd  0xef3(%rip),%xmm0
addsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { double, i32 }
define double @tdbl(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%5 = load double, double* %4
%6 = load %struct.timeval*, %struct.timeval** %2
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %5, %10
ret double %11
}

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
define double @tdbl(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load double, double* %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 1.000000e+06
%8 = fadd double %3, %7
ret double %8
}
void numtoalpha(char *input) {
  if (*input >= 0 && *input < 26)
    *input += 'A';
}


x86 assembly (clang, -O0):
<numtoalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jl     1134 <numtoalpha+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1a,%eax
jge    1134 <numtoalpha+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
add    $0x41,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<numtoalpha>:
mov    (%rdi),%al
cmp    $0x19,%al
ja     110a <numtoalpha+0xa>
add    $0x41,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @numtoalpha(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ult i8 %2, 26
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = add nuw nsw i8 %2, 65
store i8 %5, i8* %0
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 1;
  while (i++ < 5)
    ;
  printf("%d", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x5,%eax
jge    113f <main+0x2f>
jmp    1126 <main+0x16>
mov    -0x8(%rbp),%esi
lea    0xeb7(%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
mov    $0x6,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isODD(const char *tok) { return strcmp(tok, "odd") == 0; }


x86 assembly (clang, -O0):
<isODD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"odd\00"
define i32 @isODD(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"odd\00"
define i32 @isODD(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int printf(char *, unsigned short);
int float_to_ushort(void) {
  float g = 0x92F9E84EL;
  unsigned short s = g;
  return printf("(float) unsigned short: %d\n", s);
}


x86 assembly (clang, -O0):
<float_to_ushort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4f12f9e8,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
mov    %ax,-0x6(%rbp)
lea    0xed1(%rip),%rdi
movzwl -0x6(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_to_ushort>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"(float) unsigned short: %d\0A\00"
define i32 @float_to_ushort() {
%1 = alloca float
%2 = alloca i16
store float 0x41E25F3D00000000, float* %1
%3 = load float, float* %1
%4 = fptoui float %3 to i16
store i16 %4, i16* %2
%5 = load i16, i16* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i16 zeroext %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [28 x i8] c"(float) unsigned short: %d\0A\00"
define i32 @float_to_ushort() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i16 zeroext poison)
ret i32 %1
}
/* Variables and functions */
int rand();
float RandZeroToOne(void) {
  double AB_rand = rand() % 1000;
  AB_rand = (AB_rand + 1) / 1000;
  return ((float)(AB_rand));
}


x86 assembly (clang, -O0):
<RandZeroToOne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xed0(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xebb(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandZeroToOne>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
divsd  0xeb9(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @RandZeroToOne() {
%1 = alloca double
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 1000
%4 = sitofp i32 %3 to double
store double %4, double* %1
%5 = load double, double* %1
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double %6, 1.000000e+03
store double %7, double* %1
%8 = load double, double* %1
%9 = fptrunc double %8 to float
ret float %9
}

LLVM IR (-O2):
define float @RandZeroToOne() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 1000
%3 = add nsw i32 %2, 1
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 1.000000e+03
%6 = fptrunc double %5 to float
ret float %6
}
void worst_fit_dealloc(void *ptr) { return; }


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

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

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

LLVM IR (-O2):
define void @worst_fit_dealloc(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
void srand48(long int seed) { srand((unsigned int)seed); }


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

x86 assembly (clang, -O2):
<srand48>:
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @srand48(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 @srand(i32 %4)
ret void
}

LLVM IR (-O2):
define void @srand48(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @srand(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo(int, int, int, int);
int main(void) {
  int res = foo(4, 50, 50, 50);
  if (res != 14700)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
mov    $0x32,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1040 <foo@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x396c,-0x8(%rbp)
je     1159 <main+0x39>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
mov    $0x32,%esi
mov    $0x32,%edx
mov    $0x32,%ecx
call   1040 <foo@plt>
cmp    $0x396c,%eax
jne    1145 <main+0x25>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 4, i32 50, i32 50, i32 50)
%2 = icmp eq i32 %1, 14700
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
void ff_hevc_put_hevc_bi_epel_h24_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_h24_10_sse4() {
ret void
}
void gtk_file_chooser_get_current_folder() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_get_current_folder() {
ret void
}
int hf_glib_ascii_tolower(int c) {
  if (c >= 'A' && c <= 'Z') {
    return c - 'A' + 'a';
  }
  return c;
}


x86 assembly (clang, -O0):
<hf_glib_ascii_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     112c <hf_glib_ascii_tolower+0x2c>
cmpl   $0x5a,-0x8(%rbp)
jg     112c <hf_glib_ascii_tolower+0x2c>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <hf_glib_ascii_tolower+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @hf_glib_ascii_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int ci_send_menu_answer(int, int, int /*<<< orphan*/);
int ci_cancel_menu(int fd, int slot) {
  return ci_send_menu_answer(fd, slot, 0);
}


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

x86 assembly (clang, -O2):
<ci_cancel_menu>:
xor    %edx,%edx
jmp    1030 <ci_send_menu_answer@plt>

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

LLVM IR (-O2):
define i32 @ci_cancel_menu(i32 %0, i32 %1) {
%3 = tail call i32 @ci_send_menu_answer(i32 %0, i32 %1, i32 0)
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long serial;
};
typedef TYPE_1__ XMapRequestEvent;

/* Variables and functions */
void set_XMapRequestEvent_serial(void *_p, unsigned long _v) {
  ((XMapRequestEvent *)_p)->serial = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XMapRequestEvent_serial(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XMapRequestEvent_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void EC_KEY_get0_private_key(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_KEY_get0_private_key() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_not_enough_parameters(void) {
  puts("--- Not enough parameters ---\n");
}


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

x86 assembly (clang, -O2):
<print_not_enough_parameters>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"--- Not enough parameters ---\0A\00"
define void @print_not_enough_parameters() {
%1 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"--- Not enough parameters ---\0A\00"
define void @print_not_enough_parameters() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WSACleanup();
int lw_sock_exit() {
  int result = 1;
  WSACleanup();
  return result;
}


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

x86 assembly (clang, -O2):
<lw_sock_exit>:
push   %rax
xor    %eax,%eax
call   1030 <WSACleanup@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @lw_sock_exit() {
%1 = tail call i32 (...) @WSACleanup()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ printBinary(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  printBinary(atoi(argv[1]));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <printBinary@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <printBinary@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @atoi(i8* %8)
%10 = call i32 @printBinary(i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @printBinary(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ end();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void signal_callback_handler() {
  printf("Close TCP\n");
  end();
  exit(0);
}


x86 assembly (clang, -O0):
<signal_callback_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <end@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<signal_callback_handler>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <end@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Close TCP\0A\00"
define void @signal_callback_handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @end()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [10 x i8] c"Close TCP\00"
define void @signal_callback_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @end()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
#define ARPHRD_ETHER 136
#define ARPHRD_FDDI 135
#define ARPHRD_IEEE802 134
#define ARPHRD_IEEE80211 133
#define ARPHRD_IEEE802_TR 132
#define ARPHRD_IPGRE 131
#define ARPHRD_PPP 130
#define ARPHRD_SIT 129
#define ARPHRD_TUNNEL6 128
short nd_get_l2addr_len(unsigned short iface_type) {
  switch (iface_type) {
  case ARPHRD_ETHER:
  case ARPHRD_IEEE802:
  case ARPHRD_IEEE802_TR:
  case ARPHRD_IEEE80211:
  case ARPHRD_FDDI:
    return 6;
  case ARPHRD_SIT:
  case ARPHRD_TUNNEL6:
  case ARPHRD_PPP:
  case ARPHRD_IPGRE:
    return 0;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<nd_get_l2addr_len>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
add    $0xffffff80,%eax
sub    $0x4,%eax
jb     1144 <nd_get_l2addr_len+0x44>
jmp    1123 <nd_get_l2addr_len+0x23>
mov    -0x8(%rbp),%eax
add    $0xffffff7c,%eax
sub    $0x4,%eax
ja     114f <nd_get_l2addr_len+0x4f>
jmp    1139 <nd_get_l2addr_len+0x39>
movw   $0x6,-0x2(%rbp)
jmp    1155 <nd_get_l2addr_len+0x55>
movw   $0x0,-0x2(%rbp)
jmp    1155 <nd_get_l2addr_len+0x55>
movw   $0xffff,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nd_get_l2addr_len>:
add    $0xffffff80,%edi
mov    $0xffff,%ax
cmp    $0x8,%di
ja     111c <nd_get_l2addr_len+0x1c>
movswq %di,%rax
lea    0xee8(%rip),%rcx
movzwl (%rcx,%rax,2),%eax
ret

LLVM IR (-O0):
define signext i16 @nd_get_l2addr_len(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
switch i32 %5, label %8 [
i32 136, label %6
i32 134, label %6
i32 132, label %6
i32 133, label %6
i32 135, label %6
i32 129, label %7
i32 128, label %7
i32 130, label %7
i32 131, label %7
]
6: ; preds = %1, %1, %1, %1, %1
store i16 6, i16* %2
br label %9
7: ; preds = %1, %1, %1, %1
store i16 0, i16* %2
br label %9
8: ; preds = %1
store i16 -1, i16* %2
br label %9
9: ; preds = %8, %7, %6
%10 = load i16, i16* %2
ret i16 %10
}

LLVM IR (-O2):
@switch.table.nd_get_l2addr_len = [9 x i16] [i16 0, i16 0, i16 0, i16 0, i16 6, i16 6, i16 6, i16 6, i16 6]
define signext i16 @nd_get_l2addr_len(i16 zeroext %0) {
%2 = add i16 %0, -128
%3 = icmp ult i16 %2, 9
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i16 %2 to i64
%6 = getelementptr inbounds [9 x i16], [9 x i16]* @switch.table.nd_get_l2addr_len, i64 0, i64 %5
%7 = load i16, i16* %6
br label %8
8: ; preds = %1, %4
%9 = phi i16 [ %7, %4 ], [ -1, %1 ]
ret i16 %9
}
int j(double i) { return i > i + 2.0; }


x86 assembly (clang, -O0):
<j>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<j>:
movsd  0xef8(%rip),%xmm1
addsd  %xmm0,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @j(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fadd double %4, 2.000000e+00
%6 = fcmp ogt double %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @j(double %0) {
%2 = fadd double %0, 2.000000e+00
%3 = fcmp olt double %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_62int32_reg(int val) { return ((val) & (0x62 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_62int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x62,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_62int32_reg(i32 %0) {
%2 = and i32 %0, 98
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ rand();
unsigned short random_rand16(void) { return (unsigned short)rand(); }


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

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

LLVM IR (-O0):
define zeroext i16 @random_rand16() {
%1 = call i64 (...) @rand()
%2 = trunc i64 %1 to i16
ret i16 %2
}

LLVM IR (-O2):
define zeroext i16 @random_rand16() {
%1 = tail call i64 (...) @rand()
%2 = trunc i64 %1 to i16
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ pn_environ_put(char ***, char *);
void pn_environ_put_all(char ***environ, char **environ_to_put) {
  char **env;
  for (env = environ_to_put; *env; ++env) {
    pn_environ_put(environ, *env);
  }
}


x86 assembly (clang, -O0):
<pn_environ_put_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1157 <pn_environ_put_all+0x47>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
call   1030 <pn_environ_put@plt>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <pn_environ_put_all+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pn_environ_put_all>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    (%rsi),%rsi
test   %rsi,%rsi
je     1144 <pn_environ_put_all+0x34>
mov    %rdi,%r14
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <pn_environ_put@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <pn_environ_put_all+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @pn_environ_put_all(i8*** %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = phi i8** [ %9, %5 ], [ %1, %2 ]
%8 = tail call i32 @pn_environ_put(i8*** %0, i8* %6)
%9 = getelementptr inbounds i8*, i8** %7, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
int StartsWith(char *string, char this) { return (string[0] == this); }


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

x86 assembly (clang, -O2):
<StartsWith>:
xor    %eax,%eax
cmp    %sil,(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @StartsWith(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
__attribute__((visibility("default"))) int sd_booted(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @sd_booted() {
ret i32 1
}
void tunit_fini(struct tunit *tunit) {}


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

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

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

LLVM IR (-O2):
%struct.tunit = type opaque
define void @tunit_fini(%struct.tunit* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dot(float *, float *);
float sqrt(int /*<<< orphan*/);
float magnitude(float a[3]) { return sqrt(dot(a, a)); }


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

x86 assembly (clang, -O2):
<magnitude>:
push   %rax
mov    %rdi,%rsi
call   1030 <dot@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define float @magnitude(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float*, float** %2
%5 = call i32 @dot(float* %3, float* %4)
%6 = call float @sqrt(i32 %5)
ret float %6
}

LLVM IR (-O2):
define float @magnitude(float* %0) {
%2 = tail call i32 @dot(float* %0, float* %0)
%3 = tail call float @sqrt(i32 %2)
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int contains_data(int /*<<< orphan*/ *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int is_fat_16_fs(FILE *fp) {
  char *szMagic = "FAT16   ";
  return contains_data(fp, 0x36, szMagic, strlen(szMagic));
}


x86 assembly (clang, -O0):
<is_fat_16_fs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
mov    $0x36,%esi
call   1040 <contains_data@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_fat_16_fs>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    $0x36,%esi
mov    %r14,%rdx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <contains_data@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"FAT16 \00"
define i32 @is_fat_16_fs(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i32* %0, i32** %2
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32*, i32** %2
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @contains_data(i32* %4, i32 54, i8* %5, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [9 x i8] c"FAT16 \00"
define i32 @is_fat_16_fs(i32* %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @contains_data(i32* %0, i32 54, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ android_compiler_barrier();
void android_memory_barrier(void) { android_compiler_barrier(); }


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

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

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

LLVM IR (-O2):
define void @android_memory_barrier() {
%1 = tail call i32 (...) @android_compiler_barrier()
ret void
}
long __syscall2(long n, long a1, long a2) {
  long __ret;
  __asm("int $0x95" : "=a"(__ret) : "a"(n), "b"(a1), "c"(a2) : "memory");
  return __ret;
}


x86 assembly (clang, -O0):
<__syscall2>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rbx
mov    -0x20(%rbp),%rcx
int    $0x95
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall2>:
push   %rbx
mov    %rdx,%rcx
mov    %rsi,%rbx
mov    %rdi,%rax
int    $0x95
pop    %rbx
ret

LLVM IR (-O0):
define i64 @__syscall2(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = call i64 asm "int $$0x95", "={ax},{ax},{bx},{cx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %8, i64 %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
ret i64 %12
}

LLVM IR (-O2):
define i64 @__syscall2(i64 %0, i64 %1, i64 %2) {
%4 = tail call i64 asm "int $$0x95", "={ax},{ax},{bx},{cx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2)
ret i64 %4
}
/* Type definitions */
typedef int time_t;
struct stat {
  int st_mtime;
};

/* Variables and functions */
int stat(char const *, struct stat *);
time_t file_get_mtime(const char *filename) {
  struct stat s;
  if (stat(filename, &s) == -1)
    return -1;
  return s.st_mtime;
}


x86 assembly (clang, -O0):
<file_get_mtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    113e <file_get_mtime+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1144 <file_get_mtime+0x34>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_get_mtime>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1121 <file_get_mtime+0x11>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_get_mtime(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ sortie();
int main(void) { sortie(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @sortie()
ret i32 0
}
char __readbyte(unsigned int *bytes_read, const char **buf, unsigned int *len) {
  char val;
  val = **buf;
  *buf += 1;
  *bytes_read += 1;
  *len -= 1;
  return val;
}


x86 assembly (clang, -O0):
<__readbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    %ecx,(%rax)
movsbl -0x19(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__readbyte>:
mov    (%rsi),%rcx
mov    (%rcx),%al
add    $0x1,%rcx
mov    %rcx,(%rsi)
addl   $0x1,(%rdi)
addl   $0xffffffff,(%rdx)
ret

LLVM IR (-O0):
define signext i8 @__readbyte(i32* %0, i8** %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8
store i32* %0, i32** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%8 = load i8**, i8*** %5
%9 = load i8*, i8** %8
%10 = load i8, i8* %9
store i8 %10, i8* %7
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %11
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = add i32 %15, 1
store i32 %16, i32* %14
%17 = load i32*, i32** %6
%18 = load i32, i32* %17
%19 = sub i32 %18, 1
store i32 %19, i32* %17
%20 = load i8, i8* %7
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @__readbyte(i32* nocapture %0, i8** nocapture %1, i32* nocapture %2) {
%4 = load i8*, i8** %1
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %6, i8** %1
%7 = load i32, i32* %0
%8 = add i32 %7, 1
store i32 %8, i32* %0
%9 = load i32, i32* %2
%10 = add i32 %9, -1
store i32 %10, i32* %2
ret i8 %5
}
void setup_power_save(void) {}


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

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

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

LLVM IR (-O2):
define void @setup_power_save() {
ret void
}
unsigned int f42(unsigned int x, unsigned long int y) {
  return (x >> y) | (x << ((-y) & (8 * sizeof(unsigned int) - 1)));
}


x86 assembly (clang, -O0):
<f42>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f42>:
mov    %rsi,%rcx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f42(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = lshr i32 %5, %7
%9 = load i32, i32* %3
%10 = load i64, i64* %4
%11 = sub i64 0, %10
%12 = and i64 %11, 31
%13 = trunc i64 %12 to i32
%14 = shl i32 %9, %13
%15 = or i32 %8, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @f42(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = lshr i32 %0, %3
%5 = sub i32 0, %3
%6 = and i32 %5, 31
%7 = shl i32 %0, %6
%8 = or i32 %7, %4
ret i32 %8
}
float __ocl_fast_length_float(float src) { return src < 0 ? -src : src; }


x86 assembly (clang, -O0):
<__ocl_fast_length_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1132 <__ocl_fast_length_float+0x32>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    113c <__ocl_fast_length_float+0x3c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_fast_length_float>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @__ocl_fast_length_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
br label %10
8: ; preds = %1
%9 = load float, float* %2
br label %10
10: ; preds = %8, %5
%11 = phi float [ %7, %5 ], [ %9, %8 ]
ret float %11
}

LLVM IR (-O2):
define float @__ocl_fast_length_float(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Type definitions */
struct buffer_chunk {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buffer_chunk_cleanup(struct buffer_chunk *);
int /*<<< orphan*/ free(struct buffer_chunk *);
void free_buffer_chunk(struct buffer_chunk *chunk) {
  buffer_chunk_cleanup(chunk);
  free(chunk);
}


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

x86 assembly (clang, -O2):
<free_buffer_chunk>:
push   %rbx
mov    %rdi,%rbx
call   1040 <buffer_chunk_cleanup@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.buffer_chunk = type { i32 }
define void @free_buffer_chunk(%struct.buffer_chunk* %0) {
%2 = alloca %struct.buffer_chunk*
store %struct.buffer_chunk* %0, %struct.buffer_chunk** %2
%3 = load %struct.buffer_chunk*, %struct.buffer_chunk** %2
%4 = call i32 @buffer_chunk_cleanup(%struct.buffer_chunk* %3)
%5 = load %struct.buffer_chunk*, %struct.buffer_chunk** %2
%6 = call i32 @free(%struct.buffer_chunk* %5)
ret void
}

LLVM IR (-O2):
%struct.buffer_chunk = type { i32 }
define void @free_buffer_chunk(%struct.buffer_chunk* %0) {
%2 = tail call i32 @buffer_chunk_cleanup(%struct.buffer_chunk* %0)
%3 = tail call i32 @free(%struct.buffer_chunk* %0)
ret void
}