xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int read(int /*<<< orphan*/, char *, unsigned int);
int mread(char *buffer, unsigned int bufferSize) {
  return read(STDIN_FILENO, buffer, bufferSize);
}


x86 assembly (clang, -O0):
<mread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mread>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <read@plt>

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define i32 @mread(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @STDIN_FILENO
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @read(i32 %5, i8* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define i32 @mread(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @STDIN_FILENO
%4 = tail call i32 @read(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ glb_init_each_time();
void ciao_reinit() { glb_init_each_time(); }


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

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

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

LLVM IR (-O2):
define void @ciao_reinit() {
%1 = tail call i32 (...) @glb_init_each_time()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(int, char *, char *, char *);
void unterminated_arglist(int lineno, char *line, char *cptr) {
  error(lineno, line, cptr, "unterminated argument list");
}


x86 assembly (clang, -O0):
<unterminated_arglist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xecb(%rip),%rcx
call   1030 <error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unterminated_arglist>:
lea    0xee9(%rip),%rcx
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"unterminated argument list\00"
define void @unterminated_arglist(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @error(i32 %7, i8* %8, i8* %9, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"unterminated argument list\00"
define void @unterminated_arglist(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @error(i32 %0, i8* %1, i8* %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *cat2(char *, char *);
char *cat4(char *str1, char *str2, char *str3, char *str4) {
  return cat2(cat2(str1, str2), cat2(str3, str4));
}


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

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

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

LLVM IR (-O2):
define i8* @cat4(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i8* @cat2(i8* %0, i8* %1)
%6 = tail call i8* @cat2(i8* %2, i8* %3)
%7 = tail call i8* @cat2(i8* %5, i8* %6)
ret i8* %7
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzVariable_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKDOWN_DELAYED(int, int /*<<< orphan*/);
int /*<<< orphan*/ SEND_DATAOFF_DELAYED(int, int);
void BrzVariable_reqdown(struct comp *comp, int port) {
  struct BrzVariable_ *c = (struct BrzVariable_ *)comp;
  SEND_ACKDOWN_DELAYED(port, 0);
  if (port >= 1) {
    SEND_DATAOFF_DELAYED(port, 1);
  }
}


x86 assembly (clang, -O0):
<BrzVariable_reqdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   1030 <SEND_ACKDOWN_DELAYED@plt>
cmpl   $0x1,-0xc(%rbp)
jl     1158 <BrzVariable_reqdown+0x38>
mov    -0xc(%rbp),%edi
mov    $0x1,%esi
call   1040 <SEND_DATAOFF_DELAYED@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzVariable_reqdown>:
push   %rbx
mov    %esi,%ebx
mov    %esi,%edi
xor    %esi,%esi
call   1030 <SEND_ACKDOWN_DELAYED@plt>
test   %ebx,%ebx
jle    113d <BrzVariable_reqdown+0x1d>
mov    %ebx,%edi
mov    $0x1,%esi
pop    %rbx
jmp    1040 <SEND_DATAOFF_DELAYED@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzVariable_ = type { i32 }
define void @BrzVariable_reqdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzVariable_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzVariable_*
store %struct.BrzVariable_* %7, %struct.BrzVariable_** %5
%8 = load i32, i32* %4
%9 = call i32 @SEND_ACKDOWN_DELAYED(i32 %8, i32 0)
%10 = load i32, i32* %4
%11 = icmp sge i32 %10, 1
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* %4
%14 = call i32 @SEND_DATAOFF_DELAYED(i32 %13, i32 1)
br label %15
15: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzVariable_reqdown(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_ACKDOWN_DELAYED(i32 %1, i32 0)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @SEND_DATAOFF_DELAYED(i32 %1, i32 1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
double exp(double);
double pow(double, double);
double qFT(double FT) {
  if (FT > 10)
    return 1.0;
  double e = -1.680 * pow(FT, 0.3325);
  return 213.7 * exp(e);
}


x86 assembly (clang, -O0):
<qFT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1156 <qFT+0x36>
movsd  0xed4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119a <qFT+0x7a>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb5(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe9d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe77(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qFT>:
push   %rax
ucomisd 0xedf(%rip),%xmm0
jbe    1135 <qFT+0x15>
movsd  0xecd(%rip),%xmm0
pop    %rax
ret
movsd  0xed3(%rip),%xmm1
call   1040 <pow@plt>
mulsd  0xece(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xec9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @qFT(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = fcmp ogt double %5, 1.000000e+01
br i1 %6, label %7, label %8
7: ; preds = %1
store double 1.000000e+00, double* %2
br label %15
8: ; preds = %1
%9 = load double, double* %3
%10 = call double @pow(double %9, double 3.325000e-01)
%11 = fmul double -1.680000e+00, %10
store double %11, double* %4
%12 = load double, double* %4
%13 = call double @exp(double %12)
%14 = fmul double 2.137000e+02, %13
store double %14, double* %2
br label %15
15: ; preds = %8, %7
%16 = load double, double* %2
ret double %16
}

LLVM IR (-O2):
define double @qFT(double %0) {
%2 = fcmp ogt double %0, 1.000000e+01
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call double @pow(double %0, double 3.325000e-01)
%5 = fmul double %4, -1.680000e+00
%6 = tail call double @exp(double %5)
%7 = fmul double %6, 2.137000e+02
br label %8
8: ; preds = %1, %3
%9 = phi double [ %7, %3 ], [ 1.000000e+00, %1 ]
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ fun_c(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  int a = 0x010101;
  printf("%ld\n", fun_c(a));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x10101,%edi
call   1040 <fun_c@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = tail call i32 @fun_c(i32 65793)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
long a_cas_l(volatile void *p, long t, long s) {
  if (*(long *)p == t)
    *(long *)p = s;
  return t;
}


x86 assembly (clang, -O0):
<a_cas_l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
jne    112c <a_cas_l+0x2c>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_cas_l>:
mov    %rsi,%rax
cmp    %rsi,(%rdi)
jne    110b <a_cas_l+0xb>
mov    %rdx,(%rdi)
ret

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

LLVM IR (-O2):
define i64 @a_cas_l(i8* nocapture %0, i64 returned %1, i64 %2) {
%4 = bitcast i8* %0 to i64*
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, %1
br i1 %6, label %7, label %8
7: ; preds = %3
store i64 %2, i64* %4
br label %8
8: ; preds = %7, %3
ret i64 %1
}
/* Type definitions */
struct ln_rst_time {
  int dummy;
};
struct ln_lnlat_posn {
  int dummy;
};
struct ln_equ_posn {
  int dummy;
};

/* Variables and functions */
int ln_get_object_rst_horizon(double, struct ln_lnlat_posn *,
                              struct ln_equ_posn *, double,
                              struct ln_rst_time *);
int ln_get_object_rst(double JD, struct ln_lnlat_posn *observer,
                      struct ln_equ_posn *object, struct ln_rst_time *rst) {
  return ln_get_object_rst_horizon(JD, observer, object, -0.5667, rst);
}


x86 assembly (clang, -O0):
<ln_get_object_rst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
movsd  0xebe(%rip),%xmm1
call   1030 <ln_get_object_rst_horizon@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_object_rst>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <ln_get_object_rst_horizon@plt>

LLVM IR (-O0):
%struct.ln_lnlat_posn = type { i32 }
%struct.ln_equ_posn = type { i32 }
%struct.ln_rst_time = type { i32 }
define i32 @ln_get_object_rst(double %0, %struct.ln_lnlat_posn* %1, %struct.ln_equ_posn* %2, %struct.ln_rst_time* %3) {
%5 = alloca double
%6 = alloca %struct.ln_lnlat_posn*
%7 = alloca %struct.ln_equ_posn*
%8 = alloca %struct.ln_rst_time*
store double %0, double* %5
store %struct.ln_lnlat_posn* %1, %struct.ln_lnlat_posn** %6
store %struct.ln_equ_posn* %2, %struct.ln_equ_posn** %7
store %struct.ln_rst_time* %3, %struct.ln_rst_time** %8
%9 = load double, double* %5
%10 = load %struct.ln_lnlat_posn*, %struct.ln_lnlat_posn** %6
%11 = load %struct.ln_equ_posn*, %struct.ln_equ_posn** %7
%12 = load %struct.ln_rst_time*, %struct.ln_rst_time** %8
%13 = call i32 @ln_get_object_rst_horizon(double %9, %struct.ln_lnlat_posn* %10, %struct.ln_equ_posn* %11, double -5.667000e-01, %struct.ln_rst_time* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.ln_lnlat_posn = type { i32 }
%struct.ln_equ_posn = type { i32 }
%struct.ln_rst_time = type { i32 }
define i32 @ln_get_object_rst(double %0, %struct.ln_lnlat_posn* %1, %struct.ln_equ_posn* %2, %struct.ln_rst_time* %3) {
%5 = tail call i32 @ln_get_object_rst_horizon(double %0, %struct.ln_lnlat_posn* %1, %struct.ln_equ_posn* %2, double -5.667000e-01, %struct.ln_rst_time* %3)
ret i32 %5
}
int my_exit(char **env, char **s) {
  (void)env;
  (void)s;
  return (-2);
}


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

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

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

LLVM IR (-O2):
define i32 @my_exit(i8** nocapture readnone %0, i8** nocapture readnone %1) {
ret i32 -2
}
/* Variables and functions */
void prune_linear_by_minmax(size_t s, size_t t) {
  if (s > 0 && s < 1000) {
    if (t >= s + 1) {
      size_t u = t - 2;
    }
  }
}


x86 assembly (clang, -O0):
<prune_linear_by_minmax>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jbe    114b <prune_linear_by_minmax+0x4b>
cmpq   $0x3e8,-0x8(%rbp)
jae    114b <prune_linear_by_minmax+0x4b>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
jb     1146 <prune_linear_by_minmax+0x46>
mov    -0x10(%rbp),%rax
sub    $0x2,%rax
mov    %rax,-0x18(%rbp)
jmp    114b <prune_linear_by_minmax+0x4b>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @prune_linear_by_minmax(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = icmp ugt i64 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %2
%9 = load i64, i64* %3
%10 = icmp ult i64 %9, 1000
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load i64, i64* %4
%13 = load i64, i64* %3
%14 = add i64 %13, 1
%15 = icmp uge i64 %12, %14
br i1 %15, label %16, label %19
16: ; preds = %11
%17 = load i64, i64* %4
%18 = sub i64 %17, 2
store i64 %18, i64* %5
br label %19
19: ; preds = %16, %11
br label %20
20: ; preds = %19, %8, %2
ret void
}

LLVM IR (-O2):
define void @prune_linear_by_minmax(i64 %0, i64 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn3();
int main() {
  fn3();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fn3()
ret i32 0
}
/* Variables and functions */
int f(int);
int /*<<< orphan*/ printf(char *, int);
main() {
  int j = f(7);
  printf("j=%d", j);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7,%edi
call   1030 <f@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7,%edi
call   1030 <f@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"j=%d\00"
define i32 @main() {
%1 = tail call i32 @f(i32 7)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverseWords(char *);
int main() {
  char s[] = "     0123456789 The quick    brown fox jumps over the lazy dog.";
  char *temp = s;
  reverseWords(s);
  printf("%s", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
lea    -0x50(%rbp),%rdi
call   1050 <reverseWords@plt>
lea    -0x50(%rbp),%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movaps 0xf04(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <reverseWords@plt>
lea    0xeda(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [64 x i8] c" 0123456789 The quick brown fox jumps over the lazy dog.\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [64 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [64 x i8]* %2 to i8*
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
store i8* %5, i8** %3
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%7 = call i32 @reverseWords(i8* %6)
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [64 x i8] c" 0123456789 The quick brown fox jumps over the lazy dog.\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 @reverseWords(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TSReleaseObject(void *);
void TSFree(void *value) { TSReleaseObject(value); }


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

x86 assembly (clang, -O2):
<TSFree>:
jmp    1030 <TSReleaseObject@plt>

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

LLVM IR (-O2):
define void @TSFree(i8* %0) {
%2 = tail call i32 @TSReleaseObject(i8* %0)
ret void
}
/* Variables and functions */
double *malloc(int);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Starting malloc\n");
  int i;
  for (i = 0; i < 4; i++) {
    double *test = malloc(sizeof(double) * 600);
  }
  printf("Ending malloc\n");
}


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>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1168 <main+0x48>
mov    $0x12c0,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <main+0x22>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [16 x i8] c"Starting malloc\00"
@str.2 = [14 x i8] c"Ending malloc\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call double* @malloc(i32 4800)
%3 = tail call double* @malloc(i32 4800)
%4 = tail call double* @malloc(i32 4800)
%5 = tail call double* @malloc(i32 4800)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
int _open_r(void *reent, const char *file, int flags, int mode) {
  (void)reent;
  (void)file;
  (void)flags;
  (void)mode;
  return -1;
}


x86 assembly (clang, -O0):
<_open_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_open_r(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XVaCreateNestedList() {
  printf("XVaCreateNestedList called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"XVaCreateNestedList called\0A\00"
define i32 @XVaCreateNestedList() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"XVaCreateNestedList called\00"
define i32 @XVaCreateNestedList() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int pigpio_command(int, int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int wave_add_new(int pi) { return pigpio_command(pi, 53, 0, 0, 1); }


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

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

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

LLVM IR (-O2):
define i32 @wave_add_new(i32 %0) {
%2 = tail call i32 @pigpio_command(i32 %0, i32 53, i32 0, i32 0, i32 1)
ret i32 %2
}
/* Variables and functions */
long double __qsinh(long double);
long double __q_sinh(long double *arg) { return (__qsinh(*arg)); }


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

x86 assembly (clang, -O2):
<__q_sinh>:
sub    $0x18,%rsp
fldt   (%rdi)
fstpt  (%rsp)
call   1030 <__qsinh@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define x86_fp80 @__q_sinh(x86_fp80* nocapture %0) {
%2 = load x86_fp80, x86_fp80* %0
%3 = tail call x86_fp80 @__qsinh(x86_fp80 %2)
ret x86_fp80 %3
}
/* Type definitions */
typedef int uid_t;

/* Variables and functions */
uid_t octave_geteuid_wrapper(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @octave_geteuid_wrapper() {
ret i32 -1
}
int test_imm_53int64_lowword_mem(long long *val) {
  return ((*val) & (0x53 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_53int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 83
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int p;
  scanf("%d", &p);
  printf("\n %d\n", p * p);
  printf("\n %d\n", p * p * p);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
imul   %esi,%esi
lea    0xebf(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
mov    %eax,%esi
imul   %eax,%esi
imul   %eax,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"\0A %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %2
%12 = mul nsw i32 %10, %11
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"\0A %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %7
%9 = mul nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
int to_hex(int key) {
  if (key >= '0' && key <= '9')
    return key - '0';
  else if (key >= 'a' && key <= 'f')
    return key - 'a' + 10;
  else if (key >= 'A' && key <= 'F')
    return key - 'A' + 10;
  else
    return -1;
}


x86 assembly (clang, -O0):
<to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1129 <to_hex+0x29>
cmpl   $0x39,-0x8(%rbp)
jg     1129 <to_hex+0x29>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <to_hex+0x7a>
cmpl   $0x61,-0x8(%rbp)
jl     114e <to_hex+0x4e>
cmpl   $0x66,-0x8(%rbp)
jg     114e <to_hex+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <to_hex+0x7a>
cmpl   $0x41,-0x8(%rbp)
jl     1173 <to_hex+0x73>
cmpl   $0x46,-0x8(%rbp)
jg     1173 <to_hex+0x73>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <to_hex+0x7a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_hex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <to_hex+0x27>
lea    -0x61(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <to_hex+0x16>
add    $0xffffffa9,%edi
mov    %edi,%eax
ret
lea    -0x41(%rdi),%eax
add    $0xffffffc9,%edi
cmp    $0x6,%eax
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @to_hex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %33
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 102
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 97
%21 = add nsw i32 %20, 10
store i32 %21, i32* %2
br label %33
22: ; preds = %15, %12
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 65
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 70
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 65
%31 = add nsw i32 %30, 10
store i32 %31, i32* %2
br label %33
32: ; preds = %25, %22
store i32 -1, i32* %2
br label %33
33: ; preds = %32, %28, %18, %9
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @to_hex(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -97
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -87
br label %14
9: ; preds = %4
%10 = add i32 %0, -65
%11 = icmp ult i32 %10, 6
%12 = add nsw i32 %0, -55
%13 = select i1 %11, i32 %12, i32 -1
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void thread_sleep(int t) { usleep(t * 1000); }


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

x86 assembly (clang, -O2):
<thread_sleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @thread_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @thread_sleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
void av_dv_codec_profile2() {}


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

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

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

LLVM IR (-O2):
define void @av_dv_codec_profile2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(unsigned int);
void testTortureExecute(void) {
  unsigned x = ~0;
  f(x);
  return;
}


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

x86 assembly (clang, -O2):
<testTortureExecute>:
mov    $0xffffffff,%edi
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 @f(i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read_conf();
int main(void) {
  printf("Hello World....\n");
  read_conf();
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [17 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 ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @read_conf()
ret i32 1
}

LLVM IR (-O2):
@str = [16 x i8] c"Hello World....\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @read_conf()
ret i32 1
}
int test_imm_F8uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xF8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F8uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0xf8,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F8uint64_highword_reg>:
movabs $0xf800000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F8uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 1065151889408
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void outl_local(unsigned long port, unsigned int value) {
  __asm__ __volatile__("out"
                       "l"
                       " %"
                       ""
                       "0, %w1"
                       :
                       : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outl_local>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rdx
out    %eax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outl_local>:
mov    %esi,%eax
mov    %rdi,%rdx
out    %eax,(%dx)
ret

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

LLVM IR (-O2):
define void @outl_local(i64 %0, i32 %1) {
tail call void asm sideeffect "outl $0, ${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %1, i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_EI();
void do0xFB() { _I8080_EI(); }


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

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

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

LLVM IR (-O2):
define void @do0xFB() {
%1 = tail call i32 (...) @_I8080_EI()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fortchartoc(char *);
int /*<<< orphan*/ gmvwrite_polygons_fromfile(int /*<<< orphan*/);
void fgmvwrite_polygons_fromfile_(char filnam[]) {
  gmvwrite_polygons_fromfile(fortchartoc(filnam));
}


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

x86 assembly (clang, -O2):
<fgmvwrite_polygons_fromfile_>:
push   %rax
call   1030 <fortchartoc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <gmvwrite_polygons_fromfile@plt>

LLVM IR (-O0):
define void @fgmvwrite_polygons_fromfile_(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @fortchartoc(i8* %3)
%5 = call i32 @gmvwrite_polygons_fromfile(i32 %4)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_polygons_fromfile_(i8* %0) {
%2 = tail call i32 @fortchartoc(i8* %0)
%3 = tail call i32 @gmvwrite_polygons_fromfile(i32 %2)
ret void
}
void set_so_reuseport(int fd) { fd = fd; }


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

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

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

LLVM IR (-O2):
define void @set_so_reuseport(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int write(int, char *, int);
void make_invincible() {
  int oom_adj_fd;
  int r;
  oom_adj_fd = open("/proc/self/oom_adj", O_WRONLY);
  assert(oom_adj_fd != -1);
  r = write(oom_adj_fd, "-17\n", 4);
  assert(r == 4);
  close(oom_adj_fd);
}


x86 assembly (clang, -O0):
<make_invincible>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
lea    0xea8(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%edi
lea    0xe98(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_invincible>:
push   %rbx
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
lea    0xeaf(%rip),%rdi
call   1060 <open@plt>
mov    %eax,%ebx
xor    %edi,%edi
cmp    $0xffffffff,%eax
setne  %dil
call   1050 <assert@plt>
lea    0xea6(%rip),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
call   1030 <write@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1050 <assert@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"/proc/self/oom_adj\00"
@O_WRONLY = global i32 0
@.str.1 = [5 x i8] c"-17\0A\00"
define void @make_invincible() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @O_WRONLY
%4 = call i32 @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp ne i32 %5, -1
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %1
%10 = call i32 @write(i32 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 4
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* %1
%16 = call i32 @close(i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"/proc/self/oom_adj\00"
@O_WRONLY = global i32 0
@.str.1 = [5 x i8] c"-17\0A\00"
define void @make_invincible() {
%1 = load i32, i32* @O_WRONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp ne i32 %2, -1
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @write(i32 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%7 = icmp eq i32 %6, 4
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 @close(i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ strcasecmp(char *, char *);
int convertChain(char *chain) {
  if (strcasecmp(chain, "external") == 0) {
    return 0x01;
  } else if (strcasecmp(chain, "internal") == 0) {
    return 0x02;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<convertChain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1142 <convertChain+0x32>
movl   $0x1,-0x4(%rbp)
jmp    116f <convertChain+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1168 <convertChain+0x58>
movl   $0x2,-0x4(%rbp)
jmp    116f <convertChain+0x5f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertChain>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     113e <convertChain+0x2e>
lea    0xedd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
neg    %rax
sbb    %eax,%eax
or     $0x2,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"external\00"
@.str.1 = [9 x i8] c"internal\00"
define i32 @convertChain(i8* nocapture %0) {
%2 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 2, i32 -1
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
void send_packet_dummy(unsigned char *packet, size_t len) { return; }


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

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

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

LLVM IR (-O2):
define void @send_packet_dummy(i8* nocapture %0, i64 %1) {
ret void
}