xunge/DecIR huggingface dataset:
void swap(int *p1, int *p2) {
  int t;
  t = *p1;
  *p1 = *p2;
  *p2 = t;
}


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

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

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
main() {
  int len;
  char line[1000];
  while ((len = getline(line, 1000)) > 0)
    if (len > 80) {
      printf("%s", line);
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1171 <main+0x51>
cmpl   $0x50,-0x8(%rbp)
jle    116c <main+0x4c>
lea    -0x3f0(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %eax,%eax
jle    1173 <main+0x53>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %eax,%eax
jle    1173 <main+0x53>
cmp    $0x51,%eax
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %14, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @getline(i8* %5, i32 1000)
store i32 %6, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 80
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %8
br label %4
15: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 80
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @getline(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
/* Variables and functions */
long _xte_utf8_strlen(char const *);
long xte_cstring_length(char const *in_string) {
  return _xte_utf8_strlen(in_string);
}


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

x86 assembly (clang, -O2):
<xte_cstring_length>:
jmp    1030 <_xte_utf8_strlen@plt>

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

LLVM IR (-O2):
define i64 @xte_cstring_length(i8* %0) {
%2 = tail call i64 @_xte_utf8_strlen(i8* %0)
ret i64 %2
}
/* Variables and functions */
int pigpio_command(int, int, int, int /*<<< orphan*/, int);
int wave_get_max_micros(int pi) { return pigpio_command(pi, 34, 2, 0, 1); }


x86 assembly (clang, -O0):
<wave_get_max_micros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x22,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wave_get_max_micros>:
mov    $0x22,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

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

LLVM IR (-O2):
define i32 @wave_get_max_micros(i32 %0) {
%2 = tail call i32 @pigpio_command(i32 %0, i32 34, i32 2, i32 0, i32 1)
ret i32 %2
}
/* Variables and functions */
int initialize_empty_project(int, char **);
int main(int argc, char *argv[]) {
  return initialize_empty_project(argc, argv);
}


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <initialize_empty_project@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <initialize_empty_project@plt>

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 i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @initialize_empty_project(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @initialize_empty_project(i32 %0, i8** %1)
ret i32 %3
}
double fabs(double x) { return (x < 0 ? -x : x); }


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <fabs+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <fabs+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
long double __ESBMC_fabsl(long double);
long double fabsl(long double d) { return __ESBMC_fabsl(d); }


x86 assembly (clang, -O0):
<fabsl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__ESBMC_fabsl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsl>:
jmp    1030 <__ESBMC_fabsl@plt>

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

LLVM IR (-O2):
define x86_fp80 @fabsl(x86_fp80 %0) {
%2 = tail call x86_fp80 @__ESBMC_fabsl(x86_fp80 %0)
ret x86_fp80 %2
}
short ttohs(short val) { return (val); }


x86 assembly (clang, -O0):
<ttohs>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i16 @ttohs(i16 returned signext %0) {
ret i16 %0
}
/* Variables and functions */
int f94(int *);
int f95(int *p) { return f94(p); }


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

x86 assembly (clang, -O2):
<f95>:
jmp    1030 <f94@plt>

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

LLVM IR (-O2):
define i32 @f95(i32* %0) {
%2 = tail call i32 @f94(i32* %0)
ret i32 %2
}
int main() {
  int *p, a, b, c, d;
  if (c)
    p = &a;
  printf("%u %u", p, &p);
  p = fn();
  printf("%u %u", p, &p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1141 <main+0x21>
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb4(%rip),%rdi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <fn@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe91(%rip),%rdi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <fn@plt>
movslq %eax,%rsi
mov    %rsi,(%rsp)
mov    %r14,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%u %u\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
store i32* %3, i32** %2
br label %10
10: ; preds = %9, %0
%11 = load i32*, i32** %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %11, i32** %2)
%13 = call i32 (...) @fn()
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
store i32* %15, i32** %2
%16 = load i32*, i32** %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %16, i32** %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%u %u\00"
define i32 @main() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* undef, i32** %1)
%4 = call i32 (...) @fn()
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %6, i32** %1)
ret i32 0
}
void f14(void) {
a:
  ({
    goto a;
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  0;
}


x86 assembly (clang, -O0):
<f14>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <f14+0x4>

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

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

LLVM IR (-O2):
define void @f14() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
size_t mbrtowc(int /*<<< orphan*/ *, char const *, size_t,
               int /*<<< orphan*/ *);
size_t mbrlen(const char *s, size_t n, mbstate_t *ps) {
  static mbstate_t internal;
  return mbrtowc(NULL, s, n, ps ?: &internal);
}


x86 assembly (clang, -O0):
<mbrlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1153 <mbrlen+0x43>
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    1163 <mbrlen+0x53>
lea    0x2ed2(%rip),%rax
mov    %rax,-0x38(%rbp)
jmp    1163 <mbrlen+0x53>
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <mbrtowc@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbrlen>:
mov    %rsi,%rax
mov    %rdi,%rsi
test   %rdx,%rdx
lea    0x2f0c(%rip),%rcx
cmovne %rdx,%rcx
xor    %edi,%edi
mov    %rax,%rdx
jmp    1030 <mbrtowc@plt>

LLVM IR (-O0):
@mbrlen.internal = internal global i32 0
define i64 @mbrlen(i8* %0, i64 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i32*, i32** %6
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %12
11: ; preds = %3
br label %13
12: ; preds = %3
br label %13
13: ; preds = %12, %11
%14 = phi i32* [ %9, %11 ], [ @mbrlen.internal, %12 ]
%15 = call i64 @mbrtowc(i32* null, i8* %7, i64 %8, i32* %14)
ret i64 %15
}

LLVM IR (-O2):
@mbrlen.internal = internal global i32 0
define i64 @mbrlen(i8* %0, i64 %1, i32* %2) {
%4 = icmp eq i32* %2, null
%5 = select i1 %4, i32* @mbrlen.internal, i32* %2
%6 = tail call i64 @mbrtowc(i32* null, i8* %0, i64 %1, i32* %5)
ret i64 %6
}
/* Variables and functions */
double DayFromYear(int);
double TimeFromYear(int y) {
  return DayFromYear(y) * (((24.0 * 60.0) * 60.0) * 1000.0);
}


x86 assembly (clang, -O0):
<TimeFromYear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <DayFromYear@plt>
movsd  0xed5(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimeFromYear>:
push   %rax
call   1030 <DayFromYear@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @TimeFromYear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call double @DayFromYear(i32 %3)
%5 = fmul double %4, 8.640000e+07
ret double %5
}

LLVM IR (-O2):
define double @TimeFromYear(i32 %0) {
%2 = tail call double @DayFromYear(i32 %0)
%3 = fmul double %2, 8.640000e+07
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, float const *, int);
void m4f_copy_m4fo(const float *m, float *result) {
  memcpy(result, m, 16 * sizeof(float));
}


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

x86 assembly (clang, -O2):
<m4f_copy_m4fo>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x40,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @m4f_copy_m4fo(float* %0, float* %1) {
%3 = tail call i32 @memcpy(float* %1, float* %0, i32 64)
ret void
}
void bump() {}


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

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

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

LLVM IR (-O2):
define void @bump() {
ret void
}
void jz4780_smp_init(void) {}


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

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

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

LLVM IR (-O2):
define void @jz4780_smp_init() {
ret void
}
void rmvi_(dx, dy, dz) int *dx, *dy, *dz;
{ rmv((float)*dx, (float)*dy, (float)*dz); }


x86 assembly (clang, -O0):
<rmvi_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
cvtsi2ssl (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x18(%rbp),%rax
cvtsi2ssl (%rax),%xmm2
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
call   1030 <rmv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmvi_>:
cvtsi2ssl (%rdi),%xmm0
cvtsi2ssl (%rsi),%xmm1
cvtsi2ssl (%rdx),%xmm2
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
jmp    1030 <rmv@plt>

LLVM IR (-O0):
define void @rmvi_(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* %7
%9 = sitofp i32 %8 to float
%10 = fpext float %9 to double
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = sitofp i32 %12 to float
%14 = fpext float %13 to double
%15 = load i32*, i32** %6
%16 = load i32, i32* %15
%17 = sitofp i32 %16 to float
%18 = fpext float %17 to double
%19 = call i32 (double, double, double, ...) bitcast (i32 (...)* @rmv to i32 (double, double, double, ...)*)(double %10, double %14, double %18)
ret void
}

LLVM IR (-O2):
define void @rmvi_(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = sitofp i32 %4 to float
%6 = fpext float %5 to double
%7 = load i32, i32* %1
%8 = sitofp i32 %7 to float
%9 = fpext float %8 to double
%10 = load i32, i32* %2
%11 = sitofp i32 %10 to float
%12 = fpext float %11 to double
%13 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @rmv to i32 (double, double, double, ...)*)(double %6, double %9, double %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errmalloc();
void xcmemcheck(void *ptr) {
  if (ptr == NULL)
    errmalloc();
}


x86 assembly (clang, -O0):
<xcmemcheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112e <xcmemcheck+0x1e>
mov    $0x0,%al
call   1030 <errmalloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcmemcheck>:
test   %rdi,%rdi
je     1116 <xcmemcheck+0x6>
ret
xor    %eax,%eax
jmp    1030 <errmalloc@plt>

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

LLVM IR (-O2):
define void @xcmemcheck(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @errmalloc()
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nop();
int main(void) {
  nop();
  return 42;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nop()
ret i32 42
}
int main() {
  int a, b, c, d, e, f, g, h, i, z = 0;
  a = z++;
  b = z + 1;
  c = z++;
  d = z++;
  e = z++;
  f = z + 1;
  g = z++;
  h = z + 1;
  i = z++;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x28(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x28(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x28(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x28(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x28(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x28(%rbp)
mov    %eax,-0x24(%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
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %10
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
store i32 %12, i32* %10
store i32 %11, i32* %1
%13 = load i32, i32* %10
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
%15 = load i32, i32* %10
%16 = add nsw i32 %15, 1
store i32 %16, i32* %10
store i32 %15, i32* %3
%17 = load i32, i32* %10
%18 = add nsw i32 %17, 1
store i32 %18, i32* %10
store i32 %17, i32* %4
%19 = load i32, i32* %10
%20 = add nsw i32 %19, 1
store i32 %20, i32* %10
store i32 %19, i32* %5
%21 = load i32, i32* %10
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
%23 = load i32, i32* %10
%24 = add nsw i32 %23, 1
store i32 %24, i32* %10
store i32 %23, i32* %7
%25 = load i32, i32* %10
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
%27 = load i32, i32* %10
%28 = add nsw i32 %27, 1
store i32 %28, i32* %10
store i32 %27, i32* %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int *fun_2(int *p) {
  *--p = 1;
  *--p = 1;
  return p;
}


x86 assembly (clang, -O0):
<fun_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x8(%rbp)
movl   $0x1,-0x4(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x8(%rbp)
movl   $0x1,-0x4(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_2>:
movabs $0x100000001,%rax
mov    %rax,-0x8(%rdi)
lea    -0x8(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @fun_2(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i32 -1
store i32* %4, i32** %2
store i32 1, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i32 -1
store i32* %6, i32** %2
store i32 1, i32* %6
%7 = load i32*, i32** %2
ret i32* %7
}

LLVM IR (-O2):
define i32* @fun_2(i32* writeonly %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 -1
store i32 1, i32* %2
%3 = getelementptr inbounds i32, i32* %0, i64 -2
store i32 1, i32* %3
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ read_GIF_header(char *);
int /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    usage(argv[0]);
  }
  read_GIF_header(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)
cmpl   $0x2,-0x8(%rbp)
je     114c <main+0x2c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <read_GIF_header@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
je     1131 <main+0x11>
mov    (%rbx),%rdi
call   1040 <usage@plt>
mov    0x8(%rbx),%rdi
call   1030 <read_GIF_header@plt>
xor    %eax,%eax
pop    %rbx
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 i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @usage(i8* %11)
br label %13
13: ; preds = %8, %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @read_GIF_header(i8* %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @usage(i8* %5)
br label %7
7: ; preds = %4, %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @read_GIF_header(i8* %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(void) {
  int halfmaxval = 0x7fffffff / 2 + 1;
  int maxval = halfmaxval - 1 + halfmaxval;
  if (maxval != 0x7fffffff)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x40000000,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x7fffffff,-0xc(%rbp)
je     1146 <main+0x36>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1073741824, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = load i32, i32* %2
%7 = add nsw i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 2147483647
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
__attribute__((no)) int bar(int y) {
  int d = y;
  if (y > 11)
    d += 2;
  else
    d -= 3;
  return d;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xb,-0x4(%rbp)
jle    1125 <bar+0x25>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <bar+0x2e>
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
xor    %eax,%eax
cmp    $0xc,%edi
setge  %al
lea    (%rax,%rax,4),%eax
add    %edi,%eax
add    $0xfffffffd,%eax
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = icmp sgt i32 %0, 11
%3 = select i1 %2, i32 2, i32 -3
%4 = add nsw i32 %3, %0
ret i32 %4
}
double EtoRH(double Es, double E) {
  double RH = 100 * E / Es;
  return RH;
}


x86 assembly (clang, -O0):
<EtoRH>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<EtoRH>:
mulsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @EtoRH(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = fmul double 1.000000e+02, %6
%8 = load double, double* %3
%9 = fdiv double %7, %8
store double %9, double* %5
%10 = load double, double* %5
ret double %10
}

LLVM IR (-O2):
define double @EtoRH(double %0, double %1) {
%3 = fmul double %1, 1.000000e+02
%4 = fdiv double %3, %0
ret double %4
}
void s5p_jpeg_setname(char *name) {}


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

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

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

LLVM IR (-O2):
define void @s5p_jpeg_setname(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void big_little(void) {
  uint16_t num = 1;
  uint8_t *check = (uint8_t *)(&num);
  if (*check == 0) {
    printf("little\n");
  } else {
    printf("big\n");
  }
}


x86 assembly (clang, -O0):
<big_little>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1146 <big_little+0x36>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
jmp    1152 <big_little+0x42>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"little\0A\00"
@.str.1 = [5 x i8] c"big\0A\00"
define void @big_little() {
%1 = alloca i32
%2 = alloca i64*
store i32 1, i32* %1
%3 = bitcast i32* %1 to i64*
store i64* %3, i64** %2
%4 = load i64*, i64** %2
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
@str = [4 x i8] c"big\00"
define void @big_little() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
char *ft_strcpy(char *s1, const char *s2) {
  char *save;
  save = s1;
  while (*s2)
    *s1++ = *s2++;
  *s1 = *s2;
  return (save);
}


x86 assembly (clang, -O0):
<ft_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <ft_strcpy+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1114 <ft_strcpy+0x14>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <ft_strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <ft_strcpy+0x20>
movb   $0x0,(%rdx)
ret

LLVM IR (-O0):
define i8* @ft_strcpy(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** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %11, %2
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %4
%14 = load i8, i8* %12
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
store i8 %14, i8* %15
br label %7
17: ; preds = %7
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = load i8*, i8** %3
store i8 %19, i8* %20
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
define i8* @ft_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ calificar();
int main() {
  calificar();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @calificar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
main() {
  char comando[80] = "konsole";
  while (1) {
    system(comando);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x50,%edx
call   1040 <memcpy@plt>
lea    -0x60(%rbp),%rdi
call   1030 <system@plt>
jmp    1144 <main+0x24>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
movaps 0xf24(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xf08(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeec(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <system@plt>
jmp    1160 <main+0x50>

LLVM IR (-O0):
@__const.main.comando = [80 x i8] c"konsole\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
store i32 0, i32* %1
%3 = bitcast [80 x i8]* %2 to i8*
br label %4
4: ; preds = %0, %4
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%6 = call i32 @system(i8* %5)
br label %4
}

LLVM IR (-O2):
@__const.main.comando = [80 x i8] c"konsole\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = call i32 @system(i8* %2)
br label %3
}
/* Variables and functions */
float sqrtf(float);
float nvg__sqrtf(float a) { return sqrtf(a); }


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

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

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

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


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @embeddedsystemmurecursivefunction()
ret i32 0
}
void UARTFIFOLevelSet(unsigned int baseAdd, unsigned int rxLevel) {
  (*((volatile unsigned int *)(baseAdd + (0x8)))) =
      ((rxLevel & ((0x000000C0u))) | (0x00000001u));
}


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

x86 assembly (clang, -O2):
<UARTFIFOLevelSet>:
and    $0xc0,%esi
or     $0x1,%esi
add    $0x8,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @UARTFIFOLevelSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 192
%7 = or i32 %6, 1
%8 = load i32, i32* %3
%9 = add i32 %8, 8
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store volatile i32 %7, i32* %11
ret void
}

LLVM IR (-O2):
define void @UARTFIFOLevelSet(i32 %0, i32 %1) {
%3 = and i32 %1, 192
%4 = or i32 %3, 1
%5 = add i32 %0, 8
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 %4, i32* %7
ret void
}
/* Variables and functions */
int vmcoreinfo_item_ulong(unsigned long *, char *, char const *, int);
int dfi_vmcoreinfo_symbol(unsigned long *addr, const char *sym) {
  return vmcoreinfo_item_ulong(addr, "SYMBOL", sym, 16);
}


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

x86 assembly (clang, -O2):
<dfi_vmcoreinfo_symbol>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x10,%ecx
jmp    1030 <vmcoreinfo_item_ulong@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"SYMBOL\00"
define i32 @dfi_vmcoreinfo_symbol(i64* %0, i8* %1) {
%3 = tail call i32 @vmcoreinfo_item_ulong(i64* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i32 16)
ret i32 %3
}
/* Variables and functions */
int partition(int *, int, int);
void qsort(int a[], int lo, int hi) {
  int j;
  if (hi <= lo)
    return;
  j = partition(a, lo, hi);
  qsort(a, lo, j - 1);
  qsort(a, j + 1, hi);
}


x86 assembly (clang, -O0):
<qsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1143 <qsort+0x23>
jmp    1179 <qsort+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <qsort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <qsort@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @qsort(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %1
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @qsort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
int main() {
  int a, b, c;
  a = 12;
  b = a + 12;
  c = a - b + 5;
  if (a > 13)
    if (a > c) {
      a = b * 4 + 5;
    } else {
      a = 5 + 6;
      b = c + 4 * a;
    }
  a = c + 8;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xc,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0xd,-0x8(%rbp)
jle    1168 <main+0x68>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    114e <main+0x4e>
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
add    $0x5,%eax
mov    %eax,-0x8(%rbp)
jmp    1163 <main+0x63>
movl   $0xb,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1168 <main+0x68>
mov    -0x10(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x8(%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
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 12, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 12
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 5
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = icmp sgt i32 %11, 13
br i1 %12, label %13, label %27
13: ; preds = %0
%14 = load i32, i32* %2
%15 = load i32, i32* %4
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = load i32, i32* %3
%19 = mul nsw i32 %18, 4
%20 = add nsw i32 %19, 5
store i32 %20, i32* %2
br label %26
21: ; preds = %13
store i32 11, i32* %2
%22 = load i32, i32* %4
%23 = load i32, i32* %2
%24 = mul nsw i32 4, %23
%25 = add nsw i32 %22, %24
store i32 %25, i32* %3
br label %26
26: ; preds = %21, %17
br label %27
27: ; preds = %26, %0
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 8
store i32 %29, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void usage(char *argv0) {
  fprintf(stdout, "%s [starting value] [iterations]\n", argv0);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [34 x i8] c"%s [starting value] [iterations]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [34 x i8] c"%s [starting value] [iterations]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRD2_set(void) { return U_WMRCORENONE_set("U_WMRD2"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRD2\00"
define i8* @U_WMRD2_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRD2\00"
define i8* @U_WMRD2_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
int ls_cost_nm10_n_out(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @ls_cost_nm10_n_out() {
ret i32 2
}

LLVM IR (-O2):
define i32 @ls_cost_nm10_n_out() {
ret i32 2
}