xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char const *);
bool is_options_param(const char *param) {
  return (param != NULL && (strlen(param) >= 2) && (param[0] == '-'));
}


x86 assembly (clang, -O0):
<is_options_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1155 <is_options_param+0x45>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x2,%ecx
mov    %al,-0x9(%rbp)
jl     1155 <is_options_param+0x45>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_options_param>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
test   %rdi,%rdi
je     1130 <is_options_param+0x20>
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     1130 <is_options_param+0x20>
xor    %ebp,%ebp
cmpb   $0x2d,(%rbx)
sete   %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_options_param(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %15
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = icmp sge i32 %7, 2
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 45
br label %15
15: ; preds = %9, %5, %1
%16 = phi i1 [ false, %5 ], [ false, %1 ], [ %14, %9 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @is_options_param(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp sgt i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 45
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %1
%11 = phi i32 [ 0, %3 ], [ 0, %1 ], [ %9, %6 ]
ret i32 %11
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
void arsecond_(double *wallc) {
  struct timeval tv;
  struct timezone tz;
  long rsec;
  gettimeofday(&tv, &tz);
  rsec = tv.tv_sec - 959800000;
  *wallc = (double)rsec + (double)(tv.tv_usec) / 1000000.;
  return;
}


x86 assembly (clang, -O0):
<arsecond_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <gettimeofday@plt>
mov    -0x18(%rbp),%eax
sub    $0x393562c0,%eax
cltq
mov    %rax,-0x28(%rbp)
cvtsi2sdq -0x28(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xeb5(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arsecond_>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <gettimeofday@plt>
mov    $0xc6ca9d40,%eax
add    0x10(%rsp),%eax
cvtsi2sd %eax,%xmm0
cvtsi2sdq 0x18(%rsp),%xmm1
divsd  0xebd(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
%struct.timezone = type { i32 }
define void @arsecond_(double* %0) {
%2 = alloca double*
%3 = alloca %struct.timeval
%4 = alloca %struct.timezone
%5 = alloca i64
store double* %0, double** %2
%6 = call i32 @gettimeofday(%struct.timeval* %3, %struct.timezone* %4)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = sub nsw i32 %8, 959800000
%10 = sext i32 %9 to i64
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = sitofp i64 %11 to double
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%14 = load i64, i64* %13
%15 = sitofp i64 %14 to double
%16 = fdiv double %15, 1.000000e+06
%17 = fadd double %12, %16
%18 = load double*, double** %2
store double %17, double* %18
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
%struct.timezone = type { i32 }
define void @arsecond_(double* nocapture writeonly %0) {
%2 = alloca %struct.timeval
%3 = alloca %struct.timezone
%4 = bitcast %struct.timeval* %2 to i8*
%5 = bitcast %struct.timezone* %3 to i8*
%6 = call i32 @gettimeofday(%struct.timeval* %2, %struct.timezone* %3)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = add nsw i32 %8, -959800000
%10 = sitofp i32 %9 to double
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%12 = load i64, i64* %11
%13 = sitofp i64 %12 to double
%14 = fdiv double %13, 1.000000e+06
%15 = fadd double %14, %10
store double %15, double* %0
ret void
}
unsigned long long int f4(long long int x) {
  return (x << 5) | ((unsigned long long int)x >> 59);
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x5,%rax
mov    -0x8(%rbp),%rcx
shr    $0x3b,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
mov    %rdi,%rax
rol    $0x5,%rax
ret

LLVM IR (-O0):
define i64 @f4(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 5
%5 = load i64, i64* %2
%6 = lshr i64 %5, 59
%7 = or i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @f4(i64 %0) {
%2 = tail call i64 @llvm.fshl.i64(i64 %0, i64 %0, i64 5)
ret i64 %2
}
adrx0adrx1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((((int *)10000000)[x0]) <= (((int *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0adrx1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
mov    (%rax,%rcx,4),%eax
movslq -0x14(%rbp),%rdx
mov    $0xa98ac7,%ecx
cmp    (%rcx,%rdx,4),%eax
jg     1142 <adrx0adrx1+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1149 <adrx0adrx1+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0adrx1>:
movslq %edx,%rax
mov    0x989680(,%rax,4),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(,%rcx,4),%edx
setle  %al
ret

LLVM IR (-O0):
define i32 @adrx0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%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* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* %10
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %15
%17 = load i32, i32* %16
%18 = load i32, i32* %11
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %19
%21 = load i32, i32* %20
%22 = icmp sle i32 %17, %21
br i1 %22, label %23, label %24
23: ; preds = %6
store i32 1, i32* %7
br label %25
24: ; preds = %6
store i32 0, i32* %7
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @adrx0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %7
%9 = load i32, i32* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %10
%12 = load i32, i32* %11
%13 = icmp sle i32 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int strcmp(char *, char *);
int compare_string(void *data1, void *data2) {
  return strcmp((char *)data1, (char *)data2);
}


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

x86 assembly (clang, -O2):
<compare_string>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @compare_string(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int padcon_initialize_quaddobl_solution(int idx, int verbose) {
  int fail;
  int pars[2];
  double *c;
  pars[0] = 2;
  pars[1] = idx;
  fail = _ada_use_c2phc4c(861, pars, &verbose, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<padcon_initialize_quaddobl_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    -0x14(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    $0x35d,%edi
lea    -0x8(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padcon_initialize_quaddobl_solution>:
sub    $0x18,%rsp
mov    %esi,0xc(%rsp)
movl   $0x2,0x10(%rsp)
mov    %edi,0x14(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    $0x35d,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @padcon_initialize_quaddobl_solution(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca [2 x i32]
store i32 %1, i32* %3
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 2, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %0, i32* %7
%8 = call i32 @_ada_use_c2phc4c(i32 861, i32* %6, i32* %3, double* undef, i32 0)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void LTDC_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @LTDC_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @LTDC_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int const vavailability_i(int);
__attribute__((visibility("default"))) const int xgetIntf(int name) {
  if (1 <= name && name <= 10)
    return vavailability_i(name);
  return 0;
}


x86 assembly (clang, -O0):
<xgetIntf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jg     1143 <xgetIntf+0x33>
cmpl   $0xa,-0x8(%rbp)
jg     1143 <xgetIntf+0x33>
mov    -0x8(%rbp),%edi
call   1030 <vavailability_i@plt>
mov    %eax,-0x4(%rbp)
jmp    114a <xgetIntf+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xgetIntf>:
lea    -0x1(%rdi),%eax
cmp    $0x9,%eax
ja     111d <xgetIntf+0xd>
jmp    1030 <vavailability_i@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @xgetIntf(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 10
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @vavailability_i(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
struct vec4i {
  int dummy;
};
struct vec4 {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec4i_ceil(int /*<<< orphan*/ *, float *);
__attribute__((always_)) struct vec4i *psvec4i_ceil(struct vec4i *result,
                                                    struct vec4 *a) {
  vec4i_ceil((int32_t *)result, (float *)a);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec4i_ceil>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec4i_ceil@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec4i = type { i32 }
%struct.vec4 = type { i32 }
define %struct.vec4i* @psvec4i_ceil(%struct.vec4i* %0, %struct.vec4* %1) {
%3 = alloca %struct.vec4i*
%4 = alloca %struct.vec4*
store %struct.vec4i* %0, %struct.vec4i** %3
store %struct.vec4* %1, %struct.vec4** %4
%5 = load %struct.vec4i*, %struct.vec4i** %3
%6 = bitcast %struct.vec4i* %5 to i32*
%7 = load %struct.vec4*, %struct.vec4** %4
%8 = bitcast %struct.vec4* %7 to float*
%9 = call i32 @vec4i_ceil(i32* %6, float* %8)
%10 = load %struct.vec4i*, %struct.vec4i** %3
ret %struct.vec4i* %10
}

LLVM IR (-O2):
%struct.vec4i = type { i32 }
%struct.vec4 = type { i32 }
define %struct.vec4i* @psvec4i_ceil(%struct.vec4i* returned %0, %struct.vec4* %1) {
%3 = getelementptr %struct.vec4i, %struct.vec4i* %0, i64 0, i32 0
%4 = bitcast %struct.vec4* %1 to float*
%5 = tail call i32 @vec4i_ceil(i32* %3, float* %4)
ret %struct.vec4i* %0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void uart_init() {
  *(volatile uint8_t *)0x5011 = 0xBF;
  *(volatile uint8_t *)0x5012 = 0xFF;
  *(volatile uint8_t *)0x5235 = (1 << 3) | (1 << 2);
  *(volatile uint8_t *)0x5236 &= ~((1 << 5) | (1 << 4));
  *(volatile uint8_t *)0x5233 = 0x0B;
  *(volatile uint8_t *)0x5232 = 0x08;
}


x86 assembly (clang, -O0):
<uart_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5011,%eax
movl   $0xbf,(%rax)
mov    $0x5012,%eax
movl   $0xff,(%rax)
mov    $0x5235,%eax
movl   $0xc,(%rax)
mov    $0x5236,%eax
mov    (%rax),%ecx
and    $0xffffffcf,%ecx
mov    $0x5236,%eax
mov    %ecx,(%rax)
mov    $0x5233,%eax
movl   $0xb,(%rax)
mov    $0x5232,%eax
movl   $0x8,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_init>:
movl   $0xbf,0x5011
movl   $0xff,0x5012
movl   $0xc,0x5235
andl   $0xffffffcf,0x5236
cf
movl   $0xb,0x5233
movl   $0x8,0x5232
ret

LLVM IR (-O0):
define void @uart_init() {
store volatile i32 191, i32* inttoptr (i64 20497 to i32*)
store volatile i32 255, i32* inttoptr (i64 20498 to i32*)
store volatile i32 12, i32* inttoptr (i64 21045 to i32*)
%1 = load volatile i32, i32* inttoptr (i64 21046 to i32*)
%2 = and i32 %1, -49
store volatile i32 %2, i32* inttoptr (i64 21046 to i32*)
store volatile i32 11, i32* inttoptr (i64 21043 to i32*)
store volatile i32 8, i32* inttoptr (i64 21042 to i32*)
ret void
}

LLVM IR (-O2):
define void @uart_init() {
store volatile i32 191, i32* inttoptr (i64 20497 to i32*)
store volatile i32 255, i32* inttoptr (i64 20498 to i32*)
store volatile i32 12, i32* inttoptr (i64 21045 to i32*)
%1 = load volatile i32, i32* inttoptr (i64 21046 to i32*)
%2 = and i32 %1, -49
store volatile i32 %2, i32* inttoptr (i64 21046 to i32*)
store volatile i32 11, i32* inttoptr (i64 21043 to i32*)
store volatile i32 8, i32* inttoptr (i64 21042 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_equal_d(int *, double, double);
int xil_fpo_equal_d(double a, double b) {
  int res_int;
  xip_fpo_equal_d(&res_int, a, b);
  return res_int;
}


x86 assembly (clang, -O0):
<xil_fpo_equal_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    -0x14(%rbp),%rdi
call   1030 <xip_fpo_equal_d@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xil_fpo_equal_d>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <xip_fpo_equal_d@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @xil_fpo_equal_d(double %0, double %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @xip_fpo_equal_d(i32* %3, double %0, double %1)
%6 = load i32, i32* %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
void handler(int sig) {
  printf("Executing handler\n");
  signal(sig, SIG_DFL);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
pop    %rbx
jmp    1040 <signal@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Executing handler\0A\00"
@SIG_DFL = global i32 0
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = load i32, i32* @SIG_DFL
%6 = call i32 @signal(i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@SIG_DFL = global i32 0
@str = [18 x i8] c"Executing handler\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @SIG_DFL
%4 = tail call i32 @signal(i32 %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mumps_io_get_nb_files(int *, int *);
void mumps_ooc_get_nb_files_c(const int *type, int *nb_files) {
  int type_loc, nb_files_loc;
  type_loc = (int)*type;
  mumps_io_get_nb_files(&nb_files_loc, &type_loc);
  *nb_files = (int)nb_files_loc;
  return;
}


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

x86 assembly (clang, -O2):
<mumps_ooc_get_nb_files_c>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    (%rdi),%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1030 <mumps_io_get_nb_files@plt>
mov    0x8(%rsp),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @mumps_ooc_get_nb_files_c(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
store i32 %8, i32* %5
%9 = call i32 @mumps_io_get_nb_files(i32* %6, i32* %5)
%10 = load i32, i32* %6
%11 = load i32*, i32** %4
store i32 %10, i32* %11
ret void
}

LLVM IR (-O2):
define void @mumps_ooc_get_nb_files_c(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = load i32, i32* %0
store i32 %7, i32* %3
%8 = call i32 @mumps_io_get_nb_files(i32* %4, i32* %3)
%9 = load i32, i32* %4
store i32 %9, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ copybackward(char *, int);
int getlength(char *);
void reverse(char string[]) {
  int length = getlength(string);
  copybackward(string, length);
}


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

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

LLVM IR (-O0):
define void @reverse(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @getlength(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = call i32 @copybackward(i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @reverse(i8* %0) {
%2 = tail call i32 @getlength(i8* %0)
%3 = tail call i32 @copybackward(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
char *strndup(char const *, size_t);
char *s_strndup(const char *s1, size_t n) {
  if (!s1)
    return NULL;
  return strndup(s1, n);
}


x86 assembly (clang, -O0):
<s_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1138 <s_strndup+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1149 <s_strndup+0x39>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strndup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_strndup>:
test   %rdi,%rdi
je     111a <s_strndup+0xa>
jmp    1030 <strndup@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @s_strndup(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* @strndup(i8* %0, i64 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i8* [ %5, %4 ], [ null, %2 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, double *);
unsigned get_float(char *s, double *outnum) {
  if (!sscanf(s, "%lf", outnum))
    return 0xFFFD;
  return (0);
}


x86 assembly (clang, -O0):
<get_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <sscanf@plt>
cmp    $0x0,%eax
jne    1149 <get_float+0x39>
movl   $0xfffd,-0x4(%rbp)
jmp    1150 <get_float+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_float>:
push   %rax
mov    %rsi,%rdx
lea    0xee5(%rip),%rsi
call   1030 <sscanf@plt>
xor    %ecx,%ecx
test   %eax,%eax
mov    $0xfffd,%eax
cmovne %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i32 @get_float(i8* nocapture %0, double* %1) {
%3 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 65533, i32 0
ret i32 %5
}
/* Variables and functions */
unsigned long pci_read_config32(int, int);
int /*<<< orphan*/ pci_write_config32(int, int, unsigned long);
void spd_set_ecc_mode(void) {
  unsigned long dcl;
  dcl = pci_read_config32(
      ((((0) & 0xFF) << 16) | (((0x18) & 0x1f) << 11) | (((2) & 0x7) << 8)),
      0x90);
  dcl &= ~(1 << 17);
  pci_write_config32(
      ((((0) & 0xFF) << 16) | (((0x18) & 0x1f) << 11) | (((2) & 0x7) << 8)),
      0x90, dcl);
}


x86 assembly (clang, -O0):
<spd_set_ecc_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc200,%edi
mov    $0x90,%esi
call   1030 <pci_read_config32@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xfffffffffffdffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0xc200,%edi
mov    $0x90,%esi
call   1040 <pci_write_config32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spd_set_ecc_mode>:
push   %rax
mov    $0xc200,%edi
mov    $0x90,%esi
call   1030 <pci_read_config32@plt>
and    $0xfffffffffffdffff,%rax
mov    $0xc200,%edi
mov    $0x90,%esi
mov    %rax,%rdx
pop    %rax
jmp    1040 <pci_write_config32@plt>

LLVM IR (-O0):
define void @spd_set_ecc_mode() {
%1 = alloca i64
%2 = call i64 @pci_read_config32(i32 49664, i32 144)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = and i64 %3, -131073
store i64 %4, i64* %1
%5 = load i64, i64* %1
%6 = call i32 @pci_write_config32(i32 49664, i32 144, i64 %5)
ret void
}

LLVM IR (-O2):
define void @spd_set_ecc_mode() {
%1 = tail call i64 @pci_read_config32(i32 49664, i32 144)
%2 = and i64 %1, -131073
%3 = tail call i32 @pci_write_config32(i32 49664, i32 144, i64 %2)
ret void
}
/* Variables and functions */
int my_string_strcmpFilenames(char *, char *);
int func_qsort_filenames(const void *a, const void *b) {
  return my_string_strcmpFilenames(*(char **)a, *(char **)b);
}


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

x86 assembly (clang, -O2):
<func_qsort_filenames>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <my_string_strcmpFilenames@plt>

LLVM IR (-O0):
define i32 @func_qsort_filenames(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @my_string_strcmpFilenames(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @func_qsort_filenames(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @my_string_strcmpFilenames(i8* %4, i8* %6)
ret i32 %7
}
int mutex_enter(void *mtx) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mutex_enter(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __aeabi_memset_impl(void *, size_t, int /*<<< orphan*/);
void __attribute__((weak)) __aeabi_memclr_impl(void *dest, size_t n) {
  __aeabi_memset_impl(dest, n, 0);
}


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

x86 assembly (clang, -O2):
<__aeabi_memclr_impl>:
xor    %edx,%edx
jmp    1030 <__aeabi_memset_impl@plt>

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

LLVM IR (-O2):
define weak void @__aeabi_memclr_impl(i8* %0, i64 %1) {
%3 = tail call i32 @__aeabi_memset_impl(i8* %0, i64 %1, i32 0)
ret void
}
/* Variables and functions */
scalar_t__ f();
int main() {
  int *p = (int *)f();
  *p = 4;
  return *p;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
movl   $0x4,(%rax)
mov    $0x4,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i64 (...) @f()
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
store i32 4, i32* %5
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @f()
%2 = inttoptr i64 %1 to i32*
store i32 4, i32* %2
ret i32 4
}
/* Variables and functions */
int rand();
unsigned int mk_rnd_u32() { return (rand() & 0xffffffff); }


x86 assembly (clang, -O0):
<mk_rnd_u32>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mk_rnd_u32() {
%1 = call i32 (...) @rand()
%2 = and i32 %1, -1
ret i32 %2
}

LLVM IR (-O2):
define i32 @mk_rnd_u32() {
%1 = tail call i32 (...) @rand()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void closeEc(FILE *ec) { fclose(ec); }


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

x86 assembly (clang, -O2):
<closeEc>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @closeEc(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret void
}
void put_32(unsigned char *s, unsigned c, int e) {
  s[e ^ 0] = c >> 24;
  s[e ^ 1] = c >> 16;
  s[e ^ 2] = c >> 8;
  s[e ^ 3] = c;
}


x86 assembly (clang, -O0):
<put_32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
xor    $0x0,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
xor    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
xor    $0x2,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
xor    $0x3,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_32>:
mov    %esi,%eax
mov    %esi,%ecx
shr    $0x18,%ecx
movslq %edx,%rdx
mov    %cl,(%rdi,%rdx,1)
mov    %esi,%ecx
shr    $0x10,%ecx
mov    %rdx,%rsi
xor    $0x1,%rsi
mov    %cl,(%rdi,%rsi,1)
mov    %rdx,%rcx
xor    $0x2,%rcx
mov    %ah,(%rdi,%rcx,1)
xor    $0x3,%rdx
mov    %al,(%rdi,%rdx,1)
ret

LLVM IR (-O0):
define void @put_32(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = lshr i32 %7, 24
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %4
%11 = load i32, i32* %6
%12 = xor i32 %11, 0
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
store i8 %9, i8* %14
%15 = load i32, i32* %5
%16 = lshr i32 %15, 16
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %4
%19 = load i32, i32* %6
%20 = xor i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %18, i64 %21
store i8 %17, i8* %22
%23 = load i32, i32* %5
%24 = lshr i32 %23, 8
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %4
%27 = load i32, i32* %6
%28 = xor i32 %27, 2
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %26, i64 %29
store i8 %25, i8* %30
%31 = load i32, i32* %5
%32 = trunc i32 %31 to i8
%33 = load i8*, i8** %4
%34 = load i32, i32* %6
%35 = xor i32 %34, 3
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %33, i64 %36
store i8 %32, i8* %37
ret void
}

LLVM IR (-O2):
define void @put_32(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = lshr i32 %1, 24
%5 = trunc i32 %4 to i8
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %5, i8* %7
%8 = lshr i32 %1, 16
%9 = trunc i32 %8 to i8
%10 = xor i32 %2, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 %9, i8* %12
%13 = lshr i32 %1, 8
%14 = trunc i32 %13 to i8
%15 = xor i32 %2, 2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 %14, i8* %17
%18 = trunc i32 %1 to i8
%19 = xor i32 %2, 3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %0, i64 %20
store i8 %18, i8* %21
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
extern int xfclose(FILE **fp) {
  if ((fp == NULL) || ((*fp) == NULL))
    return 0;
  fclose(*fp);
  *fp = NULL;
  return 0;
}


x86 assembly (clang, -O0):
<xfclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1135 <xfclose+0x25>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1141 <xfclose+0x31>
movl   $0x0,-0x4(%rbp)
jmp    115f <xfclose+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <fclose@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfclose>:
push   %rbx
test   %rdi,%rdi
je     112d <xfclose+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <xfclose+0x1d>
call   1030 <fclose@plt>
movq   $0x0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @xfclose(i32** %0) {
%2 = icmp eq i32** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i32*, i32** %0
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @fclose(i32* %4)
store i32* null, i32** %0
br label %8
8: ; preds = %1, %3, %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
#pragma xmp reflect(b)
#pragma xmp task on p[0][0]
  { printf("PASS\n"); }
}


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"PASS\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void FLASHOUTPUT(const char *f, ...) {}


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

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

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

LLVM IR (-O2):
define void @FLASHOUTPUT(i8* nocapture %0, ...) {
ret void
}
double dd_to_double(const double *a) { return a[0]; }


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

x86 assembly (clang, -O2):
<dd_to_double>:
movsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
define double @dd_to_double(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
ret double %5
}

LLVM IR (-O2):
define double @dd_to_double(double* nocapture %0) {
%2 = load double, double* %0
ret double %2
}
int d_bgt_cr1(double a1) { return (__builtin_isgreater(100, a1)); }


x86 assembly (clang, -O0):
<d_bgt_cr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_bgt_cr1>:
movsd  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @d_bgt_cr1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double 1.000000e+02, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @d_bgt_cr1(double %0) {
%2 = fcmp olt double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
int main(int argc, char *argv[]) {
  printf("[%s@%d]"
         "start %d\n",
         __func__, 14, 1);
  return 0;
}


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)
lea    0xed3(%rip),%rdi
lea    0xedd(%rip),%rsi
mov    $0xe,%edx
mov    $0x1,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef2(%rip),%rsi
mov    $0xe,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"[%s@%d]start %d\0A\00"
@__func__.main = [5 x i8] c"main\00"
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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i32 14, i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"[%s@%d]start %d\0A\00"
@__func__.main = [5 x i8] c"main\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i32 14, i32 1)
ret i32 0
}
/* Variables and functions */
int read(int /*<<< orphan*/, unsigned char *, int);
int getch(void) {
  unsigned char temp;
  if (read(0, &temp, 1) != 1)
    return 0;
  return temp;
}


x86 assembly (clang, -O0):
<getch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
je     113d <getch+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1144 <getch+0x34>
movzbl -0x5(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
lea    0xf(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
movzbl 0xf(%rsp),%eax
cmovne %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @getch() {
%1 = alloca i8
%2 = call i32 @read(i32 0, i8* %1, i32 1)
%3 = icmp eq i32 %2, 1
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
%6 = select i1 %3, i32 %5, i32 0
ret i32 %6
}
long double test_acosl(long double x) { return __builtin_acosl(x); }


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

x86 assembly (clang, -O2):
<test_acosl>:
jmp    1030 <acosl@plt>

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

LLVM IR (-O2):
define x86_fp80 @test_acosl(x86_fp80 %0) {
%2 = tail call x86_fp80 @acosl(x86_fp80 %0)
ret x86_fp80 %2
}
int test_imm_B5int64_highword_reg(long long val) {
  return ((val >> 32) & (0xB5 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B5int64_highword_reg(i64 %0) {
%2 = and i64 %0, 777389080576
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M104_f(char *s) {
  debug("M104_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


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

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

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

LLVM IR (-O2):
@.str = [47 x i8] c"M104_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M104_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main(void) {
  int i1, i2;
  int *p1, *p2;
  i1 = 5;
  p1 = &i1;
  i2 = *p1 / 2 + 10;
  p2 = p1;
  printf("i1 = %i, i2 = %i, *p1 = %i, *p2 = %i\n", i1, i2, *p1, *p2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    (%rax),%r8d
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x5,%esi
mov    $0xc,%edx
mov    $0x5,%ecx
mov    $0x5,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"i1 = %i, i2 = %i, *p1 = %i, *p2 = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32 0, i32* %1
store i32 5, i32* %2
store i32* %2, i32** %4
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 2
%9 = add nsw i32 %8, 10
store i32 %9, i32* %3
%10 = load i32*, i32** %4
store i32* %10, i32** %5
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %14, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"i1 = %i, i2 = %i, *p1 = %i, *p2 = %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 5, i32 12, i32 5, i32 5)
ret i32 0
}