xunge/DecIR huggingface dataset:
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double gettime() {
  double gettime;
  struct timeval now;
  gettimeofday(&now, 0);
  gettime = 1000000 * now.tv_sec + now.tv_usec;
  gettime /= 1000000;
  return gettime;
}


x86 assembly (clang, -O0):
<gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%eax
add    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,(%rsp),%eax
add    0x4(%rsp),%eax
cvtsi2sd %eax,%xmm0
divsd  0xece(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define double @gettime() {
%1 = alloca double
%2 = alloca %struct.timeval
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 1000000, %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = sitofp i32 %9 to double
store double %10, double* %1
%11 = load double, double* %1
%12 = fdiv double %11, 1.000000e+06
store double %12, double* %1
%13 = load double, double* %1
ret double %13
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define double @gettime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 1.000000e+06
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage() {
  printf("Usage: %s [FILE]...\n"
         "Print CRC (32-bit) checksums.\n"
         "\n"
         "With no FILE, or when FILE is -, read standard input.\n",
         "crc32sum");
  printf("\n"
         "      --help\t display this help and exit\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf48(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf3b(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf36(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [106 x i8] c"Usage: %s [FILE]...\0APrint CRC (32-bit) checksums.\0A\0AWith no FILE, or when FILE is -, read standard input.\0A\00"
@.str.1 = [9 x i8] c"crc32sum\00"
@.str.2 = [43 x i8] c"\0A --help\09 display this help and exit\0A\00"
define void @usage() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [106 x i8] c"Usage: %s [FILE]...\0APrint CRC (32-bit) checksums.\0A\0AWith no FILE, or when FILE is -, read standard input.\0A\00"
@.str.1 = [9 x i8] c"crc32sum\00"
@str = [42 x i8] c"\0A --help\09 display this help and exit\00"
define void @usage() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double);
void ptime(FILE *fp, long time) {
  fprintf(fp, "%6.3f", (double)(time) / 1000.0);
}


x86 assembly (clang, -O0):
<ptime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptime>:
cvtsi2sd %rsi,%xmm0
divsd  0xee3(%rip),%xmm0
lea    0xee4(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%6.3f\00"
define void @ptime(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = sitofp i64 %6 to double
%8 = fdiv double %7, 1.000000e+03
%9 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %8)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%6.3f\00"
define void @ptime(i32* nocapture %0, i64 %1) {
%3 = sitofp i64 %1 to double
%4 = fdiv double %3, 1.000000e+03
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g5_set_xi(int, double **);
void(g5_set_xi_)(int *ni, double (*xi)[3]) { g5_set_xi(*ni, xi); }


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

x86 assembly (clang, -O2):
<g5_set_xi_>:
mov    (%rdi),%edi
jmp    1030 <g5_set_xi@plt>

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

LLVM IR (-O2):
define void @g5_set_xi_(i32* nocapture %0, [3 x double]* %1) {
%3 = load i32, i32* %0
%4 = bitcast [3 x double]* %1 to double**
%5 = tail call i32 @g5_set_xi(i32 %3, double** %4)
ret void
}
/* Type definitions */
struct mutex {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct mutex *);
void mutex_dispose(struct mutex *mutex) { free(mutex); }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @mod_udp_is_GPL_compatible() {
ret void
}
float squareRoot(float num) {
  float number = num;
  float guess = 1;
  float accuracy = 0.000001;
  while (number - guess > accuracy) {
    number = (number + guess) / 2;
    guess = num / number;
  }
  return number;
}


x86 assembly (clang, -O0):
<squareRoot>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xee9(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xed8(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1170 <squareRoot+0x70>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  0xeb5(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    112d <squareRoot+0x2d>
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<squareRoot>:
movss  0xef8(%rip),%xmm1
addss  %xmm0,%xmm1
ucomiss 0xef1(%rip),%xmm1
jbe    114e <squareRoot+0x4e>
movss  0xeeb(%rip),%xmm4
movss  0xee7(%rip),%xmm2
movss  0xed7(%rip),%xmm3
movaps %xmm0,%xmm1
addss  %xmm4,%xmm1
mulss  %xmm2,%xmm1
movaps %xmm0,%xmm4
divss  %xmm1,%xmm4
movaps %xmm1,%xmm5
subss  %xmm4,%xmm5
ucomiss %xmm3,%xmm5
ja     1130 <squareRoot+0x30>
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @squareRoot(float %0) {
%2 = fadd float %0, -1.000000e+00
%3 = fcmp ogt float %2, 0x3EB0C6F7A0000000
br i1 %3, label %4, label %12
4: ; preds = %1, %4
%5 = phi float [ %8, %4 ], [ %0, %1 ]
%6 = phi float [ %9, %4 ], [ 1.000000e+00, %1 ]
%7 = fadd float %6, %5
%8 = fmul float %7, 5.000000e-01
%9 = fdiv float %0, %8
%10 = fsub float %8, %9
%11 = fcmp ogt float %10, 0x3EB0C6F7A0000000
br i1 %11, label %4, label %12
12: ; preds = %4, %1
%13 = phi float [ %0, %1 ], [ %8, %4 ]
ret float %13
}
/* Type definitions */
struct wpabuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wpabuf_head(struct wpabuf const *);
int /*<<< orphan*/ wpabuf_len(struct wpabuf const *);
int /*<<< orphan*/ wpabuf_put_data(struct wpabuf *, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
void wpabuf_put_buf(struct wpabuf *dst, const struct wpabuf *src) {
  wpabuf_put_data(dst, wpabuf_head(src), wpabuf_len(src));
}


x86 assembly (clang, -O0):
<wpabuf_put_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <wpabuf_head@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <wpabuf_len@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    %eax,%edx
call   1050 <wpabuf_put_data@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpabuf_put_buf>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <wpabuf_head@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <wpabuf_len@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <wpabuf_put_data@plt>

LLVM IR (-O0):
%struct.wpabuf = type { i32 }
define void @wpabuf_put_buf(%struct.wpabuf* %0, %struct.wpabuf* %1) {
%3 = alloca %struct.wpabuf*
%4 = alloca %struct.wpabuf*
store %struct.wpabuf* %0, %struct.wpabuf** %3
store %struct.wpabuf* %1, %struct.wpabuf** %4
%5 = load %struct.wpabuf*, %struct.wpabuf** %3
%6 = load %struct.wpabuf*, %struct.wpabuf** %4
%7 = call i32 @wpabuf_head(%struct.wpabuf* %6)
%8 = load %struct.wpabuf*, %struct.wpabuf** %4
%9 = call i32 @wpabuf_len(%struct.wpabuf* %8)
%10 = call i32 @wpabuf_put_data(%struct.wpabuf* %5, i32 %7, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.wpabuf = type { i32 }
define void @wpabuf_put_buf(%struct.wpabuf* %0, %struct.wpabuf* %1) {
%3 = tail call i32 @wpabuf_head(%struct.wpabuf* %1)
%4 = tail call i32 @wpabuf_len(%struct.wpabuf* %1)
%5 = tail call i32 @wpabuf_put_data(%struct.wpabuf* %0, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
size_t strlen(char const *);
bool ends_with(const char *s1, const char *s2) {
  size_t z1 = strlen(s1);
  size_t z2 = strlen(s2);
  return !strcmp(s1 + z1 - z2, s2);
}


x86 assembly (clang, -O0):
<ends_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
add    -0x18(%rbp),%rdi
xor    %eax,%eax
sub    -0x20(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ends_with>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
add    %r15,%rbx
sub    %rax,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @ends_with(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %5
%9 = load i8*, i8** %4
%10 = call i64 @strlen(i8* %9)
store i64 %10, i64* %6
%11 = load i8*, i8** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i64, i64* %6
%15 = sub i64 0, %14
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8*, i8** %4
%18 = call i32 @strcmp(i8* %16, i8* %17)
%19 = icmp ne i32 %18, 0
%20 = xor i1 %19, true
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @ends_with(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = sub i64 0, %4
%7 = getelementptr inbounds i8, i8* %5, i64 %6
%8 = tail call i32 @strcmp(i8* dereferenceable(1) %7, i8* dereferenceable(1) %1)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int type;
};
struct TYPE_4__ {
  TYPE_1__ xmapping;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xmapping_type(void *_p, int _v) {
  ((XEvent *)_p)->xmapping.type = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xmapping_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xmapping_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xmapping_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int ypkg_pack_callback(void *cb_arg, char *package_name, int action,
                       double progress, char *msg) {
  printf("ypkg: %s\n", msg);
  return 0;
}


x86 assembly (clang, -O0):
<ypkg_pack_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"ypkg: %s\0A\00"
define i32 @ypkg_pack_callback(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, double %3, i8* %4) {
%6 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
char *ssort(char a[]) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @ssort(i8* nocapture readnone %0) {
ret i8* undef
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int c, x;
  c = __VERIFIER_nondet_int();
  x = __VERIFIER_nondet_int();
  while (x >= 0) {
    x = x + c;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     114b <main+0x3b>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int config_set_str(char const *, char const *, int /*<<< orphan*/ *,
                   char const *);
int config_add_row(const char *filename, const char *section, const char *row) {
  return config_set_str(filename, section, NULL, row);
}


x86 assembly (clang, -O0):
<config_add_row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edx
call   1030 <config_set_str@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_add_row>:
mov    %rdx,%rcx
xor    %edx,%edx
jmp    1030 <config_set_str@plt>

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

LLVM IR (-O2):
define i32 @config_add_row(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @config_set_str(i8* %0, i8* %1, i32* null, i8* %2)
ret i32 %4
}
/* Variables and functions */
double sin(double);
double sincFx(double x) {
  if (x == 0.0)
    return 1.0;
  else
    return sin(x * 3.14159265358979323846) / (x * 3.14159265358979323846);
}


x86 assembly (clang, -O0):
<sincFx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1147 <sincFx+0x37>
jp     1147 <sincFx+0x37>
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116f <sincFx+0x5f>
movsd  0xeb1(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  0xe9f(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sincFx>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1127 <sincFx+0x17>
jp     1127 <sincFx+0x17>
movsd  0xedb(%rip),%xmm0
pop    %rax
ret
mulsd  0xed9(%rip),%xmm0
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sincFx(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %14
7: ; preds = %1
%8 = load double, double* %3
%9 = fmul double %8, 0x400921FB54442D18
%10 = call double @sin(double %9)
%11 = load double, double* %3
%12 = fmul double %11, 0x400921FB54442D18
%13 = fdiv double %10, %12
store double %13, double* %2
br label %14
14: ; preds = %7, %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @sincFx(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fmul double %0, 0x400921FB54442D18
%5 = tail call double @sin(double %4)
%6 = fdiv double %5, %4
br label %7
7: ; preds = %1, %3
%8 = phi double [ %6, %3 ], [ 1.000000e+00, %1 ]
ret double %8
}
int test_imm_53uint16_mem(unsigned short *val) {
  return ((*val) & (-0x53 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_53uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -83
%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_53uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -83
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
long long some_huge_value() { return 1LL << 42; }


x86 assembly (clang, -O0):
<some_huge_value>:
push   %rbp
mov    %rsp,%rbp
movabs $0x40000000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<some_huge_value>:
movabs $0x40000000000,%rax
ret

LLVM IR (-O0):
define i64 @some_huge_value() {
ret i64 4398046511104
}

LLVM IR (-O2):
define i64 @some_huge_value() {
ret i64 4398046511104
}
int good_modulus(int n, int p) {
  if (!p)
    return 0;
  if (p < 1)
    return good_modulus(n, -p);
  int r = n % p;
  r = r < 0 ? r + p : r;
  return r;
}


x86 assembly (clang, -O0):
<good_modulus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1134 <good_modulus+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1187 <good_modulus+0x77>
cmpl   $0x1,-0xc(%rbp)
jge    1153 <good_modulus+0x43>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
sub    -0xc(%rbp),%esi
call   1030 <good_modulus@plt>
mov    %eax,-0x4(%rbp)
jmp    1187 <good_modulus+0x77>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1175 <good_modulus+0x65>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    117b <good_modulus+0x6b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<good_modulus>:
xor    %eax,%eax
test   %esi,%esi
je     1118 <good_modulus+0x18>
cs nopw 0x0(%rax,%rax,1)
test   %esi,%esi
jg     1119 <good_modulus+0x19>
neg    %esi
jb     1110 <good_modulus+0x10>
ret
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
sar    $0x1f,%eax
and    %esi,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @good_modulus(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %2
store i32 0, i32* %3
br label %33
10: ; preds = %2
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 1
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = sub nsw i32 0, %15
%17 = call i32 @good_modulus(i32 %14, i32 %16)
store i32 %17, i32* %3
br label %33
18: ; preds = %10
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = srem i32 %19, %20
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = icmp slt i32 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %18
%25 = load i32, i32* %6
%26 = load i32, i32* %5
%27 = add nsw i32 %25, %26
br label %30
28: ; preds = %18
%29 = load i32, i32* %6
br label %30
30: ; preds = %28, %24
%31 = phi i32 [ %27, %24 ], [ %29, %28 ]
store i32 %31, i32* %6
%32 = load i32, i32* %6
store i32 %32, i32* %3
br label %33
33: ; preds = %30, %13, %9
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
define i32 @good_modulus(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %7
%5 = phi i32 [ %8, %7 ], [ %1, %2 ]
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = sub nsw i32 0, %5
%9 = icmp eq i32 %5, 0
br i1 %9, label %15, label %4
10: ; preds = %4
%11 = srem i32 %0, %5
%12 = icmp slt i32 %11, 0
%13 = select i1 %12, i32 %5, i32 0
%14 = add nsw i32 %13, %11
br label %15
15: ; preds = %7, %2, %10
%16 = phi i32 [ %14, %10 ], [ 0, %2 ], [ 0, %7 ]
ret i32 %16
}
int getAccountBalance(char atmCardNumber[]) { return 5400; }


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

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

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

LLVM IR (-O2):
define i32 @getAccountBalance(i8* nocapture readnone %0) {
ret i32 5400
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void foo(int x) { assert(x == 3); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmp    $0x3,%edi
sete   %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 3
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp eq i32 %0, 3
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int vfs_unlink(char *);
int rm(char *path) {
  if (!path)
    return -1;
  printf("\nC:\\RM %s\n", path);
  int ret = vfs_unlink(path);
  return ret;
}


x86 assembly (clang, -O0):
<rm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <rm+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1165 <rm+0x45>
mov    -0x10(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <vfs_unlink@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rm>:
test   %rdi,%rdi
je     1141 <rm+0x21>
push   %rbx
mov    %rdi,%rbx
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <vfs_unlink@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"\0AC:\\RM %s\0A\00"
define i32 @rm(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @vfs_unlink(i8* %0)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ -1, %1 ]
ret i32 %7
}
int fun419() { return 419; }


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

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

LLVM IR (-O0):
define i32 @fun419() {
ret i32 419
}

LLVM IR (-O2):
define i32 @fun419() {
ret i32 419
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, void *);
double second(void) {
  struct timeval timestr;
  void *Tzp = 0;
  gettimeofday(&timestr, Tzp);
  return (double)timestr.tv_sec + 1.0E-06 * (double)timestr.tv_usec;
}


x86 assembly (clang, -O0):
<second>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    -0x10(%rbp),%rdi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xebf(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<second>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @second() {
%1 = alloca %struct.timeval
%2 = alloca i8*
store i8* null, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @gettimeofday(%struct.timeval* %1, i8* %3)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %10, double %7)
ret double %11
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @second() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i8* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = tail call double @llvm.fmuladd.f64(double %9, double 0x3EB0C6F7A0B5ED8D, double %6)
ret double %10
}
unsigned long gt_cstr_array_size(const char **gt_cstr_array) {
  unsigned long i = 0;
  while (gt_cstr_array[i])
    i++;
  return i;
}


x86 assembly (clang, -O0):
<gt_cstr_array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1134 <gt_cstr_array_size+0x34>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <gt_cstr_array_size+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_cstr_array_size>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <gt_cstr_array_size+0x10>
ret

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

LLVM IR (-O2):
define i64 @gt_cstr_array_size(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *newstr(char *str) {
  char *tempstr = malloc(sizeof(char) * strlen(str) + 1);
  if (tempstr != NULL)
    strcpy(tempstr, str);
  return tempstr;
}


x86 assembly (clang, -O0):
<newstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cltq
shl    $0x0,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1172 <newstr+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newstr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1157 <newstr+0x27>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @newstr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
void prefetch(const void *x) {}


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

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

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

LLVM IR (-O2):
define void @prefetch(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int uasm_in_compat_space_p(long addr) { return addr == (int)addr; }


x86 assembly (clang, -O0):
<uasm_in_compat_space_p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq %ecx,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uasm_in_compat_space_p>:
movslq %edi,%rcx
xor    %eax,%eax
cmp    %rdi,%rcx
sete   %al
ret

LLVM IR (-O0):
define i32 @uasm_in_compat_space_p(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = sext i32 %5 to i64
%7 = icmp eq i64 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @uasm_in_compat_space_p(i64 %0) {
%2 = add i64 %0, 2147483648
%3 = icmp ult i64 %2, 4294967296
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ callrts(char *);
div2() { callrts("ccdiv2"); }


x86 assembly (clang, -O0):
<div2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <callrts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"ccdiv2\00"
define i32 @div2() {
%1 = alloca i32
%2 = call i32 @callrts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [7 x i8] c"ccdiv2\00"
define i32 @div2() {
%1 = tail call i32 @callrts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int switchStatementFunction() {
  auto int n;
  auto int m;
  switch (n) {
  case 1:
    return n;
  case 2:
    return m;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<switchStatementFunction>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     1129 <switchStatementFunction+0x29>
jmp    1118 <switchStatementFunction+0x18>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1134 <switchStatementFunction+0x34>
jmp    113f <switchStatementFunction+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <switchStatementFunction+0x46>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <switchStatementFunction+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @switchStatementFunction() {
ret i32 0
}
int ld_ble_mr1(long double *a1, long double a2) {
  return (__builtin_islessequal(*a1, a2));
}


x86 assembly (clang, -O0):
<ld_ble_mr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
fldt   -0x20(%rbp)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_ble_mr1>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
ret

LLVM IR (-O0):
define i32 @ld_ble_mr1(x86_fp80* %0, x86_fp80 %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80
store x86_fp80* %0, x86_fp80** %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80, x86_fp80* %4
%8 = fcmp ole x86_fp80 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @ld_ble_mr1(x86_fp80* nocapture %0, x86_fp80 %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = fcmp ole x86_fp80 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
int test_imm_E0uint8_reg(unsigned char val) {
  return ((val) & (-0xE0 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E0uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 32
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double dbl_abs(double a) { return a < 0 ? -a : a; }


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

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

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

LLVM IR (-O2):
define double @dbl_abs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void SECRET_EXIT(void) {
  printf("DEFENSE SUCCESS\n\r");
  exit(0);
}


x86 assembly (clang, -O0):
<SECRET_EXIT>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<SECRET_EXIT>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"DEFENSE SUCCESS\0A\0D\00"
define void @SECRET_EXIT() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"DEFENSE SUCCESS\0A\0D\00"
define void @SECRET_EXIT() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ scan_for_loop();
int main(void) {
  scan_for_loop();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @scan_for_loop()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ getcwd(char *, int);
char *malloc(int);
char *cheminAbsolu(char *chemin_relatif) {
  char *result = malloc(200 * sizeof(char));
  chdir(chemin_relatif);
  getcwd(result, 200);
  return result;
}


x86 assembly (clang, -O0):
<cheminAbsolu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xc8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <chdir@plt>
mov    -0x10(%rbp),%rdi
mov    $0xc8,%esi
call   1040 <getcwd@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cheminAbsolu>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xc8,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <chdir@plt>
mov    %rbx,%rdi
mov    $0xc8,%esi
call   1040 <getcwd@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @cheminAbsolu(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @malloc(i32 200)
store i8* %4, i8** %3
%5 = load i8*, i8** %2
%6 = call i32 @chdir(i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 @getcwd(i8* %7, i32 200)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @cheminAbsolu(i8* %0) {
%2 = tail call dereferenceable_or_null(200) i8* @malloc(i32 200)
%3 = tail call i32 @chdir(i8* %0)
%4 = tail call i32 @getcwd(i8* %2, i32 200)
ret i8* %2
}
/* Forward declarations */
typedef struct TYPE_6__ TYPE_3__;
typedef struct TYPE_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  scalar_t__ s;
};
struct TYPE_5__ {
  TYPE_1__ data;
};
struct TYPE_6__ {
  TYPE_2__ xclient;
};
typedef TYPE_3__ XEvent;

/* Variables and functions */
void *get_XEvent_xclient_data_s(void *_p) {
  return (void *)(((XEvent *)_p)->xclient.data.s);
}


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

x86 assembly (clang, -O2):
<get_XEvent_xclient_data_s>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_6__ = type { %struct.TYPE_5__ }
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i64 }
define i8* @get_XEvent_xclient_data_s(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_6__*
%5 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %5, i32 0, i32 0
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @get_XEvent_xclient_data_s(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}