xunge/DecIR huggingface dataset:
void PWM_init(void *pwm_address) {
  *((volatile char *)*((volatile int *)pwm_address + 3)) = 0;
  *((volatile char *)*((volatile int *)pwm_address + 3) + 1) = 0;
}


x86 assembly (clang, -O0):
<PWM_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
cltq
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
cltq
movb   $0x0,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWM_init>:
movslq 0xc(%rdi),%rax
movb   $0x0,(%rax)
movslq 0xc(%rdi),%rax
movb   $0x0,0x1(%rax)
ret

LLVM IR (-O0):
define void @PWM_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 3
%6 = load volatile i32, i32* %5
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
store volatile i8 0, i8* %8
%9 = load i8*, i8** %2
%10 = bitcast i8* %9 to i32*
%11 = getelementptr inbounds i32, i32* %10, i64 3
%12 = load volatile i32, i32* %11
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
%15 = getelementptr inbounds i8, i8* %14, i64 1
store volatile i8 0, i8* %15
ret void
}

LLVM IR (-O2):
define void @PWM_init(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 12
%3 = bitcast i8* %2 to i32*
%4 = load volatile i32, i32* %3
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
store volatile i8 0, i8* %6
%7 = load volatile i32, i32* %3
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = getelementptr inbounds i8, i8* %9, i64 1
store volatile i8 0, i8* %10
ret void
}
/* Variables and functions */
double gsl_cdf_ugaussian_P(double const);
double gsl_cdf_gaussian_P(const double x, const double sigma) {
  return gsl_cdf_ugaussian_P(x / sigma);
}


x86 assembly (clang, -O0):
<gsl_cdf_gaussian_P>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <gsl_cdf_ugaussian_P@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsl_cdf_gaussian_P>:
divsd  %xmm1,%xmm0
jmp    1030 <gsl_cdf_ugaussian_P@plt>

LLVM IR (-O0):
define double @gsl_cdf_gaussian_P(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %5, %6
%8 = call double @gsl_cdf_ugaussian_P(double %7)
ret double %8
}

LLVM IR (-O2):
define double @gsl_cdf_gaussian_P(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call double @gsl_cdf_ugaussian_P(double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ decrRefCount(void *);
void decrRefCountVoid(void *o) { decrRefCount(o); }


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

x86 assembly (clang, -O2):
<decrRefCountVoid>:
jmp    1030 <decrRefCount@plt>

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

LLVM IR (-O2):
define void @decrRefCountVoid(i8* %0) {
%2 = tail call i32 @decrRefCount(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ yr_re_finalize_thread();
void yr_finalize_thread(void) { yr_re_finalize_thread(); }


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

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

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

LLVM IR (-O2):
define void @yr_finalize_thread() {
%1 = tail call i32 (...) @yr_re_finalize_thread()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
test1(void) {
  int foo;
  printf("%d\n", 1 && 2 || 3 && 4);
  0;
}


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

x86 assembly (clang, -O2):
<test1>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @test1() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 undef
}
char *dog_ident() { return "$Id: dog_reciva.c 230 2007-10-23 17:42:49Z  $"; }


x86 assembly (clang, -O0):
<dog_ident>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dog_ident>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [46 x i8] c"$Id: dog_reciva.c 230 2007-10-23 17:42:49Z $\00"
define i8* @dog_ident() {
ret i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [46 x i8] c"$Id: dog_reciva.c 230 2007-10-23 17:42:49Z $\00"
define i8* @dog_ident() {
ret i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0)
}
void unbecome_root(void) { return; }


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

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

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

LLVM IR (-O2):
define void @unbecome_root() {
ret void
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};
typedef int /*<<< orphan*/ query;

/* Variables and functions */
char *sqlQuickString(struct sqlConnection *, char *);
int /*<<< orphan*/ sqlSafef(char *, int, char *, int);
char *visiGeneCaption(struct sqlConnection *conn, int id) {
  char query[256];
  sqlSafef(query, sizeof(query),
           "select caption.caption from image,imageFile,caption "
           "where image.id = %d "
           "and image.imageFile = imageFile.id "
           "and imageFile.caption = caption.id",
           id);
  return sqlQuickString(conn, query);
}


x86 assembly (clang, -O0):
<visiGeneCaption>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x100,%esi
lea    0xeb8(%rip),%rdx
call   1040 <sqlSafef@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1030 <sqlQuickString@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<visiGeneCaption>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %esi,%ecx
mov    %rdi,%rbx
lea    0xeca(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x100,%esi
call   1040 <sqlSafef@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <sqlQuickString@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [142 x i8] c"select caption.caption from image,imageFile,caption where image.id = %d and image.imageFile = imageFile.id and imageFile.caption = caption.id\00"
define i8* @visiGeneCaption(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
%5 = alloca [256 x i8]
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @sqlSafef(i8* %6, i32 256, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = call i8* @sqlQuickString(%struct.sqlConnection* %9, i8* %10)
ret i8* %11
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [142 x i8] c"select caption.caption from image,imageFile,caption where image.id = %d and image.imageFile = imageFile.id and imageFile.caption = caption.id\00"
define i8* @visiGeneCaption(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @sqlSafef(i8* %4, i32 256, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i8* @sqlQuickString(%struct.sqlConnection* %0, i8* %4)
ret i8* %6
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int UINT64_C(int);
int xorshift128plus_int();
double xorshift128plus_double(void) {
  const uint64_t x = xorshift128plus_int();
  const uint64_t x_doublefied = UINT64_C(0x3FF) << 52 | x >> 12;
  return *((double *)&x_doublefied) - 1.0;
}


x86 assembly (clang, -O0):
<xorshift128plus_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <xorshift128plus_int@plt>
mov    %eax,-0x4(%rbp)
mov    $0x3ff,%edi
call   1030 <UINT64_C@plt>
mov    $0x34,%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%ecx
sar    $0xc,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xea5(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xorshift128plus_double>:
push   %rax
xor    %eax,%eax
call   1040 <xorshift128plus_int@plt>
mov    $0x3ff,%edi
call   1030 <UINT64_C@plt>
movsd  0xec6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @xorshift128plus_double() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @xorshift128plus_int()
store i32 %3, i32* %1
%4 = call i32 @UINT64_C(i32 1023)
%5 = shl i32 %4, 52
%6 = load i32, i32* %1
%7 = ashr i32 %6, 12
%8 = or i32 %5, %7
store i32 %8, i32* %2
%9 = bitcast i32* %2 to double*
%10 = load double, double* %9
%11 = fsub double %10, 1.000000e+00
ret double %11
}

LLVM IR (-O2):
define double @xorshift128plus_double() {
%1 = tail call i32 (...) @xorshift128plus_int()
%2 = tail call i32 @UINT64_C(i32 1023)
ret double 0x7FF8000000000000
}
/* Variables and functions */
int /*<<< orphan*/ g5_calculate_force_on_xMC(int, double **, double **,
                                             double *, int);
void(g5_calculate_force_on_xMC_)(int *devid, double (*x)[3], double (*a)[3],
                                 double *p, int *ni) {
  g5_calculate_force_on_xMC(*devid, x, a, p, *ni);
}


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

x86 assembly (clang, -O2):
<g5_calculate_force_on_xMC_>:
mov    (%rdi),%edi
mov    (%r8),%r8d
jmp    1030 <g5_calculate_force_on_xMC@plt>

LLVM IR (-O0):
define void @g5_calculate_force_on_xMC_(i32* %0, [3 x double]* %1, [3 x double]* %2, double* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca [3 x double]*
%8 = alloca [3 x double]*
%9 = alloca double*
%10 = alloca i32*
store i32* %0, i32** %6
store [3 x double]* %1, [3 x double]** %7
store [3 x double]* %2, [3 x double]** %8
store double* %3, double** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = load [3 x double]*, [3 x double]** %7
%14 = bitcast [3 x double]* %13 to double**
%15 = load [3 x double]*, [3 x double]** %8
%16 = bitcast [3 x double]* %15 to double**
%17 = load double*, double** %9
%18 = load i32*, i32** %10
%19 = load i32, i32* %18
%20 = call i32 @g5_calculate_force_on_xMC(i32 %12, double** %14, double** %16, double* %17, i32 %19)
ret void
}

LLVM IR (-O2):
define void @g5_calculate_force_on_xMC_(i32* nocapture %0, [3 x double]* %1, [3 x double]* %2, double* %3, i32* nocapture %4) {
%6 = load i32, i32* %0
%7 = bitcast [3 x double]* %1 to double**
%8 = bitcast [3 x double]* %2 to double**
%9 = load i32, i32* %4
%10 = tail call i32 @g5_calculate_force_on_xMC(i32 %6, double** %7, double** %8, double* %3, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_update_sample_rate() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_update_sample_rate"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"NOT IMPLEMENTED:pa_stream_update_sample_rate\0A\00"
define i32 @pa_stream_update_sample_rate() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [45 x i8] c"NOT IMPLEMENTED:pa_stream_update_sample_rate\00"
define i32 @pa_stream_update_sample_rate() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int compiler_run(int, char **);
int main(int argc, char *argv[]) { return compiler_run(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <compiler_run@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @compiler_run(i32 %0, i8** %1)
ret i32 %3
}
void urecursiveboehmregistersoftware_func() {
  char c = 0;
  switch (c) {}
}


x86 assembly (clang, -O0):
<urecursiveboehmregistersoftware_func>:
push   %rbp
mov    %rsp,%rbp
movb   $0x0,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @urecursiveboehmregistersoftware_func() {
%1 = alloca i8
store i8 0, i8* %1
%2 = load i8, i8* %1
%3 = sext i8 %2 to i32
switch i32 %3, label %4 [
]
4: ; preds = %0
ret void
}

LLVM IR (-O2):
define void @urecursiveboehmregistersoftware_func() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
const char *hstrerror(int herr) {
  {
    static char buf[100];
    sprintf(buf, "Host lookup error %d", herr);
    return buf;
  }
}


x86 assembly (clang, -O0):
<hstrerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hstrerror>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@hstrerror.buf = internal global [100 x i8] zeroinitializer
@.str = [21 x i8] c"Host lookup error %d\00"
define i8* @hstrerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @hstrerror.buf, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @hstrerror.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@hstrerror.buf = internal global [100 x i8] zeroinitializer
@.str = [21 x i8] c"Host lookup error %d\00"
define i8* @hstrerror(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @hstrerror.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @hstrerror.buf, i64 0, i64 0)
}
void iwl_free_traffic_mem(struct iwl_priv *priv) {}


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

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

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

LLVM IR (-O2):
%struct.iwl_priv = type opaque
define void @iwl_free_traffic_mem(%struct.iwl_priv* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint32_t pk_time32_useconds() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (uint32_t)(tv.tv_sec * (1e+6)) + tv.tv_usec;
}


x86 assembly (clang, -O0):
<pk_time32_useconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pk_time32_useconds>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x8(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
cvttsd2si %xmm0,%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @pk_time32_useconds() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 1.000000e+06
%7 = fptosi double %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %7, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @pk_time32_useconds() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 1.000000e+06
%8 = fptosi double %7 to i64
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load i64, i64* %9
%11 = add nsw i64 %10, %8
ret i64 %11
}
long sav_file_format_version(long format_code) {
  if ((format_code & 0x004000))
    return 3;
  return 2;
}


x86 assembly (clang, -O0):
<sav_file_format_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x4000,%rax
cmp    $0x0,%rax
je     1129 <sav_file_format_version+0x29>
movq   $0x3,-0x8(%rbp)
jmp    1131 <sav_file_format_version+0x31>
movq   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sav_file_format_version>:
and    $0x4000,%edi
cmp    $0x1,%rdi
mov    $0x3,%eax
sbb    $0x0,%rax
ret

LLVM IR (-O0):
define i64 @sav_file_format_version(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = and i64 %4, 16384
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 3, i64* %2
br label %9
8: ; preds = %1
store i64 2, i64* %2
br label %9
9: ; preds = %8, %7
%10 = load i64, i64* %2
ret i64 %10
}

LLVM IR (-O2):
define i64 @sav_file_format_version(i64 %0) {
%2 = and i64 %0, 16384
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i64 2, i64 3
ret i64 %4
}
float foo_float(_Complex float x) { return crealf(x); }


x86 assembly (clang, -O0):
<foo_float>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @foo_float(<2 x float> %0) {
%2 = alloca { float, float }
%3 = bitcast { float, float }* %2 to <2 x float>*
store <2 x float> %0, <2 x float>* %3
%4 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%5 = load float, float* %4
%6 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%7 = load float, float* %6
ret float %5
}

LLVM IR (-O2):
define float @foo_float(<2 x float> %0) {
%2 = extractelement <2 x float> %0, i64 0
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
void *MAP_FAILED;
void *mmap(void *addr __attribute__((unused)),
           size_t lenhth __attribute__((unused)),
           int prot __attribute__((unused)), int flags __attribute__((unused)),
           int fildes __attribute__((unused)), off_t off) {
  return MAP_FAILED;
}


x86 assembly (clang, -O0):
<mmap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmap>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@MAP_FAILED = global i8* null
define i8* @mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i64 %1, i64* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i8*, i8** @MAP_FAILED
ret i8* %13
}

LLVM IR (-O2):
@MAP_FAILED = global i8* null
define i8* @mmap(i8* nocapture readnone %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = load i8*, i8** @MAP_FAILED
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int res_query(const char *dname, int class, int type, unsigned char *answer,
              int anslen) {
  printf(">>> res_query(%s)\n", dname);
  return -1;
}


x86 assembly (clang, -O0):
<res_query>:
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),%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [19 x i8] c">>> res_query(%s)\0A\00"
define i32 @res_query(i8* %0, i32 %1, i32 %2, i8* nocapture readnone %3, i32 %4) {
%6 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 -1
}
/* Variables and functions */
int raster_normalization(void *, void const *, long const *, long, size_t,
                         int /*<<< orphan*/ *);
int edf_raster_normalization(void *dest, const void *src, const long data_dim[],
                             long raster_configuration, size_t item) {
  return (raster_normalization(dest, src, data_dim, raster_configuration, item,
                               NULL));
}


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

x86 assembly (clang, -O2):
<edf_raster_normalization>:
xor    %r9d,%r9d
jmp    1030 <raster_normalization@plt>

LLVM IR (-O0):
define i32 @edf_raster_normalization(i8* %0, i8* %1, i64* %2, i64 %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i64
%10 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64* %2, i64** %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i64*, i64** %8
%14 = load i64, i64* %9
%15 = load i64, i64* %10
%16 = call i32 @raster_normalization(i8* %11, i8* %12, i64* %13, i64 %14, i64 %15, i32* null)
ret i32 %16
}

LLVM IR (-O2):
define i32 @edf_raster_normalization(i8* %0, i8* %1, i64* %2, i64 %3, i64 %4) {
%6 = tail call i32 @raster_normalization(i8* %0, i8* %1, i64* %2, i64 %3, i64 %4, i32* null)
ret i32 %6
}
void efi_rtc_exit(void) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @efi_rtc_exit() {
ret void
}
/* Variables and functions */
scalar_t__ isdigit(int);
int isxdigit(int c) {
  return isdigit(c) || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f');
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1175 <isxdigit+0x65>
mov    $0x41,%eax
cmp    -0x4(%rbp),%eax
jg     1152 <isxdigit+0x42>
mov    $0x1,%al
cmpl   $0x46,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1175 <isxdigit+0x65>
xor    %eax,%eax
mov    $0x61,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x6(%rbp)
jg     116f <isxdigit+0x5f>
cmpl   $0x66,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
and    $0xffffffdf,%ebx
add    $0xffffffbf,%ebx
cmp    $0x6,%ebx
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isdigit(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %20, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sle i32 65, %7
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 70
br i1 %11, label %20, label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
%14 = icmp sle i32 97, %13
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp sle i32 %16, 102
br label %18
18: ; preds = %15, %12
%19 = phi i1 [ false, %12 ], [ %17, %15 ]
br label %20
20: ; preds = %18, %9, %1
%21 = phi i1 [ true, %9 ], [ true, %1 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = tail call i64 @isdigit(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %6, %3
%8 = zext i1 %7 to i32
ret i32 %8
}
__attribute__((always_)) void debug_objects_mem_init(void) {}


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

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

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

LLVM IR (-O2):
define void @debug_objects_mem_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void clearPrompt(void) {
  write(1, "\r", 1);
  for (int i = 0; i < 1024; i++) {
    write(1, "\33[1P", 4);
  }
  write(1, ">> ", 3);
}


x86 assembly (clang, -O0):
<clearPrompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edx
lea    0xedc(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x400,-0x4(%rbp)
jge    1163 <clearPrompt+0x53>
mov    $0x1,%edi
lea    0xeb7(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <clearPrompt+0x22>
mov    $0x1,%edi
lea    0xe98(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearPrompt>:
push   %rbp
push   %rbx
push   %rax
lea    0xee6(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x400,%ebp
lea    0xecd(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <write@plt>
add    $0xffffffff,%ebp
jne    1140 <clearPrompt+0x30>
lea    0xea9(%rip),%rsi
mov    $0x1,%edi
mov    $0x3,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0D\00"
@.str.1 = [5 x i8] c"\1B[1P\00"
@.str.2 = [4 x i8] c">> \00"
define void @clearPrompt() {
%1 = alloca i32
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 1024
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @write(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
br label %8
8: ; preds = %6
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %3
11: ; preds = %3
%12 = call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0D\00"
@.str.1 = [5 x i8] c"\1B[1P\00"
@.str.2 = [4 x i8] c">> \00"
define void @clearPrompt() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %4
2: ; preds = %4
%3 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
ret void
4: ; preds = %0, %4
%5 = phi i32 [ 0, %0 ], [ %7, %4 ]
%6 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, 1024
br i1 %8, label %2, label %4
}
int is_prime(int n) {
  int i;
  for (i = 2; i < n; i++)
    if (!(n % i))
      break;
  if (i == n)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1142 <is_prime+0x42>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    112f <is_prime+0x2f>
jmp    1142 <is_prime+0x42>
jmp    1134 <is_prime+0x34>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    115a <is_prime+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1161 <is_prime+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x2,%ecx
cmp    $0x3,%edi
jl     1122 <is_prime+0x22>
mov    $0x2,%ecx
nop
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1122 <is_prime+0x22>
add    $0x1,%ecx
cmp    %ecx,%edi
jne    1110 <is_prime+0x10>
mov    %edi,%ecx
xor    %eax,%eax
cmp    %edi,%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %10
3: ; preds = %1, %7
%4 = phi i32 [ %8, %7 ], [ 2, %1 ]
%5 = srem i32 %0, %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %7, %3, %1
%11 = phi i32 [ 2, %1 ], [ %4, %3 ], [ %0, %7 ]
%12 = icmp eq i32 %11, %0
%13 = zext i1 %12 to i32
ret i32 %13
}
void freeCharArray(char **arr, int dim1) {
  int i;
  for (i = 0; i < dim1; i++)
    free(arr[i]);
  free(arr);
}


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

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

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

LLVM IR (-O2):
define void @freeCharArray(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ stderr;
void oom(void) {
  static const char e[] = "Out of memory\n";
  fprintf(stderr, e);
  abort();
}


x86 assembly (clang, -O0):
<oom>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<oom>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@oom.e = internal constant [15 x i8] c"Out of memory\0A\00"
@stderr = global i32 0
define void @oom() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @oom.e, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@oom.e = internal constant [15 x i8] c"Out of memory\0A\00"
@stderr = global i32 0
define void @oom() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @oom.e, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int inputint(char *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n, somma;
  do {
    n = inputint("un numero", n);
  } while (n >= 100);
  while (n != 0) {
    if ((n % 2) == 0) {
      somma += n;
    }
    n--;
  }
  printf("la somma e\'%d\n", somma);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1040 <inputint@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    112f <main+0xf>
jmp    1150 <main+0x30>
cmpl   $0x0,-0x8(%rbp)
je     1185 <main+0x65>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1177 <main+0x57>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1150 <main+0x30>
mov    -0xc(%rbp),%esi
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [10 x i8] c"un numero\00"
@.str.1 = [15 x i8] c"la somma e'%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = call i32 @inputint(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 %6, i32* %2
br label %7
7: ; preds = %4
%8 = load i32, i32* %2
%9 = icmp sge i32 %8, 100
br i1 %9, label %4, label %10
10: ; preds = %7
br label %11
11: ; preds = %22, %10
%12 = load i32, i32* %2
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %25
14: ; preds = %11
%15 = load i32, i32* %2
%16 = srem i32 %15, 2
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = add nsw i32 %20, %19
store i32 %21, i32* %3
br label %22
22: ; preds = %18, %14
%23 = load i32, i32* %2
%24 = add nsw i32 %23, -1
store i32 %24, i32* %2
br label %11
25: ; preds = %11
%26 = load i32, i32* %3
%27 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %26)
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
unsigned char
unsignedchar_ignoring_unsignedlonglongint(unsigned char x,
                                          unsigned long long int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedchar_ignoring_unsignedlonglongint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @unsignedchar_ignoring_unsignedlonglongint(i8 returned zeroext %0, i64 %1) {
ret i8 %0
}
int mcf_pinmux_is_valid(unsigned pinmux) { return pinmux != -1; }


x86 assembly (clang, -O0):
<mcf_pinmux_is_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcf_pinmux_is_valid>:
xor    %eax,%eax
cmp    $0xffffffff,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @mcf_pinmux_is_valid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @mcf_pinmux_is_valid(i32 %0) {
%2 = icmp ne i32 %0, -1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ sqrt(int);
int calculdelta(int x, int y, int sizeXScreen, int sizeYScreen) {
  int centre_x = sizeXScreen / 2;
  int centre_y = sizeYScreen / 2;
  int delta_x = x - centre_x;
  int delta_y = y - centre_y;
  int delta = (int)sqrt((delta_x * delta_x) + (delta_y * delta_y));
  return delta;
}


x86 assembly (clang, -O0):
<calculdelta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
imul   -0x1c(%rbp),%edi
mov    -0x20(%rbp),%eax
imul   -0x20(%rbp),%eax
add    %eax,%edi
call   1030 <sqrt@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculdelta>:
mov    %edx,%eax
shr    $0x1f,%eax
add    %edx,%eax
sar    %eax
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
sub    %eax,%edi
sub    %edx,%esi
imul   %edi,%edi
imul   %esi,%esi
add    %esi,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define i32 @calculdelta(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%14 = load i32, i32* %7
%15 = sdiv i32 %14, 2
store i32 %15, i32* %9
%16 = load i32, i32* %8
%17 = sdiv i32 %16, 2
store i32 %17, i32* %10
%18 = load i32, i32* %5
%19 = load i32, i32* %9
%20 = sub nsw i32 %18, %19
store i32 %20, i32* %11
%21 = load i32, i32* %6
%22 = load i32, i32* %10
%23 = sub nsw i32 %21, %22
store i32 %23, i32* %12
%24 = load i32, i32* %11
%25 = load i32, i32* %11
%26 = mul nsw i32 %24, %25
%27 = load i32, i32* %12
%28 = load i32, i32* %12
%29 = mul nsw i32 %27, %28
%30 = add nsw i32 %26, %29
%31 = call i64 @sqrt(i32 %30)
%32 = trunc i64 %31 to i32
store i32 %32, i32* %13
%33 = load i32, i32* %13
ret i32 %33
}

LLVM IR (-O2):
define i32 @calculdelta(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sdiv i32 %2, -2
%6 = sdiv i32 %3, -2
%7 = add i32 %5, %0
%8 = add i32 %6, %1
%9 = mul nsw i32 %7, %7
%10 = mul nsw i32 %8, %8
%11 = add nuw nsw i32 %10, %9
%12 = tail call i64 @sqrt(i32 %11)
%13 = trunc i64 %12 to i32
ret i32 %13
}
int main(int argc, char **argv) {
  int (*fn)(int, int);
  fn = get_callback_function();
  return fn(7, 3);
}


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)
mov    $0x0,%al
call   1030 <get_callback_function@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    $0x7,%edi
mov    $0x3,%esi
call   *-0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <get_callback_function@plt>
cltq
mov    $0x7,%edi
mov    $0x3,%esi
pop    %rcx
jmp    *%rax

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32 (i32, i32)*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @get_callback_function()
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32 (i32, i32)*
store i32 (i32, i32)* %9, i32 (i32, i32)** %6
%10 = load i32 (i32, i32)*, i32 (i32, i32)** %6
%11 = call i32 %10(i32 7, i32 3)
ret i32 %11
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @get_callback_function()
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32 (i32, i32)*
%6 = tail call i32 %5(i32 7, i32 3)
ret i32 %6
}
int IsDigit(char c) { return (c >= '0') && (c <= '9'); }


x86 assembly (clang, -O0):
<IsDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <IsDigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsDigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @IsDigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @IsDigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dijkstra();
int /*<<< orphan*/ lista_adjacencia();
int /*<<< orphan*/ puts(char *);
int main() {
  lista_adjacencia();
  dijkstra();
  puts("\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @lista_adjacencia()
%2 = tail call i32 (...) @dijkstra()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void __signbitf(float __x) {
  int __m;
  asm("pmovmskb %1, %0" : "=r"(__m) : "x"(__x));
}


x86 assembly (clang, -O0):
<__signbitf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pmovmskb %xmm0,%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @__signbitf(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = call i32 asm "pmovmskb $1, $0", "=r,x,~{dirflag},~{fpsr},~{flags}"(float %4)
store i32 %5, i32* %3
ret void
}

LLVM IR (-O2):
define void @__signbitf(float %0) {
%2 = tail call i32 asm "pmovmskb $1, $0", "=r,x,~{dirflag},~{fpsr},~{flags}"(float %0)
ret void
}
void report_Socket_Close(void) {}


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

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

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

LLVM IR (-O2):
define void @report_Socket_Close() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
short gshortor(short x, short y) {
  x |= y;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<gshortor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%ecx
movswl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x2(%rbp)
cmpw   $0x0,-0x2(%rbp)
jne    1148 <gshortor+0x38>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gshortor>:
push   %rbx
mov    %edi,%ebx
or     %esi,%ebx
test   %bx,%bx
jne    1121 <gshortor+0x11>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i16 @gshortor(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = sext i16 %5 to i32
%7 = load i16, i16* %3
%8 = sext i16 %7 to i32
%9 = or i32 %8, %6
%10 = trunc i32 %9 to i16
store i16 %10, i16* %3
%11 = load i16, i16* %3
%12 = icmp ne i16 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %2
%14 = call i32 @foo(i8* null)
br label %15
15: ; preds = %13, %2
%16 = load i16, i16* %3
ret i16 %16
}

LLVM IR (-O2):
define signext i16 @gshortor(i16 signext %0, i16 signext %1) {
%3 = or i16 %1, %0
%4 = icmp eq i16 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i16 %3
}