xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int x = 10;
  int *p;
  p = &x;
  *p = 20;
  printf("Value of x: %d\n", x);
  printf("Address of x: %p\n", &x);
  printf("Address of x: %p\n", p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x14,(%rax)
mov    -0x8(%rbp),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x14,0x4(%rsp)
lea    0xedd(%rip),%rdi
mov    $0x14,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%rbx
lea    0x4(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Value of x: %d\0A\00"
@.str.1 = [18 x i8] c"Address of x: %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 10, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
store i32 20, i32* %4
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = load i32*, i32** %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Value of x: %d\0A\00"
@.str.1 = [18 x i8] c"Address of x: %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 20, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 20)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double truncl(long double x) { return __infer_nondet_long_double(); }


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

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

LLVM IR (-O0):
define x86_fp80 @truncl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @truncl(x86_fp80 %0) {
%2 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ ldh_n_a();
void opcode_e0() { ldh_n_a(); }


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

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

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

LLVM IR (-O2):
define void @opcode_e0() {
%1 = tail call i32 (...) @ldh_n_a()
ret void
}
OP(ed, ac) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int faa_system_value();
int foo_system_value();
int bar_built_value(int in) {
  return faa_system_value() + foo_system_value() + in;
}


x86 assembly (clang, -O0):
<bar_built_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <faa_system_value@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <foo_system_value@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_built_value>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <faa_system_value@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <foo_system_value@plt>
add    %ebx,%ebp
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bar_built_value(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @faa_system_value()
%4 = call i32 (...) @foo_system_value()
%5 = add nsw i32 %3, %4
%6 = load i32, i32* %2
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @bar_built_value(i32 %0) {
%2 = tail call i32 (...) @faa_system_value()
%3 = tail call i32 (...) @foo_system_value()
%4 = add i32 %2, %0
%5 = add i32 %4, %3
ret i32 %5
}
unsigned int random_u32(unsigned int seed) { return seed; }


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

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

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

LLVM IR (-O2):
define i32 @random_u32(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ memcpy(char *, char *, int);
char *stringDuplicate(char *src, int32_t size) {
  char *str = (char *)calloc(size + 1, sizeof(char));
  memcpy(str, src, size);
  str[size] = 0;
  return str;
}


x86 assembly (clang, -O0):
<stringDuplicate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringDuplicate>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1040 <memcpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @stringDuplicate(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = call i64 @calloc(i32 %7, i32 1)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = call i32 @memcpy(i8* %10, i8* %11, i32 %12)
%14 = load i8*, i8** %5
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 0, i8* %17
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
define i8* @stringDuplicate(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i64 @calloc(i32 %3, i32 1)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %1)
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void cleanBufferKeys(char **values, unsigned int size) {
  for (unsigned int i = 0; i < size; i++) {
    free(values[i]);
  }
}


x86 assembly (clang, -O0):
<cleanBufferKeys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1150 <cleanBufferKeys+0x40>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <cleanBufferKeys+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanBufferKeys>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1142 <cleanBufferKeys+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <cleanBufferKeys+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @cleanBufferKeys(i8** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @free(i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
unsigned long get_error_values(int, int /*<<< orphan*/, char const **, int *,
                               char const **, int *);
unsigned long ERR_get_error_line_data(const char **file, int *line,
                                      const char **data, int *flags) {
  return (get_error_values(1, 0, file, line, data, flags));
}


x86 assembly (clang, -O0):
<ERR_get_error_line_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <get_error_values@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ERR_get_error_line_data>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <get_error_values@plt>

LLVM IR (-O0):
define i64 @ERR_get_error_line_data(i8** %0, i32* %1, i8** %2, i32* %3) {
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8**
%8 = alloca i32*
store i8** %0, i8*** %5
store i32* %1, i32** %6
store i8** %2, i8*** %7
store i32* %3, i32** %8
%9 = load i8**, i8*** %5
%10 = load i32*, i32** %6
%11 = load i8**, i8*** %7
%12 = load i32*, i32** %8
%13 = call i64 @get_error_values(i32 1, i32 0, i8** %9, i32* %10, i8** %11, i32* %12)
ret i64 %13
}

LLVM IR (-O2):
define i64 @ERR_get_error_line_data(i8** %0, i32* %1, i8** %2, i32* %3) {
%5 = tail call i64 @get_error_values(i32 1, i32 0, i8** %0, i32* %1, i8** %2, i32* %3)
ret i64 %5
}
/* Variables and functions */
double calcMeanObliquityOfEcliptic(double);
double cos(int /*<<< orphan*/);
int /*<<< orphan*/ degToRad(double);
double calcObliquityCorrection(double t) {
  double e0 = calcMeanObliquityOfEcliptic(t);
  double omega = 125.04 - 1934.136 * t;
  double e = e0 + 0.00256 * cos(degToRad(omega));
  return e;
}


x86 assembly (clang, -O0):
<calcObliquityCorrection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <calcMeanObliquityOfEcliptic@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeaf(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeab(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <degToRad@plt>
mov    %eax,%edi
call   1040 <cos@plt>
movsd  -0x28(%rbp),%xmm1
movsd  0xe6a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcObliquityCorrection>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <calcMeanObliquityOfEcliptic@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xead(%rip),%xmm0
addsd  0xead(%rip),%xmm0
call   1050 <degToRad@plt>
mov    %eax,%edi
call   1040 <cos@plt>
mulsd  0xea1(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @calcObliquityCorrection(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
%7 = call double @calcMeanObliquityOfEcliptic(double %6)
store double %7, double* %3
%8 = load double, double* %2
%9 = call double @llvm.fmuladd.f64(double 0xC09E388B43958106, double %8, double 1.250400e+02)
store double %9, double* %4
%10 = load double, double* %3
%11 = load double, double* %4
%12 = call i32 @degToRad(double %11)
%13 = call double @cos(i32 %12)
%14 = call double @llvm.fmuladd.f64(double 2.560000e-03, double %13, double %10)
store double %14, double* %5
%15 = load double, double* %5
ret double %15
}

LLVM IR (-O2):
define double @calcObliquityCorrection(double %0) {
%2 = tail call double @calcMeanObliquityOfEcliptic(double %0)
%3 = tail call double @llvm.fmuladd.f64(double %0, double 0xC09E388B43958106, double 1.250400e+02)
%4 = tail call i32 @degToRad(double %3)
%5 = tail call double @cos(i32 %4)
%6 = tail call double @llvm.fmuladd.f64(double %5, double 2.560000e-03, double %2)
ret double %6
}
int dist_get_rank() { return 0; }


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

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

LLVM IR (-O0):
define i32 @dist_get_rank() {
ret i32 0
}

LLVM IR (-O2):
define i32 @dist_get_rank() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ end_measurement();
float pi(double);
int /*<<< orphan*/ print_float(float);
int /*<<< orphan*/ start_measurement();
int main() {
  start_measurement();
  float res = pi(2000.0);
  end_measurement();
  print_float(res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <start_measurement@plt>
movsd  0xea2(%rip),%xmm0
call   1040 <pi@plt>
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <end_measurement@plt>
movss  -0x8(%rbp),%xmm0
call   1050 <print_float@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <start_measurement@plt>
movsd  0xeb0(%rip),%xmm0
call   1040 <pi@plt>
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <end_measurement@plt>
movss  0x4(%rsp),%xmm0
call   1050 <print_float@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (...) @start_measurement()
%4 = call float @pi(double 2.000000e+03)
store float %4, float* %2
%5 = call i32 (...) @end_measurement()
%6 = load float, float* %2
%7 = call i32 @print_float(float %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @start_measurement()
%2 = tail call float @pi(double 2.000000e+03)
%3 = tail call i32 (...) @end_measurement()
%4 = tail call i32 @print_float(float %2)
ret i32 0
}
int exact_square(int number) {
  int counter, square = 0;
  for (counter = 0; counter < number; counter++) {
    if (counter * counter == number) {
      square = 1;
      break;
    }
  }
  return square;
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1150 <exact_square+0x50>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    113d <exact_square+0x3d>
movl   $0x1,-0xc(%rbp)
jmp    1150 <exact_square+0x50>
jmp    1142 <exact_square+0x42>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <exact_square+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
xor    %eax,%eax
test   %edi,%edi
jle    1128 <exact_square+0x28>
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%ecx
imul   %eax,%ecx
cmp    %edi,%ecx
je     1123 <exact_square+0x23>
add    $0x1,%eax
cmp    %eax,%edi
jne    1110 <exact_square+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @exact_square(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 0, %1 ]
%7 = mul nsw i32 %6, %6
%8 = icmp eq i32 %7, %0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %3, %5, %1
%11 = phi i32 [ 0, %1 ], [ 1, %5 ], [ 0, %3 ]
ret i32 %11
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int quaddobl_collapse_diagonal(int k, int d) {
  int a[2], *b, fail;
  double *c;
  a[0] = k;
  a[1] = d;
  fail = _ada_use_c2phc(312, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<quaddobl_collapse_diagonal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x138,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quaddobl_collapse_diagonal>:
push   %rax
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x138,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @quaddobl_collapse_diagonal(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i32]
%6 = alloca i32*
%7 = alloca i32
%8 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %9, i32* %10
%11 = load i32, i32* %4
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %11, i32* %12
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%14 = load i32*, i32** %6
%15 = load double*, double** %8
%16 = call i32 @_ada_use_c2phc(i32 312, i32* %13, i32* %14, double* %15)
store i32 %16, i32* %7
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @quaddobl_collapse_diagonal(i32 %0, i32 %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 %0, i32* %5
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %1, i32* %6
%7 = call i32 @_ada_use_c2phc(i32 312, i32* %5, i32* undef, double* undef)
ret i32 %7
}
/* Variables and functions */
scalar_t__ get8(char const *);
unsigned short get16(const char *ptr) {
  return (unsigned short)get8(&ptr[0]) << 8 | (unsigned short)get8(&ptr[2]);
}


x86 assembly (clang, -O0):
<get16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get8@plt>
movzwl %ax,%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1030 <get8@plt>
mov    %rax,%rcx
mov    -0xc(%rbp),%eax
movzwl %cx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get16>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <get8@plt>
mov    %rax,%r14
shl    $0x8,%r14d
add    $0x2,%rbx
mov    %rbx,%rdi
call   1030 <get8@plt>
or     %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define zeroext i16 @get16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = call i64 @get8(i8* %4)
%6 = trunc i64 %5 to i16
%7 = zext i16 %6 to i32
%8 = shl i32 %7, 8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = call i64 @get8(i8* %10)
%12 = trunc i64 %11 to i16
%13 = zext i16 %12 to i32
%14 = or i32 %8, %13
%15 = trunc i32 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @get16(i8* %0) {
%2 = tail call i64 @get8(i8* %0)
%3 = trunc i64 %2 to i16
%4 = shl i16 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = tail call i64 @get8(i8* %5)
%7 = trunc i64 %6 to i16
%8 = or i16 %4, %7
ret i16 %8
}
/* Variables and functions */
int aes_sub_bytes(int const **, char **);
int aes_inv_sub_bytes(const int box[][16], char state[][4]) {
  return aes_sub_bytes(box, state);
}


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

x86 assembly (clang, -O2):
<aes_inv_sub_bytes>:
jmp    1030 <aes_sub_bytes@plt>

LLVM IR (-O0):
define i32 @aes_inv_sub_bytes([16 x i32]* %0, [4 x i8]* %1) {
%3 = alloca [16 x i32]*
%4 = alloca [4 x i8]*
store [16 x i32]* %0, [16 x i32]** %3
store [4 x i8]* %1, [4 x i8]** %4
%5 = load [16 x i32]*, [16 x i32]** %3
%6 = bitcast [16 x i32]* %5 to i32**
%7 = load [4 x i8]*, [4 x i8]** %4
%8 = bitcast [4 x i8]* %7 to i8**
%9 = call i32 @aes_sub_bytes(i32** %6, i8** %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @aes_inv_sub_bytes([16 x i32]* %0, [4 x i8]* %1) {
%3 = bitcast [16 x i32]* %0 to i32**
%4 = bitcast [4 x i8]* %1 to i8**
%5 = tail call i32 @aes_sub_bytes(i32** %3, i8** %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
FILE *fopen_tmp(void) {
  FILE *fp = fopen(".tmpdisk", "w");
  if (fp == NULL) {
    perror(".tmpdisk");
    exit(1);
  }
  return fp;
}


x86 assembly (clang, -O0):
<fopen_tmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec3(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1170 <fopen_tmp+0x40>
lea    0xe9f(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopen_tmp>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1030 <fopen@plt>
test   %rax,%rax
je     114b <fopen_tmp+0x1b>
pop    %rcx
ret
lea    0xeae(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c".tmpdisk\00"
@.str.1 = [2 x i8] c"w\00"
define i32* @fopen_tmp() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
ret i32* %9
}

LLVM IR (-O2):
@.str = [9 x i8] c".tmpdisk\00"
@.str.1 = [2 x i8] c"w\00"
define noalias i32* @fopen_tmp() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
ret i32* %1
}
/* Type definitions */
struct xfs_mount {
  int dummy;
};
struct xfs_dir2_data_hdr {
  int dummy;
};
struct xfs_dir2_data_entry {
  int dummy;
};

/* Variables and functions */
int xfs_dir3_data_dotdot_offset(struct xfs_mount *);
struct xfs_dir2_data_entry *
xfs_dir3_data_dotdot_entry_p(struct xfs_mount *mp,
                             struct xfs_dir2_data_hdr *hdr) {
  return (struct xfs_dir2_data_entry *)((char *)hdr +
                                        xfs_dir3_data_dotdot_offset(mp));
}


x86 assembly (clang, -O0):
<xfs_dir3_data_dotdot_entry_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <xfs_dir3_data_dotdot_offset@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfs_dir3_data_dotdot_entry_p>:
push   %rbx
mov    %rsi,%rbx
call   1030 <xfs_dir3_data_dotdot_offset@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.xfs_dir2_data_entry = type { i32 }
%struct.xfs_mount = type { i32 }
%struct.xfs_dir2_data_hdr = type { i32 }
define %struct.xfs_dir2_data_entry* @xfs_dir3_data_dotdot_entry_p(%struct.xfs_mount* %0, %struct.xfs_dir2_data_hdr* %1) {
%3 = alloca %struct.xfs_mount*
%4 = alloca %struct.xfs_dir2_data_hdr*
store %struct.xfs_mount* %0, %struct.xfs_mount** %3
store %struct.xfs_dir2_data_hdr* %1, %struct.xfs_dir2_data_hdr** %4
%5 = load %struct.xfs_dir2_data_hdr*, %struct.xfs_dir2_data_hdr** %4
%6 = bitcast %struct.xfs_dir2_data_hdr* %5 to i8*
%7 = load %struct.xfs_mount*, %struct.xfs_mount** %3
%8 = call i32 @xfs_dir3_data_dotdot_offset(%struct.xfs_mount* %7)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = bitcast i8* %10 to %struct.xfs_dir2_data_entry*
ret %struct.xfs_dir2_data_entry* %11
}

LLVM IR (-O2):
%struct.xfs_dir2_data_entry = type { i32 }
%struct.xfs_mount = type { i32 }
%struct.xfs_dir2_data_hdr = type { i32 }
define %struct.xfs_dir2_data_entry* @xfs_dir3_data_dotdot_entry_p(%struct.xfs_mount* %0, %struct.xfs_dir2_data_hdr* readnone %1) {
%3 = bitcast %struct.xfs_dir2_data_hdr* %1 to i8*
%4 = tail call i32 @xfs_dir3_data_dotdot_offset(%struct.xfs_mount* %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %3, i64 %5
%7 = bitcast i8* %6 to %struct.xfs_dir2_data_entry*
ret %struct.xfs_dir2_data_entry* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void *clean(void *arg) {
  printf("cleanup: %s\n", (char *)arg);
  return (void *)0;
}


x86 assembly (clang, -O0):
<clean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"cleanup: %s\0A\00"
define i8* @clean(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* null
}

LLVM IR (-O2):
@.str = [13 x i8] c"cleanup: %s\0A\00"
define noalias i8* @clean(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* null
}
/* Variables and functions */
int clear();
int cpu_time();
int showCPUinfo();
int showHelp(char *);
int exec(int cmdno, char *cmdline) {
  int ret;
  switch (cmdno) {
  case 1:
    ret = showHelp(cmdline);
    break;
  case 2:
    ret = clear();
    break;
  case 3:
    break;
  case 4:
    ret = showCPUinfo();
    break;
  case 5:
    ret = cpu_time();
    break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x4,%eax
ja     11b6 <exec+0x76>
mov    -0x20(%rbp),%rax
lea    0xe91(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rdi
call   1030 <showHelp@plt>
mov    %eax,-0x14(%rbp)
jmp    11b6 <exec+0x76>
mov    $0x0,%al
call   1050 <clear@plt>
mov    %eax,-0x14(%rbp)
jmp    11b6 <exec+0x76>
jmp    11b6 <exec+0x76>
mov    $0x0,%al
call   1040 <showCPUinfo@plt>
mov    %eax,-0x14(%rbp)
jmp    11b6 <exec+0x76>
mov    $0x0,%al
call   1060 <cpu_time@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec>:
add    $0xffffffff,%edi
cmp    $0x4,%edi
ja     1167 <exec+0x27>
lea    0xeb1(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    %rsi,%rdi
jmp    1030 <showHelp@plt>
xor    %eax,%eax
jmp    1050 <clear@plt>
ret
xor    %eax,%eax
jmp    1040 <showCPUinfo@plt>
xor    %eax,%eax
jmp    1060 <cpu_time@plt>

LLVM IR (-O0):
define i32 @exec(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
switch i32 %6, label %17 [
i32 1, label %7
i32 2, label %10
i32 3, label %12
i32 4, label %13
i32 5, label %15
]
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @showHelp(i8* %8)
store i32 %9, i32* %5
br label %17
10: ; preds = %2
%11 = call i32 (...) @clear()
store i32 %11, i32* %5
br label %17
12: ; preds = %2
br label %17
13: ; preds = %2
%14 = call i32 (...) @showCPUinfo()
store i32 %14, i32* %5
br label %17
15: ; preds = %2
%16 = call i32 (...) @cpu_time()
store i32 %16, i32* %5
br label %17
17: ; preds = %2, %15, %13, %12, %10, %7
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
define i32 @exec(i32 %0, i8* %1) {
switch i32 %0, label %11 [
i32 1, label %3
i32 2, label %5
i32 5, label %9
i32 4, label %7
]
3: ; preds = %2
%4 = tail call i32 @showHelp(i8* %1)
br label %11
5: ; preds = %2
%6 = tail call i32 (...) @clear()
br label %11
7: ; preds = %2
%8 = tail call i32 (...) @showCPUinfo()
br label %11
9: ; preds = %2
%10 = tail call i32 (...) @cpu_time()
br label %11
11: ; preds = %2, %9, %7, %5, %3
%12 = phi i32 [ undef, %2 ], [ %8, %7 ], [ %10, %9 ], [ %6, %5 ], [ %4, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ CompileArgument();
int /*<<< orphan*/ CompileCondition();
int /*<<< orphan*/ ResetIf();
int /*<<< orphan*/ WriteInstruction(char *);
void CR_Got(void) {
  CompileArgument();
  WriteInstruction("call gotob");
  WriteInstruction("jp c,      ");
  CompileCondition();
  ResetIf();
}


x86 assembly (clang, -O0):
<CR_Got>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CompileArgument@plt>
lea    0xeae(%rip),%rdi
call   1050 <WriteInstruction@plt>
lea    0xead(%rip),%rdi
call   1050 <WriteInstruction@plt>
mov    $0x0,%al
call   1060 <CompileCondition@plt>
mov    $0x0,%al
call   1040 <ResetIf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CR_Got>:
push   %rax
xor    %eax,%eax
call   1030 <CompileArgument@plt>
lea    0xeb1(%rip),%rdi
call   1050 <WriteInstruction@plt>
lea    0xeb0(%rip),%rdi
call   1050 <WriteInstruction@plt>
xor    %eax,%eax
call   1060 <CompileCondition@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ResetIf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"call gotob\00"
@.str.1 = [12 x i8] c"jp c, \00"
define void @CR_Got() {
%1 = call i32 (...) @CompileArgument()
%2 = call i32 @WriteInstruction(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @WriteInstruction(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @CompileCondition()
%5 = call i32 (...) @ResetIf()
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"call gotob\00"
@.str.1 = [12 x i8] c"jp c, \00"
define void @CR_Got() {
%1 = tail call i32 (...) @CompileArgument()
%2 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @CompileCondition()
%5 = tail call i32 (...) @ResetIf()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  void inverse(char str[]);
  char str[20];
  printf("input a string:");
  scanf("%s", str);
  inverse(str);
  printf("new string:%s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <inverse@plt>
lea    -0x20(%rbp),%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <inverse@plt>
lea    0xeaf(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"input a string:\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [15 x i8] c"new string:%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"input a string:\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [15 x i8] c"new string:%s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ symres_init();
int /*<<< orphan*/ types_init();
void init() {
  symres_init();
  types_init();
}


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

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1040 <symres_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <types_init@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 (...) @symres_init()
%2 = call i32 (...) @types_init()
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @symres_init()
%2 = tail call i32 (...) @types_init()
ret void
}
int get_parent_index(int index) { return index / 2 > 0 ? index / 2 : -1; }


x86 assembly (clang, -O0):
<get_parent_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
jle    112e <get_parent_index+0x2e>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    113b <get_parent_index+0x3b>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    113b <get_parent_index+0x3b>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_parent_index>:
mov    $0xffffffff,%eax
cmp    $0x2,%edi
jl     1113 <get_parent_index+0x13>
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @get_parent_index(i32 %0) {
%2 = icmp sgt i32 %0, 1
%3 = sdiv i32 %0, 2
%4 = select i1 %2, i32 %3, i32 -1
ret i32 %4
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};
typedef int int64_t;

/* Variables and functions */
int64_t usecs(struct timeval *start, struct timeval *end) {
  int64_t diff;
  diff = (end->tv_sec - start->tv_sec) * 1000000;
  diff += end->tv_usec - start->tv_usec;
  return diff;
}


x86 assembly (clang, -O0):
<usecs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%eax
imul   $0xf4240,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x8(%rbp),%rax
sub    0x8(%rax),%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usecs>:
mov    (%rsi),%ecx
mov    0x8(%rsi),%eax
sub    (%rdi),%ecx
imul   $0xf4240,%ecx,%ecx
sub    0x8(%rdi),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @usecs(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
%5 = alloca i32
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%6 = load %struct.timeval*, %struct.timeval** %4
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.timeval*, %struct.timeval** %3
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = sub nsw i32 %8, %11
%13 = mul nsw i32 %12, 1000000
store i32 %13, i32* %5
%14 = load %struct.timeval*, %struct.timeval** %4
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 1
%16 = load i64, i64* %15
%17 = load %struct.timeval*, %struct.timeval** %3
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 1
%19 = load i64, i64* %18
%20 = sub nsw i64 %16, %19
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = add nsw i64 %22, %20
%24 = trunc i64 %23 to i32
store i32 %24, i32* %5
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @usecs(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load i64, i64* %9
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%12 = load i64, i64* %11
%13 = sub nsw i64 %10, %12
%14 = trunc i64 %13 to i32
%15 = add i32 %8, %14
ret i32 %15
}
int ft_toupper(int c) { return (c > 96 && c < 123); }


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x60,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1120 <ft_toupper+0x20>
cmpl   $0x7b,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 96
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 123
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double pop();
int /*<<< orphan*/ push(double);
void duplicate() {
  double temp = pop();
  push(temp);
  push(temp);
}


x86 assembly (clang, -O0):
<duplicate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <pop@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <push@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<duplicate>:
push   %rax
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,(%rsp)
call   1040 <push@plt>
movsd  (%rsp),%xmm0
pop    %rax
jmp    1040 <push@plt>

LLVM IR (-O0):
define void @duplicate() {
%1 = alloca double
%2 = call double (...) @pop()
store double %2, double* %1
%3 = load double, double* %1
%4 = call i32 @push(double %3)
%5 = load double, double* %1
%6 = call i32 @push(double %5)
ret void
}

LLVM IR (-O2):
define void @duplicate() {
%1 = tail call double (...) @pop()
%2 = tail call i32 @push(double %1)
%3 = tail call i32 @push(double %1)
ret void
}
unsigned ShrTest5(unsigned X, unsigned C) {
  unsigned AndRHS = (unsigned)0xFFFFFFFF >> C;
  return (X >> C) & AndRHS;
}


x86 assembly (clang, -O0):
<ShrTest5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%eax
shr    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
and    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShrTest5>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @ShrTest5(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* %4
%7 = lshr i32 -1, %6
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = lshr i32 %8, %9
%11 = load i32, i32* %5
%12 = and i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ShrTest5(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int quaddobl_row_reduce_system(int diag) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc4c(709, &diag, b, c, 0);
  return 0;
}


x86 assembly (clang, -O0):
<quaddobl_row_reduce_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x2c5,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quaddobl_row_reduce_system>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x2c5,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @quaddobl_row_reduce_system(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 709, i32* %2, i32* undef, double* undef, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strlen(char *);
char *strcat(char *dst, const char *src) {
  size_t len = strlen(dst);
  strcpy(dst + len, src);
  return dst;
}


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

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    (%rax,%rbx,1),%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
store i64 %7, i64* %5
%8 = load i8*, i8** %3
%9 = load i64, i64* %5
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = load i8*, i8** %4
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i32 @strcpy(i8* %4, i8* %1)
ret i8* %0
}
int fun1315() { return 1315; }


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

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

LLVM IR (-O0):
define i32 @fun1315() {
ret i32 1315
}

LLVM IR (-O2):
define i32 @fun1315() {
ret i32 1315
}
/* Variables and functions */
double gsl_fdiv(double, double);
double gsl_neginf(void) { return gsl_fdiv(-1.0, 0.0); }


x86 assembly (clang, -O0):
<gsl_neginf>:
push   %rbp
mov    %rsp,%rbp
movsd  0xee4(%rip),%xmm0
xorps  %xmm1,%xmm1
call   1030 <gsl_fdiv@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsl_neginf>:
movsd  0xee8(%rip),%xmm0
xorps  %xmm1,%xmm1
jmp    1030 <gsl_fdiv@plt>

LLVM IR (-O0):
define double @gsl_neginf() {
%1 = call double @gsl_fdiv(double -1.000000e+00, double 0.000000e+00)
ret double %1
}

LLVM IR (-O2):
define double @gsl_neginf() {
%1 = tail call double @gsl_fdiv(double -1.000000e+00, double 0.000000e+00)
ret double %1
}
/* Variables and functions */
int cmp_vector_array_idxs_maxdiff(void *, void const *, void const *);
int rcmp_vector_array_idxs_maxdiff(void *qsort_thunk_vp, const void *xvp,
                                   const void *yvp) {
  return -1 * cmp_vector_array_idxs_maxdiff(qsort_thunk_vp, xvp, yvp);
}


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

x86 assembly (clang, -O2):
<rcmp_vector_array_idxs_maxdiff>:
push   %rax
call   1030 <cmp_vector_array_idxs_maxdiff@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rcmp_vector_array_idxs_maxdiff(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @cmp_vector_array_idxs_maxdiff(i8* %7, i8* %8, i8* %9)
%11 = mul nsw i32 -1, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @rcmp_vector_array_idxs_maxdiff(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @cmp_vector_array_idxs_maxdiff(i8* %0, i8* %1, i8* %2)
%5 = sub nsw i32 0, %4
ret i32 %5
}