xunge/DecIR huggingface dataset:
/* Variables and functions */
double fabsf(float);
int /*<<< orphan*/ modff(float, float *);
float ceilf(float x) {
  float x1 = x;
  modff(x, &x);
  if (x1 > 0.0 && fabsf(x1 - x) > 0.0) {
    x += 1.0;
  }
  return x;
}


x86 assembly (clang, -O0):
<ceilf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
lea    -0x4(%rbp),%rdi
call   1040 <modff@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1195 <ceilf+0x75>
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
call   1030 <fabsf@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1195 <ceilf+0x75>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe78(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceilf>:
push   %rax
movss  %xmm0,(%rsp)
movss  %xmm0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <modff@plt>
movss  (%rsp),%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
jbe    1176 <ceilf+0x56>
subss  %xmm0,%xmm1
movss  %xmm0,(%rsp)
movaps %xmm1,%xmm0
call   1030 <fabsf@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movss  (%rsp),%xmm0
jbe    1176 <ceilf+0x56>
addss  0xe90(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
pop    %rax
ret

LLVM IR (-O0):
define float @ceilf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
store float %4, float* %3
%5 = load float, float* %2
%6 = call i32 @modff(float %5, float* %2)
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = fcmp ogt double %8, 0.000000e+00
br i1 %9, label %10, label %21
10: ; preds = %1
%11 = load float, float* %3
%12 = load float, float* %2
%13 = fsub float %11, %12
%14 = call double @fabsf(float %13)
%15 = fcmp ogt double %14, 0.000000e+00
br i1 %15, label %16, label %21
16: ; preds = %10
%17 = load float, float* %2
%18 = fpext float %17 to double
%19 = fadd double %18, 1.000000e+00
%20 = fptrunc double %19 to float
store float %20, float* %2
br label %21
21: ; preds = %16, %10, %1
%22 = load float, float* %2
ret float %22
}

LLVM IR (-O2):
define float @ceilf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call i32 @modff(float %0, float* %2)
%4 = fcmp ogt float %0, 0.000000e+00
%5 = load float, float* %2
br i1 %4, label %6, label %12
6: ; preds = %1
%7 = fsub float %0, %5
%8 = tail call double @fabsf(float %7)
%9 = fcmp ogt double %8, 0.000000e+00
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = fadd float %5, 1.000000e+00
store float %11, float* %2
br label %12
12: ; preds = %1, %10, %6
%13 = phi float [ %11, %10 ], [ %5, %6 ], [ %5, %1 ]
ret float %13
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gmtime_r(int /*<<< orphan*/ *, struct tm *);
char *strdup(char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
__attribute__((unused)) char *make_date_header() {
  time_t now = time(NULL);
  struct tm gmtnow;
  char buf[1000];
  gmtime_r(&now, &gmtnow);
  strftime(buf, 1000, "%a, %d %h %Y %H:%M:%S GMT", &gmtnow);
  return (strdup(buf));
}


x86 assembly (clang, -O0):
<make_date_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <gmtime_r@plt>
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
lea    0xe89(%rip),%rdx
lea    -0x8(%rbp),%rcx
call   1050 <strftime@plt>
lea    -0x3f0(%rbp),%rdi
call   1060 <strdup@plt>
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_date_header>:
push   %r14
push   %rbx
sub    $0x3f8,%rsp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
lea    0x8(%rsp),%r14
mov    %r14,%rsi
call   1030 <gmtime_r@plt>
lea    0xe92(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
mov    %r14,%rcx
call   1050 <strftime@plt>
mov    %rbx,%rdi
call   1060 <strdup@plt>
add    $0x3f8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [26 x i8] c"%a, %d %h %Y %H:%M:%S GMT\00"
define i8* @make_date_header() {
%1 = alloca i32
%2 = alloca %struct.tm
%3 = alloca [1000 x i8]
%4 = call i32 @time(i32* null)
store i32 %4, i32* %1
%5 = call i32 @gmtime_r(i32* %1, %struct.tm* %2)
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%7 = call i32 @strftime(i8* %6, i32 1000, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), %struct.tm* %2)
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%9 = call i8* @strdup(i8* %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [26 x i8] c"%a, %d %h %Y %H:%M:%S GMT\00"
define noalias i8* @make_date_header() {
%1 = alloca i32
%2 = alloca %struct.tm
%3 = alloca [1000 x i8]
%4 = bitcast i32* %1 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %1
%6 = bitcast %struct.tm* %2 to i8*
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%8 = call i32 @gmtime_r(i32* %1, %struct.tm* %2)
%9 = call i32 @strftime(i8* %7, i32 1000, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), %struct.tm* %2)
%10 = call i8* @strdup(i8* %7)
ret i8* %10
}
int test_imm_C2int16_mem(short *val) {
  return ((*val) & (-0xC2 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C2int16_mem>:
movzwl (%rdi),%eax
test   $0xff3e,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C2int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -194
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ubi_debugfs_exit(void) { return; }


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

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

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

LLVM IR (-O2):
define void @ubi_debugfs_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(int argc, char *argv[]) {
  unsigned long long int a;
  a = 65536ULL;
  if (a == 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x10000,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1140 <main+0x30>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 65536, i64* %6
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;
struct ts_nit {
  int dummy;
};

/* Variables and functions */
int ts_nit_add_frequency_list_descriptor(struct ts_nit *, int /*<<< orphan*/,
                                         int /*<<< orphan*/, int,
                                         int /*<<< orphan*/ *,
                                         int /*<<< orphan*/);
int ts_nit_add_frequency_list_descriptor_terrestrial(struct ts_nit *nit,
                                                     uint16_t ts_id,
                                                     uint16_t org_net_id,
                                                     uint32_t *freqs,
                                                     uint8_t num_freqs) {
  return ts_nit_add_frequency_list_descriptor(nit, ts_id, org_net_id, 3, freqs,
                                              num_freqs);
}


x86 assembly (clang, -O0):
<ts_nit_add_frequency_list_descriptor_terrestrial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    $0x3,%ecx
call   1030 <ts_nit_add_frequency_list_descriptor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_nit_add_frequency_list_descriptor_terrestrial>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    $0x3,%ecx
jmp    1030 <ts_nit_add_frequency_list_descriptor@plt>

LLVM IR (-O0):
%struct.ts_nit = type { i32 }
define i32 @ts_nit_add_frequency_list_descriptor_terrestrial(%struct.ts_nit* %0, i32 %1, i32 %2, i32* %3, i32 %4) {
%6 = alloca %struct.ts_nit*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
store %struct.ts_nit* %0, %struct.ts_nit** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store i32 %4, i32* %10
%11 = load %struct.ts_nit*, %struct.ts_nit** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32*, i32** %9
%15 = load i32, i32* %10
%16 = call i32 @ts_nit_add_frequency_list_descriptor(%struct.ts_nit* %11, i32 %12, i32 %13, i32 3, i32* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.ts_nit = type { i32 }
define i32 @ts_nit_add_frequency_list_descriptor_terrestrial(%struct.ts_nit* %0, i32 %1, i32 %2, i32* %3, i32 %4) {
%6 = tail call i32 @ts_nit_add_frequency_list_descriptor(%struct.ts_nit* %0, i32 %1, i32 %2, i32 3, i32* %3, i32 %4)
ret i32 %6
}
int setbpt(tcp)
struct tcb *tcp;
{
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.tcb = type opaque
define i32 @setbpt(%struct.tcb* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G21_f(char *s) {
  debug("G21_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G21_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G21_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"G21_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G21_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"G21_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G21_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
ssize_t conn_writeback(int fd, char *buf, ssize_t len) {
  return write(fd, buf, len);
}


x86 assembly (clang, -O0):
<conn_writeback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conn_writeback>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @conn_writeback(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_storeu_pd(double *, int /*<<< orphan*/);
void test_mm_storeu_pd(double *A, __m128d B) { _mm_storeu_pd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_storeu_pd>:
jmp    1030 <_mm_storeu_pd@plt>

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

LLVM IR (-O2):
define void @test_mm_storeu_pd(double* %0, i32 %1) {
%3 = tail call i32 @_mm_storeu_pd(double* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sort2(int *, int *);
void sort3(int *x, int *y, int *z) {
  sort2(x, y);
  sort2(x, z);
  sort2(y, z);
}


x86 assembly (clang, -O0):
<sort3>:
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
call   1030 <sort2@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <sort2@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <sort2@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sort3(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = call i32 @sort2(i32* %7, i32* %8)
%10 = load i32*, i32** %4
%11 = load i32*, i32** %6
%12 = call i32 @sort2(i32* %10, i32* %11)
%13 = load i32*, i32** %5
%14 = load i32*, i32** %6
%15 = call i32 @sort2(i32* %13, i32* %14)
ret void
}

LLVM IR (-O2):
define void @sort3(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @sort2(i32* %0, i32* %1)
%5 = tail call i32 @sort2(i32* %0, i32* %2)
%6 = tail call i32 @sort2(i32* %1, i32* %2)
ret void
}
void bar(x, y) void *x;
char *y;
{ baz(y); }


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

x86 assembly (clang, -O2):
<bar>:
mov    %rsi,%rdi
xor    %eax,%eax
jmp    1030 <baz@plt>

LLVM IR (-O0):
define void @bar(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @baz to i32 (i8*, ...)*)(i8* %5)
ret void
}

LLVM IR (-O2):
define void @bar(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @baz to i32 (i8*, ...)*)(i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ cpu_set_t;
typedef int /*<<< orphan*/ cpu_mask;

/* Variables and functions */
int /*<<< orphan*/ CPU_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ CPU_ZERO(int /*<<< orphan*/ *);
int errno;
scalar_t__ sched_setaffinity(int /*<<< orphan*/, int, int /*<<< orphan*/ *);
int lock_on_cpu(int cpu) {
  cpu_set_t cpu_mask;
  CPU_ZERO(&cpu_mask);
  CPU_SET(cpu, &cpu_mask);
  if (sched_setaffinity(0, sizeof(cpu_mask), &cpu_mask) < 0)
    return errno;
  return 0;
}


x86 assembly (clang, -O0):
<lock_on_cpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <CPU_ZERO@plt>
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
call   1050 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
lea    -0xc(%rbp),%rdx
call   1030 <sched_setaffinity@plt>
cmp    $0x0,%rax
jge    117b <lock_on_cpu+0x4b>
mov    0x2e6f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1182 <lock_on_cpu+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock_on_cpu>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <CPU_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    %r14,%rdx
call   1030 <sched_setaffinity@plt>
mov    0x2e7d(%rip),%rcx
sar    $0x3f,%rax
and    (%rcx),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @lock_on_cpu(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i32 @CPU_ZERO(i32* %4)
%6 = load i32, i32* %3
%7 = call i32 @CPU_SET(i32 %6, i32* %4)
%8 = call i64 @sched_setaffinity(i32 0, i32 4, i32* %4)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* @errno
store i32 %11, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @lock_on_cpu(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @CPU_ZERO(i32* %2)
%5 = call i32 @CPU_SET(i32 %0, i32* %2)
%6 = call i64 @sched_setaffinity(i32 0, i32 4, i32* %2)
%7 = icmp slt i64 %6, 0
%8 = load i32, i32* @errno
%9 = select i1 %7, i32 %8, i32 0
ret i32 %9
}
void enable_int() { __asm__ __volatile__("sti"); }


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

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

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

LLVM IR (-O2):
define void @enable_int() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
scalar_t__ IFNAMSIZ;
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int system(char *);
int tun_up(char *dev) {
  char *cmd = (char *)malloc(100 + IFNAMSIZ);
  sprintf(cmd, "ip link set dev %s up", dev);
  int rc = system(cmd);
  free(cmd);
  return rc;
}


x86 assembly (clang, -O0):
<tun_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%rdi
add    $0x64,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe8e(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <system@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tun_up>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    0x2e92(%rip),%rax
mov    (%rax),%rdi
add    $0x64,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xe9c(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1060 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@IFNAMSIZ = global i64 0
@.str = [22 x i8] c"ip link set dev %s up\00"
define i32 @tun_up(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i64, i64* @IFNAMSIZ
%6 = add nsw i64 100, %5
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %3
%13 = call i32 @system(i8* %12)
store i32 %13, i32* %4
%14 = load i8*, i8** %3
%15 = call i32 @free(i8* %14)
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
@IFNAMSIZ = global i64 0
@.str = [22 x i8] c"ip link set dev %s up\00"
define i32 @tun_up(i8* %0) {
%2 = load i64, i64* @IFNAMSIZ
%3 = add nsw i64 %2, 100
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @system(i8* %5)
%8 = tail call i32 @free(i8* %5)
ret i32 %7
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t WatchdogReloadGet(uint32_t ui32Base) {
  ;
  return ((*((volatile unsigned long *)(ui32Base + 0x00000000))));
}


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

x86 assembly (clang, -O2):
<WatchdogReloadGet>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
define i64 @WatchdogReloadGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 0
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @WatchdogReloadGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
ret i64 %5
}
int barBad() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @barBad() {
ret i32 0
}
int Operand_bs2_decode(unsigned int *valp) {
  *valp = *valp << 1;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_bs2_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_bs2_decode>:
shll   (%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Operand_bs2_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 1
store i32 %3, i32* %0
ret i32 0
}
int positionOffset() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @positionOffset() {
ret i32 0
}
/* Variables and functions */
int fn_sq_ch_68_ch_97_ch_116_ch_97_ch_65_ch_108_ch_108_ch_86_ch_97_ch_108_ch_117_ch_101_ch_115_ch_70_ch_114_ch_111_ch_109(
    char const *);
int fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_65_ch_108_ch_108_ch_86_ch_97_ch_108_ch_117_ch_101_ch_115_ch_70_ch_114_ch_111_ch_109(
    const char *text) {
  int pos = 0;
  pos =
      fn_sq_ch_68_ch_97_ch_116_ch_97_ch_65_ch_108_ch_108_ch_86_ch_97_ch_108_ch_117_ch_101_ch_115_ch_70_ch_114_ch_111_ch_109(
          text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_65_ch_108_ch_108_ch_86_ch_97_ch_108_ch_117_ch_101_ch_115_ch_70_ch_114_ch_111_ch_109>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fn_sq_ch_68_ch_97_ch_116_ch_97_ch_65_ch_108_ch_108_ch_86_ch_97_ch_108_ch_117_ch_101_ch_115_ch_70_ch_114_ch_111_ch_109@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_65_ch_108_ch_108_ch_86_ch_97_ch_108_ch_117_ch_101_ch_115_ch_70_ch_114_ch_111_ch_109+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_65_ch_108_ch_108_ch_86_ch_97_ch_108_ch_117_ch_101_ch_115_ch_70_ch_114_ch_111_ch_109+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_65_ch_108_ch_108_ch_86_ch_97_ch_108_ch_117_ch_101_ch_115_ch_70_ch_114_ch_111_ch_109>:
jmp    1030 <fn_sq_ch_68_ch_97_ch_116_ch_97_ch_65_ch_108_ch_108_ch_86_ch_97_ch_108_ch_117_ch_101_ch_115_ch_70_ch_114_ch_111_ch_109@plt>

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

LLVM IR (-O2):
define i32 @fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_65_ch_108_ch_108_ch_86_ch_97_ch_108_ch_117_ch_101_ch_115_ch_70_ch_114_ch_111_ch_109(i8* %0) {
%2 = tail call i32 @fn_sq_ch_68_ch_97_ch_116_ch_97_ch_65_ch_108_ch_108_ch_86_ch_97_ch_108_ch_117_ch_101_ch_115_ch_70_ch_114_ch_111_ch_109(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("This c file must be ignored\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"This c file must be ignored\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [28 x i8] c"This c file must be ignored\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  double count;
  printf("for Loop Example 2\n\n");
  for (count = 20.2; count <= 31.4; count += 0.2)
    printf("%3.1lf\n", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec6(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1177 <main+0x67>
movsd  -0x10(%rbp),%xmm0
lea    0xed4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xea8(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    113a <main+0x2a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
movsd  0xec7(%rip),%xmm0
lea    0xed8(%rip),%rbx
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xea4(%rip),%xmm0
movsd  0xea4(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1140 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"for Loop Example 2\0A\0A\00"
@.str.1 = [8 x i8] c"%3.1lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store double 2.020000e+01, double* %2
br label %4
4: ; preds = %10, %0
%5 = load double, double* %2
%6 = fcmp ole double %5, 3.140000e+01
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load double, double* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %8)
br label %10
10: ; preds = %7
%11 = load double, double* %2
%12 = fadd double %11, 2.000000e-01
store double %12, double* %2
br label %4
13: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"%3.1lf\0A\00"
@str = [20 x i8] c"for Loop Example 2\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi double [ 2.020000e+01, %0 ], [ %5, %2 ]
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = fadd double %3, 2.000000e-01
%6 = fcmp ugt double %5, 3.140000e+01
br i1 %6, label %7, label %2
7: ; preds = %2
ret i32 0
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = (input[0UL] + 914778474UL) * 67330564296145686UL;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[0UL] = state[local1] + state[0UL];
      local1++;
    }
    output[0UL] = (state[0UL] + 238420169UL) * 1151155071UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x3686696a,%rax
movabs $0xef34ca9f65fb16,%rcx
imul   %rcx,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jae    1160 <RandomFunc+0x60>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp,%rax,8),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1133 <RandomFunc+0x33>
mov    -0x18(%rbp),%rax
add    $0xe3600c9,%rax
imul   $0x449d3b7f,%rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movabs $0x94e176fcd1e743d4,%rax
76 e1 94
imul   (%rdi),%rax
movabs $0xbf94b0c45bc9c07f,%rcx
b0 94 bf
add    %rax,%rcx
mov    %rcx,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = add i64 %9, 914778474
%11 = mul i64 %10, 67330564296145686
%12 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %11, i64* %12
store i64 0, i64* %6
br label %13
13: ; preds = %16, %2
%14 = load i64, i64* %6
%15 = icmp ult i64 %14, 1
br i1 %15, label %16, label %26
16: ; preds = %13
%17 = load i64, i64* %6
%18 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %17
%19 = load i64, i64* %18
%20 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%21 = load i64, i64* %20
%22 = add i64 %19, %21
%23 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %22, i64* %23
%24 = load i64, i64* %6
%25 = add i64 %24, 1
store i64 %25, i64* %6
br label %13
26: ; preds = %13
%27 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%28 = load i64, i64* %27
%29 = add i64 %28, 238420169
%30 = mul i64 %29, 1151155071
%31 = load i64*, i64** %4
%32 = getelementptr inbounds i64, i64* %31, i64 0
store i64 %30, i64* %32
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = mul i64 %3, -7718757458110889004
%5 = add i64 %4, -4641890958512111489
store i64 %5, i64* %1
ret void
}
/* Variables and functions */
int add(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int loader_add_dir(const char *dir) { return add(dir, strlen(dir)); }


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

x86 assembly (clang, -O2):
<loader_add_dir>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <add@plt>

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

LLVM IR (-O2):
define i32 @loader_add_dir(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @add(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int epoll_create(int);
int poll_create() { return epoll_create(1024); }


x86 assembly (clang, -O0):
<poll_create>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400,%edi
call   1030 <epoll_create@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<poll_create>:
mov    $0x400,%edi
jmp    1030 <epoll_create@plt>

LLVM IR (-O0):
define i32 @poll_create() {
%1 = call i32 @epoll_create(i32 1024)
ret i32 %1
}

LLVM IR (-O2):
define i32 @poll_create() {
%1 = tail call i32 @epoll_create(i32 1024)
ret i32 %1
}
void g_scanner_scope_add_symbol() {}


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

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

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

LLVM IR (-O2):
define void @g_scanner_scope_add_symbol() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ SetLeftRight(int /*<<< orphan*/, char *, int);
void QMSetLeft(int16_t fno, char *index_name) {
  SetLeftRight(fno, index_name, 42);
}


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

x86 assembly (clang, -O2):
<QMSetLeft>:
mov    $0x2a,%edx
jmp    1030 <SetLeftRight@plt>

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

LLVM IR (-O2):
define void @QMSetLeft(i32 %0, i8* %1) {
%3 = tail call i32 @SetLeftRight(i32 %0, i8* %1, i32 42)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fenv_t;

/* Variables and functions */
int __feholdexcept(fenv_t *envp) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__feholdexcept(i32* nocapture readnone %0) {
ret i32 0
}
void testfunc3() {
  int a;
  int b;
  int c;
  int abcdefghijklmnopqrstuvwxyz1234567890;
  int abcdefghijklmnopqrstuvwxyz12345678902;
}


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

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

LLVM IR (-O0):
define void @testfunc3() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
ret void
}

LLVM IR (-O2):
define void @testfunc3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hoc_pushx(int);
int /*<<< orphan*/ hoc_ret();
Plot() {
  hoc_ret();
  hoc_pushx(0.);
}


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

x86 assembly (clang, -O2):
<Plot>:
push   %rax
xor    %eax,%eax
call   1030 <hoc_ret@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <hoc_pushx@plt>

LLVM IR (-O0):
define i32 @Plot() {
%1 = alloca i32
%2 = call i32 (...) @hoc_ret()
%3 = call i32 @hoc_pushx(i32 0)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @Plot() {
%1 = tail call i32 (...) @hoc_ret()
%2 = tail call i32 @hoc_pushx(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *pl_expandtabs(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *ret_val;
  ret_val = pl_expandtabs("tabs\tinstead\tof\tspace", 1);
  if (ret_val != NULL) {
    printf("tabs\tinstead\tof\tspace\n%s\n", ret_val);
  }
  free(ret_val);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x1,%esi
call   1050 <pl_expandtabs@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116f <main+0x3f>
mov    -0x10(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
mov    $0x1,%esi
call   1050 <pl_expandtabs@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1159 <main+0x29>
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"tabs\09instead\09of\09space\00"
@.str.1 = [26 x i8] c"tabs\09instead\09of\09space\0A%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @pl_expandtabs(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %6, %0
%10 = load i8*, i8** %2
%11 = call i32 @free(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"tabs\09instead\09of\09space\00"
@.str.1 = [26 x i8] c"tabs\09instead\09of\09space\0A%s\0A\00"
define i32 @main() {
%1 = tail call i8* @pl_expandtabs(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
doend() { exit(0); }


x86 assembly (clang, -O0):
<doend>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<doend>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @doend() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @doend() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int /*<<< orphan*/ HuffInit();
int /*<<< orphan*/ printf(char *);
int sudp_init(u_char *data) {
  printf("- PLUGIN: Doom huffman\n");
  if (data && !data[0]) {
    printf("- no plugin's options\n");
    return (1);
  }
  HuffInit();
  return (0);
}


x86 assembly (clang, -O0):
<sudp_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
je     1168 <sudp_init+0x48>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1168 <sudp_init+0x48>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1176 <sudp_init+0x56>
mov    $0x0,%al
call   1040 <HuffInit@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sudp_init>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
test   %rbx,%rbx
je     113a <sudp_init+0x1a>
cmpl   $0x0,(%rbx)
je     1145 <sudp_init+0x25>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <HuffInit@plt>
jmp    1156 <sudp_init+0x36>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"- PLUGIN: Doom huffman\0A\00"
@.str.1 = [23 x i8] c"- no plugin's options\0A\00"
define i32 @sudp_init(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %7
%13 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %2
br label %16
14: ; preds = %7, %1
%15 = call i32 (...) @HuffInit()
store i32 0, i32* %2
br label %16
16: ; preds = %14, %12
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@str = [23 x i8] c"- PLUGIN: Doom huffman\00"
@str.2 = [22 x i8] c"- no plugin's options\00"
define i32 @sudp_init(i32* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%3 = icmp eq i32* %0, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* %0
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.2, i64 0, i64 0))
br label %11
9: ; preds = %4, %1
%10 = tail call i32 (...) @HuffInit()
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ 0, %9 ], [ 1, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
main() {
  int resultado, num = 1, cont;
  for (cont = 1; cont <= 100; cont++) {
    resultado = num + cont;
    printf("%d+%d = %d \n", num, cont, resultado);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x64,-0x10(%rbp)
jg     1163 <main+0x53>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x2,%ebx
lea    0xee0(%rip),%r14
lea    -0x1(%rbx),%edx
mov    %r14,%rdi
mov    $0x1,%esi
mov    %ebx,%ecx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x66,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"%d+%d = %d \0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1, i32 %2, i32 %3)
%5 = icmp eq i32 %3, 101
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
void OBJ_NAME_do_all_sorted(void) {}


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

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

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

LLVM IR (-O2):
define void @OBJ_NAME_do_all_sorted() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int sumToN(int);
int main() {
  int n;
  printf("Enter a number: \n");
  scanf("%d", &n);
  printf("Sum = %d", sumToN(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <sumToN@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <sumToN@plt>
lea    0xe92(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter a number: \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [9 x i8] c"Sum = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 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), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @sumToN(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [9 x i8] c"Sum = %d\00"
@str = [17 x i8] c"Enter a number: \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 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), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @sumToN(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
void *plat_prepare_screenshot(int *w, int *h, int *bpp) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @plat_prepare_screenshot(i32* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
ret i8* null
}