xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ sqrt(int);
int is_prime(int n) {
  int i;
  int sqrt_n = (int)sqrt(n);
  for (i = 2; i <= sqrt_n; i++) {
    if (n % i == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1168 <is_prime+0x58>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1155 <is_prime+0x45>
movl   $0x0,-0x4(%rbp)
jmp    116f <is_prime+0x5f>
jmp    115a <is_prime+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <is_prime+0x1d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
push   %rbx
mov    %edi,%ebx
call   1030 <sqrt@plt>
mov    %rax,%rsi
mov    $0x1,%ecx
cmp    $0x2,%esi
jl     114f <is_prime+0x3f>
neg    %esi
mov    $0x2,%edi
nopl   0x0(%rax)
mov    %ebx,%eax
cltd
idiv   %edi
test   %edx,%edx
je     114d <is_prime+0x3d>
lea    (%rsi,%rdi,1),%eax
add    $0x1,%eax
mov    %edi,%edx
add    $0x1,%edx
mov    %edx,%edi
cmp    $0x1,%eax
jne    1130 <is_prime+0x20>
jmp    114f <is_prime+0x3f>
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_prime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = call i64 @sqrt(i32 %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %5
store i32 2, i32* %4
br label %9
9: ; preds = %20, %1
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = srem i32 %14, %15
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 0, i32* %2
br label %24
19: ; preds = %13
br label %20
20: ; preds = %19
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %9
23: ; preds = %9
store i32 1, i32* %2
br label %24
24: ; preds = %23, %18
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = tail call i64 @sqrt(i32 %0)
%3 = trunc i64 %2 to i32
%4 = icmp slt i32 %3, 2
br i1 %4, label %12, label %8
5: ; preds = %8
%6 = add nuw i32 %9, 1
%7 = icmp eq i32 %9, %3
br i1 %7, label %12, label %8
8: ; preds = %1, %5
%9 = phi i32 [ %6, %5 ], [ 2, %1 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %8, %5, %1
%13 = phi i32 [ 1, %1 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
main() {
  printf("! DO NOT EDIT THIS FILE. \n");
  printf("! It is created from f90_unix_time_const.c\n");
  printf("integer, parameter :: TIME_KIND = %d\n", sizeof(time_t));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"! DO NOT EDIT THIS FILE. \0A\00"
@.str.1 = [44 x i8] c"! It is created from f90_unix_time_const.c\0A\00"
@.str.2 = [38 x i8] c"integer, parameter :: TIME_KIND = %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i64 4)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [38 x i8] c"integer, parameter :: TIME_KIND = %d\0A\00"
@str = [26 x i8] c"! DO NOT EDIT THIS FILE. \00"
@str.3 = [43 x i8] c"! It is created from f90_unix_time_const.c\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i64 4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ nl_catd;

/* Variables and functions */
char *catgets(nl_catd catd, int set_id, int msg_id, const char *s) {
  return (char *)s;
}


x86 assembly (clang, -O0):
<catgets>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<catgets>:
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @catgets(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
ret i8* %9
}

LLVM IR (-O2):
define i8* @catgets(i32 %0, i32 %1, i32 %2, i8* readnone returned %3) {
ret i8* %3
}
double Miles2Km(const double valueMiles) { return valueMiles * 1.609344; }


x86 assembly (clang, -O0):
<Miles2Km>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @Miles2Km(double %0) {
%2 = fmul double %0, 0x3FF9BFDF7E8038A0
ret double %2
}
int main() {
  int i = 3;
  printf("[int in main] i @ %p = %d\n", &i, i);
  printf("This should be same 0x%08x = %d\n", &i, i);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x3,0xc(%rsp)
lea    0xedc(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x3,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%edx
lea    0xed8(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"[int in main] i @ %p = %d\0A\00"
@.str.1 = [33 x i8] c"This should be same 0x%08x = %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 3, i32* %1
%2 = load i32, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32* %1, i32 %2)
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"[int in main] i @ %p = %d\0A\00"
@.str.1 = [33 x i8] c"This should be same 0x%08x = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 3, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32* %1, i32 3)
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32 %4)
ret i32 0
}
extern int http_chunk_transmit_over(char const *start, char const *end) {
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @http_chunk_transmit_over(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
void gtk_font_button_get_use_font() {}


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

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

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

LLVM IR (-O2):
define void @gtk_font_button_get_use_font() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ custom_iowrite(int /*<<< orphan*/);
int custom_printstring(char *str) {
  while (*str != '\0') {
    custom_iowrite(*str++);
  }
  return 0;
}


x86 assembly (clang, -O0):
<custom_printstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <custom_printstring+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <custom_iowrite@plt>
jmp    111c <custom_printstring+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<custom_printstring>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <custom_printstring+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <custom_iowrite@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <custom_printstring+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @custom_printstring(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = call i32 @custom_iowrite(i32 %12)
br label %3
14: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @custom_printstring(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @custom_iowrite(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i32 0
}
/* Type definitions */
typedef unsigned long u_int32_t;

/* Variables and functions */
unsigned long log2(unsigned long);
u_int32_t ceil_log2(u_int32_t a) {
  u_int32_t result;
  result = log2(a);
  if ((1UL << result) < a)
    result++;
  return result;
}


x86 assembly (clang, -O0):
<ceil_log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <log2@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x1,%eax
shl    %cl,%rax
cmp    -0x8(%rbp),%rax
jae    114b <ceil_log2+0x3b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil_log2>:
push   %rbx
mov    %rdi,%rbx
call   1030 <log2@plt>
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%rdx
cmp    %rbx,%rdx
adc    $0x0,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @ceil_log2(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @log2(i64 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = shl i64 1, %6
%8 = load i64, i64* %2
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i64, i64* %3
%12 = add i64 %11, 1
store i64 %12, i64* %3
br label %13
13: ; preds = %10, %1
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @ceil_log2(i64 %0) {
%2 = tail call i64 @log2(i64 %0)
%3 = shl nuw i64 1, %2
%4 = icmp ult i64 %3, %0
%5 = zext i1 %4 to i64
%6 = add i64 %2, %5
ret i64 %6
}
void hang(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<hang>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <hang+0x9>
jmp    1109 <hang+0x9>

x86 assembly (clang, -O2):
<hang>:
jmp    1100 <hang>

LLVM IR (-O0):
define void @hang() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @hang() {
br label %1
1: ; preds = %0, %1
br label %1
}
int main() { int i; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void RGB565ToARGBRow_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @RGB565ToARGBRow_Any_SSE2() {
ret void
}
double approx_sun_transit_time(double alpha_zero, float longitude, double nu) {
  return (alpha_zero - longitude - nu) / 360.0;
}


x86 assembly (clang, -O0):
<approx_sun_transit_time>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm1,%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<approx_sun_transit_time>:
cvtss2sd %xmm1,%xmm1
subsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
divsd  0xeec(%rip),%xmm0
ret

LLVM IR (-O0):
define double @approx_sun_transit_time(double %0, float %1, double %2) {
%4 = alloca double
%5 = alloca float
%6 = alloca double
store double %0, double* %4
store float %1, float* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load float, float* %5
%9 = fpext float %8 to double
%10 = fsub double %7, %9
%11 = load double, double* %6
%12 = fsub double %10, %11
%13 = fdiv double %12, 3.600000e+02
ret double %13
}

LLVM IR (-O2):
define double @approx_sun_transit_time(double %0, float %1, double %2) {
%4 = fpext float %1 to double
%5 = fsub double %0, %4
%6 = fsub double %5, %2
%7 = fdiv double %6, 3.600000e+02
ret double %7
}
int digit(c) {
  if (c < '0' || c > '9')
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     111b <digit+0x1b>
cmpl   $0x39,-0x8(%rbp)
jle    1127 <digit+0x27>
movl   $0x0,-0x4(%rbp)
jmp    112e <digit+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @digit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct frame {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ frame_add_to_extra_tun(struct frame *, int);
void tun_adjust_frame_parameters(struct frame *frame, int size) {
  frame_add_to_extra_tun(frame, size);
}


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

x86 assembly (clang, -O2):
<tun_adjust_frame_parameters>:
jmp    1030 <frame_add_to_extra_tun@plt>

LLVM IR (-O0):
%struct.frame = type { i32 }
define void @tun_adjust_frame_parameters(%struct.frame* %0, i32 %1) {
%3 = alloca %struct.frame*
%4 = alloca i32
store %struct.frame* %0, %struct.frame** %3
store i32 %1, i32* %4
%5 = load %struct.frame*, %struct.frame** %3
%6 = load i32, i32* %4
%7 = call i32 @frame_add_to_extra_tun(%struct.frame* %5, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.frame = type { i32 }
define void @tun_adjust_frame_parameters(%struct.frame* %0, i32 %1) {
%3 = tail call i32 @frame_add_to_extra_tun(%struct.frame* %0, i32 %1)
ret void
}
const char *mg_version(void) { return "1.1"; }


x86 assembly (clang, -O0):
<mg_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"1.1\00"
define i8* @mg_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"1.1\00"
define i8* @mg_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
int test13() { __builtin_eh_return(0, 0); }


x86 assembly (clang, -O0):
<test13>:
push   %rbp
mov    %rsp,%rbp
mov    %rbp,%rcx
movq   $0x0,0x8(%rcx)
add    $0x8,%rcx
pop    %rbp
mov    %rcx,%rsp
ret

x86 assembly (clang, -O2):
<test13>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,0x8(%rbp)
lea    0x8(%rbp),%rcx
pop    %rbp
mov    %rcx,%rsp
ret

LLVM IR (-O0):
define i32 @test13() {
unreachable
}

LLVM IR (-O2):
define i32 @test13() {
tail call void @llvm.eh.return.i64(i64 0, i8* null)
unreachable
}
int inicializa_polinomio(float *polinomio) {
  int i = 0;
  for (i = 0; i < 10; i++) {
    *(polinomio + i) = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<inicializa_polinomio>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    113e <inicializa_polinomio+0x3e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <inicializa_polinomio+0x16>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inicializa_polinomio>:
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movq   $0x0,0x20(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @inicializa_polinomio(float* %0) {
%2 = alloca float*
%3 = alloca i32
store float* %0, float** %2
store i32 0, i32* %3
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load float*, float** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds float, float* %8, i64 %10
store float 0.000000e+00, float* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @inicializa_polinomio(float* nocapture writeonly %0) {
%2 = bitcast float* %0 to i8*
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RTTrafficInfo_ClearAll();
void RTTrafficInfo_Reset() { RTTrafficInfo_ClearAll(); }


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

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

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

LLVM IR (-O2):
define void @RTTrafficInfo_Reset() {
%1 = tail call i32 (...) @RTTrafficInfo_ClearAll()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t gca_roundup32(uint32_t x) {
  return (--x, x |= x >> 1, x |= x >> 2, x |= x >> 4, x |= x >> 8, x |= x >> 16,
          ++x);
}


x86 assembly (clang, -O0):
<gca_roundup32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gca_roundup32>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @gca_roundup32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @gca_roundup32(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}
double foo(double x, double y) {
  volatile int i = 0;
  return i >= 0 ? x : y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    $0x0,%eax
jl     1130 <foo+0x30>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    113a <foo+0x3a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x0,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
jns    1112 <foo+0x12>
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @foo(double %0, double %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
%5 = load volatile i32, i32* %3
%6 = icmp sgt i32 %5, -1
%7 = select i1 %6, double %0, double %1
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void default_free(void *opaque, void *ptr) {
  (void)opaque;
  free(ptr);
}


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

x86 assembly (clang, -O2):
<default_free>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @default_free(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 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @default_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int cpio_fill_aligned(int size) {
  while (size % 4) {
    printf("%c", 0);
    size++;
  }
  return size;
}


x86 assembly (clang, -O0):
<cpio_fill_aligned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     114b <cpio_fill_aligned+0x3b>
lea    0xeca(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <cpio_fill_aligned+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpio_fill_aligned>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
test   $0x3,%bl
je     1142 <cpio_fill_aligned+0x32>
lea    0xede(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
test   $0x3,%bl
jne    1130 <cpio_fill_aligned+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @cpio_fill_aligned(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %0, %1 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
%7 = add nsw i32 %5, 1
%8 = and i32 %7, 3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = phi i32 [ %0, %1 ], [ %7, %4 ]
ret i32 %11
}
/* Variables and functions */
double fAuxiliar(int, int, int);
float promedio3(int n, int m, int p) { return fAuxiliar(n, m, p) / 3.0; }


x86 assembly (clang, -O0):
<promedio3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <fAuxiliar@plt>
movsd  0xec9(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<promedio3>:
push   %rax
call   1030 <fAuxiliar@plt>
divsd  0xee2(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @promedio3(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 = load i32, i32* %6
%10 = call double @fAuxiliar(i32 %7, i32 %8, i32 %9)
%11 = fdiv double %10, 3.000000e+00
%12 = fptrunc double %11 to float
ret float %12
}

LLVM IR (-O2):
define float @promedio3(i32 %0, i32 %1, i32 %2) {
%4 = tail call double @fAuxiliar(i32 %0, i32 %1, i32 %2)
%5 = fdiv double %4, 3.000000e+00
%6 = fptrunc double %5 to float
ret float %6
}
unsigned xrop3_28_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D & T;
  stk2 = S | stk3;
  stk1 = T ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_28_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_28_0_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
and    %ecx,%eax
or     %esi,%eax
xor    %esi,%eax
not    %eax
and    %ecx,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_28_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %7
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %6
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %7
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = load i32, i32* %8
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = or i32 %34, %38
%40 = load i32, i32* %7
%41 = load i32, i32* %6
%42 = xor i32 %41, -1
%43 = and i32 %40, %42
%44 = load i32, i32* %5
%45 = and i32 %43, %44
%46 = or i32 %39, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_28_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = and i32 %6, %4
%8 = or i32 %7, %5
%9 = xor i32 %8, -1
%10 = and i32 %4, %9
%11 = xor i32 %4, -1
%12 = and i32 %11, %5
%13 = or i32 %10, %12
ret i32 %13
}
int test_imm_E3uint8_reg(unsigned char val) {
  return ((val) & (-0xE3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E3uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff1d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_E3uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -227
%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_E3uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 29
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void outb(unsigned int port, unsigned char val) {
  asm volatile("outb %0, %w1" : : "a"(val), "d"(port));
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    -0x4(%rbp),%edx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

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

LLVM IR (-O2):
define void @outb(i32 %0, i8 zeroext %1) {
tail call void asm sideeffect "outb $0, ${1:w}", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8 %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_stair(int);
main() { pr_stair(4); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @pr_stair(i32 4)
ret i32 0
}
/* Type definitions */
struct timeval {
  double tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, double);
main(void) {
  struct timeval currentTime;
  gettimeofday(&currentTime, NULL);
  printf("%.6f\n",
         (double)currentTime.tv_sec + currentTime.tv_usec / 1000000.0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xeb8(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
divsd  0xebb(%rip),%xmm0
addsd  %xmm1,%xmm0
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
@.str = [6 x i8] c"%.6f\0A\00"
define i32 @main() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %5, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
@.str = [6 x i8] c"%.6f\0A\00"
define i32 @main() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load double, double* %7
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %9, %6
%11 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fftss_init_threads();
void FFTSS_INIT_THREADS(void) { fftss_init_threads(); }


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

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

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

LLVM IR (-O2):
define void @FFTSS_INIT_THREADS() {
%1 = tail call i32 (...) @fftss_init_threads()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverseString(char *);
int main() {
  char msg[] = "Votre message";
  printf("Initial value: \"%s\"\n", msg);
  reverseString(msg);
  printf("Reversed     : \"%s\"\n", msg);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xec9(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0xe(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    -0xe(%rbp),%rdi
call   1040 <reverseString@plt>
lea    -0xe(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6567617373656d,%rax
mov    %rax,0x6(%rsp)
movabs $0x656d206572746f56,%rax
20 6d 65
mov    %rax,(%rsp)
lea    0xec5(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <reverseString@plt>
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.msg = [14 x i8] c"Votre message\00"
@.str = [21 x i8] c"Initial value: \22%s\22\0A\00"
@.str.1 = [21 x i8] c"Reversed : \22%s\22\0A\00"
define i32 @main() {
%1 = alloca [14 x i8]
%2 = bitcast [14 x i8]* %1 to i8*
%3 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%6 = call i32 @reverseString(i8* %5)
%7 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.msg = [14 x i8] c"Votre message\00"
@.str = [21 x i8] c"Initial value: \22%s\22\0A\00"
@.str.1 = [21 x i8] c"Reversed : \22%s\22\0A\00"
define i32 @main() {
%1 = alloca [14 x i8]
%2 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @reverseString(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
void *ft_memcpy(void *, void const *, size_t);
void *malloc(size_t);
void *ft_memdup(const void *src, size_t n) {
  void *ptr;
  if (!(ptr = malloc(n)))
    return (NULL);
  return (ft_memcpy(ptr, src, n));
}


x86 assembly (clang, -O0):
<ft_memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1154 <ft_memdup+0x34>
movq   $0x0,-0x8(%rbp)
jmp    1169 <ft_memdup+0x49>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <ft_memcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memdup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <malloc@plt>
test   %rax,%rax
je     114c <ft_memdup+0x2c>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ft_memcpy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ft_memdup(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @ft_memcpy(i8* %3, i8* %0, i64 %1)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %8
}
void returnSpaces(char *path) {
  int i = 0;
  while (path[i] != '\0') {
    if (path[i] == '*')
      path[i] = ' ';
    i++;
  }
}


x86 assembly (clang, -O0):
<returnSpaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1153 <returnSpaces+0x53>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2a,%eax
jne    1145 <returnSpaces+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <returnSpaces+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<returnSpaces>:
jmp    1117 <returnSpaces+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x20,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x2a,%al
je     1110 <returnSpaces+0x10>
test   %al,%al
jne    1113 <returnSpaces+0x13>
ret

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

LLVM IR (-O2):
define void @returnSpaces(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i64 [ %8, %7 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 42, label %6
]
6: ; preds = %2
store i8 32, i8* %4
br label %7
7: ; preds = %2, %6
%8 = add nuw i64 %3, 1
br label %2
9: ; preds = %2
ret void
}
/* Variables and functions */
int __isalpha_impl(int);
int isalpha(int c) { return __isalpha_impl(c); }


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

x86 assembly (clang, -O2):
<isalpha>:
jmp    1030 <__isalpha_impl@plt>

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

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = tail call i32 @__isalpha_impl(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void parseXML(void *xmlBuffer, int len) {
  char *xml_ptr = xmlBuffer;
  char array[len];
  int index;
  memcpy(array, xml_ptr, len);
}


x86 assembly (clang, -O0):
<parseXML>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseXML>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%edx
mov    %rdi,%rsi
mov    %edx,%eax
mov    %rsp,%rdi
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
call   1030 <memcpy@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
define void @parseXML(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%9 = load i8*, i8** %3
store i8* %9, i8** %5
%10 = load i32, i32* %4
%11 = zext i32 %10 to i64
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %6
%13 = alloca i8, i64 %11
store i64 %11, i64* %7
%14 = load i8*, i8** %5
%15 = load i32, i32* %4
%16 = call i32 @memcpy(i8* %13, i8* %14, i32 %15)
%17 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
define void @parseXML(i8* %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = alloca i8, i64 %3
%5 = call i32 @memcpy(i8* %4, i8* %0, i32 %1)
ret void
}
/* Variables and functions */
size_t strlen(char *);
char *trim_crlf(char *str) {
  size_t n = strlen(str);
  str[n - 2] = '\0';
  return str;
}


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

x86 assembly (clang, -O2):
<trim_crlf>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
movb   $0x0,-0x2(%rax,%rbx,1)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @trim_crlf(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
store i64 %5, i64* %3
%6 = load i8*, i8** %2
%7 = load i64, i64* %3
%8 = sub i64 %7, 2
%9 = getelementptr inbounds i8, i8* %6, i64 %8
store i8 0, i8* %9
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
define i8* @trim_crlf(i8* returned %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, -2
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %4
ret i8* %0
}
char identichar(char c) { return c; }


x86 assembly (clang, -O0):
<identichar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @identichar(i8 returned signext %0) {
ret i8 %0
}
/* Variables and functions */
int /*<<< orphan*/ _cause(int /*<<< orphan*/);
void _cause_ukn() { _cause(0); }


x86 assembly (clang, -O0):
<_cause_ukn>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <_cause@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cause_ukn>:
xor    %edi,%edi
jmp    1030 <_cause@plt>

LLVM IR (-O0):
define void @_cause_ukn() {
%1 = call i32 @_cause(i32 0)
ret void
}

LLVM IR (-O2):
define void @_cause_ukn() {
%1 = tail call i32 @_cause(i32 0)
ret void
}
/* Type definitions */
struct _stor_lookup_next_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct _stor_lookup_next_req *);
void stor_lookup_next_req_free(struct _stor_lookup_next_req *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<stor_lookup_next_req_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct._stor_lookup_next_req = type { i32 }
define void @stor_lookup_next_req_free(%struct._stor_lookup_next_req* nocapture %0) {
%2 = tail call i32 @free(%struct._stor_lookup_next_req* %0)
ret void
}