xunge/DecIR huggingface dataset:
long long value(long long n) {
  if (n == 0)
    return 0;
  if (n == 1 || n == 2)
    return 1;
  if (n == 3)
    return 2;
  return value(n / 2) + (n % 2);
}


x86 assembly (clang, -O0):
<value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <value+0x24>
movq   $0x0,-0x8(%rbp)
jmp    11a2 <value+0x92>
cmpq   $0x1,-0x10(%rbp)
je     114a <value+0x3a>
cmpq   $0x2,-0x10(%rbp)
jne    1157 <value+0x47>
movq   $0x1,-0x8(%rbp)
jmp    11a2 <value+0x92>
cmpq   $0x3,-0x10(%rbp)
jne    116f <value+0x5f>
movq   $0x2,-0x8(%rbp)
jmp    11a2 <value+0x92>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
call   1030 <value@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    -0x18(%rbp),%rax
add    %rdx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<value>:
test   %rdi,%rdi
je     114e <value+0x4e>
xor    %r8d,%r8d
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
lea    -0x1(%rdi),%rdx
cmp    $0x2,%rdx
jb     1151 <value+0x51>
cmp    $0x3,%rdi
je     115b <value+0x5b>
mov    %rdi,%rdx
shr    $0x3f,%rdx
add    %rdi,%rdx
mov    %rdx,%rsi
sar    %rsi
and    $0xfffffffffffffffe,%rdx
mov    %rdi,%rcx
sub    %rdx,%rcx
add    %rcx,%rax
add    $0x1,%rdi
cmp    $0x2,%rdi
mov    %rsi,%rdi
ja     1110 <value+0x10>
add    %r8,%rax
ret
xor    %eax,%eax
ret
mov    $0x1,%r8d
add    %r8,%rax
ret
mov    $0x2,%r8d
add    %r8,%rax
ret

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

LLVM IR (-O2):
define i64 @value(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %20, label %3
3: ; preds = %1, %10
%4 = phi i64 [ %11, %10 ], [ %0, %1 ]
%5 = phi i64 [ %13, %10 ], [ 0, %1 ]
%6 = add i64 %4, -1
%7 = icmp ult i64 %6, 2
br i1 %7, label %16, label %8
8: ; preds = %3
%9 = icmp eq i64 %4, 3
br i1 %9, label %16, label %10
10: ; preds = %8
%11 = sdiv i64 %4, 2
%12 = srem i64 %4, 2
%13 = add nsw i64 %12, %5
%14 = add i64 %4, 1
%15 = icmp ult i64 %14, 3
br i1 %15, label %16, label %3
16: ; preds = %8, %3, %10
%17 = phi i64 [ %13, %10 ], [ %5, %3 ], [ %5, %8 ]
%18 = phi i64 [ 0, %10 ], [ 1, %3 ], [ 2, %8 ]
%19 = add nsw i64 %18, %17
br label %20
20: ; preds = %16, %1
%21 = phi i64 [ %19, %16 ], [ 0, %1 ]
ret i64 %21
}
/* Variables and functions */
double sqrt(double);
double func(double x, double y, double z) {
  const double c = sqrt(sqrt(.2001));
  double x1 = x - c, x2 = x + c;
  return x1 * x1 * x2 * x2 + z * z + y * y - .2;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xed9(%rip),%xmm0
call   1030 <sqrt@plt>
call   1030 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe64(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
movsd  0xef8(%rip),%xmm3
addsd  %xmm0,%xmm3
addsd  0xef4(%rip),%xmm0
mulsd  %xmm3,%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm2
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
addsd  0xed8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @func(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%10 = call double @sqrt(double 2.001000e-01)
%11 = call double @sqrt(double %10)
store double %11, double* %7
%12 = load double, double* %4
%13 = load double, double* %7
%14 = fsub double %12, %13
store double %14, double* %8
%15 = load double, double* %4
%16 = load double, double* %7
%17 = fadd double %15, %16
store double %17, double* %9
%18 = load double, double* %8
%19 = load double, double* %8
%20 = fmul double %18, %19
%21 = load double, double* %9
%22 = fmul double %20, %21
%23 = load double, double* %9
%24 = load double, double* %6
%25 = load double, double* %6
%26 = fmul double %24, %25
%27 = call double @llvm.fmuladd.f64(double %22, double %23, double %26)
%28 = load double, double* %5
%29 = load double, double* %5
%30 = call double @llvm.fmuladd.f64(double %28, double %29, double %27)
%31 = fsub double %30, 2.000000e-01
ret double %31
}

LLVM IR (-O2):
define double @func(double %0, double %1, double %2) {
%4 = fadd double %0, 0xBFE567015769ED8B
%5 = fadd double %0, 0x3FE567015769ED8B
%6 = fmul double %4, %4
%7 = fmul double %5, %6
%8 = fmul double %2, %2
%9 = tail call double @llvm.fmuladd.f64(double %7, double %5, double %8)
%10 = tail call double @llvm.fmuladd.f64(double %1, double %1, double %9)
%11 = fadd double %10, -2.000000e-01
ret double %11
}
double max3(double a, double b, double c) {
  double max;
  max = a;
  if (max < b)
    max = b;
  if (max < c)
    max = c;
  return max;
}


x86 assembly (clang, -O0):
<max3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    113b <max3+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1159 <max3+0x59>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max3>:
maxsd  %xmm0,%xmm1
maxsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @max3(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
store double %8, double* %7
%9 = load double, double* %7
%10 = load double, double* %5
%11 = fcmp olt double %9, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load double, double* %5
store double %13, double* %7
br label %14
14: ; preds = %12, %3
%15 = load double, double* %7
%16 = load double, double* %6
%17 = fcmp olt double %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load double, double* %6
store double %19, double* %7
br label %20
20: ; preds = %18, %14
%21 = load double, double* %7
ret double %21
}

LLVM IR (-O2):
define double @max3(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = select i1 %4, double %1, double %0
%6 = fcmp olt double %5, %2
%7 = select i1 %6, double %2, double %5
ret double %7
}
void emit_type_definition_int64(
    struct processor_explicatory_state *process_state,
    struct modern_stream *stream, void *stream_state,
    struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_type_definition_int64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_type_definition_int64(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_type_definition_int64(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *myrealloc(void *p, size_t n) {
  if ((p = realloc(p, n))) {
    return p;
  } else {
    fprintf(stderr, "Virtual memory exhausted\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<myrealloc>:
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   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1165 <myrealloc+0x35>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
lea    0xe8b(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<myrealloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <myrealloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Virtual memory exhausted\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @myrealloc(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 i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i8*, i8** %3
ret i8* %10
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Virtual memory exhausted\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @myrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
ret i8* %3
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzPassiveSyncEagerFalseVariable_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_REQDOWN(int);
void BrzPassiveSyncEagerFalseVariable_ackup(struct comp *comp, int port) {
  struct BrzPassiveSyncEagerFalseVariable_ *c =
      (struct BrzPassiveSyncEagerFalseVariable_ *)comp;
  SEND_REQDOWN(2);
}


x86 assembly (clang, -O0):
<BrzPassiveSyncEagerFalseVariable_ackup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x2,%edi
call   1030 <SEND_REQDOWN@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzPassiveSyncEagerFalseVariable_ackup>:
mov    $0x2,%edi
jmp    1030 <SEND_REQDOWN@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzPassiveSyncEagerFalseVariable_ = type { i32 }
define void @BrzPassiveSyncEagerFalseVariable_ackup(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzPassiveSyncEagerFalseVariable_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzPassiveSyncEagerFalseVariable_*
store %struct.BrzPassiveSyncEagerFalseVariable_* %7, %struct.BrzPassiveSyncEagerFalseVariable_** %5
%8 = call i32 @SEND_REQDOWN(i32 2)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzPassiveSyncEagerFalseVariable_ackup(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_REQDOWN(i32 2)
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
double Glwm_GetTime(void) {
  struct timeval tv;
  struct timezone tz;
  double t;
  gettimeofday(&tv, &tz);
  t = tv.tv_sec + (tv.tv_usec / 1000000.0);
  return t;
}


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

x86 assembly (clang, -O2):
<Glwm_GetTime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xed1(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
%struct.timezone = type { i32 }
define double @Glwm_GetTime() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = alloca double
%4 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load double, double* %7
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %6, %9
store double %10, double* %3
%11 = load double, double* %3
ret double %11
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
%struct.timezone = type { i32 }
define double @Glwm_GetTime() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load double, double* %8
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %7, %10
ret double %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ unaligned_write_le32(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/);
void unaligned_write_le64(void *_u, uint64_t a) {
  uint8_t *u = _u;
  unaligned_write_le32(u, (uint32_t)a);
  unaligned_write_le32(u + 4, (uint32_t)(a >> 32));
}


x86 assembly (clang, -O0):
<unaligned_write_le64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <unaligned_write_le32@plt>
mov    -0x18(%rbp),%rdi
add    $0x10,%rdi
mov    -0xc(%rbp),%esi
mov    $0x20,%ecx
sar    %cl,%esi
call   1030 <unaligned_write_le32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unaligned_write_le64>:
push   %rbx
mov    %rdi,%rbx
call   1030 <unaligned_write_le32@plt>
add    $0x10,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <unaligned_write_le32@plt>

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

LLVM IR (-O2):
define void @unaligned_write_le64(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @unaligned_write_le32(i32* %3, i32 %1)
%5 = getelementptr inbounds i8, i8* %0, i64 16
%6 = bitcast i8* %5 to i32*
%7 = tail call i32 @unaligned_write_le32(i32* %6, i32 poison)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(long *);
void free_lvector(long *v, long nl, long nh) { free(v + nl - 1); }


x86 assembly (clang, -O0):
<free_lvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_lvector>:
lea    (%rdi,%rsi,8),%rdi
add    $0xfffffffffffffff8,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_lvector(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64*, i64** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i64, i64* %7, i64 %8
%10 = getelementptr inbounds i64, i64* %9, i64 -1
%11 = call i32 @free(i64* %10)
ret void
}

LLVM IR (-O2):
define void @free_lvector(i64* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i64, i64* %0, i64 %1
%5 = getelementptr inbounds i64, i64* %4, i64 -1
%6 = tail call i32 @free(i64* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
void main() {
  float cels;
  for (cels = -30.0; cels <= 50.0; cels = cels + 5) {
    printf("%4.1f %5.1f\n", cels, (cels * (9.0 / 5.0) + 32.0));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     118d <main+0x7d>
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xeba(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xeb6(%rip),%xmm2
addsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
movss  0xe86(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1125 <main+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0xffffffdd,%ebp
lea    0xef1(%rip),%rbx
nop
add    $0x5,%ebp
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
mulsd  0xec7(%rip),%xmm1
addsd  0xec7(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
cmp    $0x2e,%ebp
jl     1120 <main+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%4.1f %5.1f\0A\00"
define void @main() {
%1 = alloca float
store float -3.000000e+01, float* %1
br label %2
2: ; preds = %13, %0
%3 = load float, float* %1
%4 = fpext float %3 to double
%5 = fcmp ole double %4, 5.000000e+01
br i1 %5, label %6, label %16
6: ; preds = %2
%7 = load float, float* %1
%8 = load float, float* %1
%9 = fpext float %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 1.800000e+00, double 3.200000e+01)
%11 = fptrunc double %10 to float
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), float %7, float %11)
br label %13
13: ; preds = %6
%14 = load float, float* %1
%15 = fadd float %14, 5.000000e+00
store float %15, float* %1
br label %2
16: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%4.1f %5.1f\0A\00"
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ -30, %0 ], [ %8, %1 ]
%3 = sitofp i32 %2 to float
%4 = fpext float %3 to double
%5 = tail call double @llvm.fmuladd.f64(double %4, double 1.800000e+00, double 3.200000e+01)
%6 = fptrunc double %5 to float
%7 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), float %3, float %6)
%8 = add nsw i32 %2, 5
%9 = icmp sgt i32 %2, 45
br i1 %9, label %10, label %1
10: ; preds = %1
ret void
}
void swap2(void *value) {
  unsigned char *v = (unsigned char *)value;
  v[0] = v[0] ^ v[1];
  v[1] = v[0] ^ v[1];
  v[0] = v[0] ^ v[1];
}


x86 assembly (clang, -O0):
<swap2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
xor    %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
xor    %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
xor    %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap2>:
rolw   $0x8,(%rdi)
ret

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

LLVM IR (-O2):
define void @swap2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
store i8 %2, i8* %3
store i8 %4, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execve(char *, char **, char **);
int /*<<< orphan*/ perror(char *);
void exec_ps_cmd(void) {
  static char *argv[] = {"ps", "f", NULL};
  extern char **environ;
  execve("/bin/ps", argv, environ);
  perror("execve()");
}


x86 assembly (clang, -O0):
<exec_ps_cmd>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%rdx
lea    0xecd(%rip),%rdi
lea    0x2f04(%rip),%rsi
call   1030 <execve@plt>
lea    0xec2(%rip),%rdi
call   1040 <perror@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec_ps_cmd>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%rdx
lea    0xed0(%rip),%rdi
lea    0x2f07(%rip),%rsi
call   1030 <execve@plt>
lea    0xec5(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@exec_ps_cmd.argv = internal global [3 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0), i8* null]
@.str = [3 x i8] c"ps\00"
@.str.1 = [2 x i8] c"f\00"
@.str.2 = [8 x i8] c"/bin/ps\00"
@environ = external global i8**
@.str.3 = [9 x i8] c"execve()\00"
define void @exec_ps_cmd() {
%1 = load i8**, i8*** @environ
%2 = call i32 @execve(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @exec_ps_cmd.argv, i64 0, i64 0), i8** %1)
%3 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@exec_ps_cmd.argv = internal global [3 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0), i8* null]
@.str = [3 x i8] c"ps\00"
@.str.1 = [2 x i8] c"f\00"
@.str.2 = [8 x i8] c"/bin/ps\00"
@environ = external global i8**
@.str.3 = [9 x i8] c"execve()\00"
define void @exec_ps_cmd() {
%1 = load i8**, i8*** @environ
%2 = tail call i32 @execve(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @exec_ps_cmd.argv, i64 0, i64 0), i8** %1)
%3 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}
bzero(dest, cnt) register char *dest;
register long cnt;
{
  while (cnt--)
    *dest++ = 0;
}


x86 assembly (clang, -O0):
<bzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     113c <bzero+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
jmp    110c <bzero+0xc>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bzero>:
test   %rsi,%rsi
je     1124 <bzero+0x14>
push   %rax
mov    %rsi,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @bzero(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %2
br label %5
5: ; preds = %4, %2
ret i32 undef
}
__attribute__((no, noclone)) signed __int128 t102_3add(signed __int128 y) {
  signed __int128 r;
  if (__builtin_add_overflow(
          (signed __int128)((
              (signed __int128)(((unsigned __int128)1 << (16 * 8 - 1)) - 1))),
          y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t102_3add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
add    $0xffffffffffffffff,%rdx
movabs $0x7fffffffffffffff,%rax
ff ff 7f
adc    %rax,%rcx
seto   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1161 <t102_3add+0x51>
jmp    1168 <t102_3add+0x58>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t102_3add>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
add    $0xffffffffffffffff,%r14
movabs $0x7fffffffffffffff,%rbx
ff ff 7f
adc    %rsi,%rbx
jno    1131 <t102_3add+0x21>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t102_3add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.sadd.with.overflow.i128(i128 170141183460469231731687303715884105727, i128 %11)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t102_3add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.sadd.with.overflow.i128(i128 %6, i128 170141183460469231731687303715884105727)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void c_abort() { abort(); }


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

x86 assembly (clang, -O2):
<c_abort>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @c_abort() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @c_abort() {
%1 = tail call i32 (...) @abort()
unreachable
}
signed long int signedlongint_ignoring_signedchar(signed long int x,
                                                  signed char y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @signedlongint_ignoring_signedchar(i64 returned %0, i8 signext %1) {
ret i64 %0
}
void SDHostDataRead(unsigned long ulBase, unsigned long *pulData) {
  while (!((*((volatile unsigned long *)(ulBase + 0x00000224))) & (1 << 11))) {
  }
  *pulData = (*((volatile unsigned long *)(ulBase + 0x00000220)));
}


x86 assembly (clang, -O0):
<SDHostDataRead>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x224(%rax),%rax
and    $0x800,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1133 <SDHostDataRead+0x33>
jmp    1138 <SDHostDataRead+0x38>
jmp    110c <SDHostDataRead+0xc>
mov    -0x8(%rbp),%rax
mov    0x220(%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDHostDataRead>:
testq  $0x800,0x224(%rdi)
je     1100 <SDHostDataRead>
mov    0x220(%rdi),%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @SDHostDataRead(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
store i64 %0, i64* %3
store i64* %1, i64** %4
br label %5
5: ; preds = %13, %2
%6 = load i64, i64* %3
%7 = add i64 %6, 548
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, 2048
%11 = icmp ne i64 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %14
13: ; preds = %5
br label %5
14: ; preds = %5
%15 = load i64, i64* %3
%16 = add i64 %15, 544
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
%19 = load i64*, i64** %4
store i64 %18, i64* %19
ret void
}

LLVM IR (-O2):
define void @SDHostDataRead(i64 %0, i64* nocapture writeonly %1) {
%3 = add i64 %0, 548
%4 = inttoptr i64 %3 to i64*
br label %5
5: ; preds = %5, %2
%6 = load volatile i64, i64* %4
%7 = and i64 %6, 2048
%8 = icmp eq i64 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5
%10 = add i64 %0, 544
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
store i64 %12, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const);
void printstr(const char *string) {
  int idx = 0;
  while (*(string + idx) != '\0') {
    printf("%c\n", *(string + idx));
    idx++;
  }
}


x86 assembly (clang, -O0):
<printstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115e <printstr+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xeb9(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printstr>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1146 <printstr+0x36>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xed8(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <printstr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define void @printstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int test_imm_38int8_mem(signed char *val) {
  return ((*val) & (0x38 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_38int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 56
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t HashKey(char c) {
  uint8_t index;
  index = c - 'a';
  index = index % 100;
  return index;
}


x86 assembly (clang, -O0):
<HashKey>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HashKey>:
add    $0xffffff9f,%edi
imul   $0x147b,%edi,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x13,%eax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edi
movswl %di,%eax
ret

LLVM IR (-O0):
define i32 @HashKey(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 97
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = srem i32 %7, 100
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @HashKey(i8 signext %0) {
%2 = sext i8 %0 to i16
%3 = add nsw i16 %2, -97
%4 = srem i16 %3, 100
%5 = sext i16 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ swab(unsigned char *, unsigned char *, unsigned long long);
void uyvy2yuyv(unsigned char *src, unsigned char *dest,
               unsigned long long int NumPixels) {
  swab(src, dest, NumPixels << 1);
}


x86 assembly (clang, -O0):
<uyvy2yuyv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
shl    $0x1,%rdx
call   1030 <swab@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uyvy2yuyv>:
add    %rdx,%rdx
jmp    1030 <swab@plt>

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

LLVM IR (-O2):
define void @uyvy2yuyv(i8* %0, i8* %1, i64 %2) {
%4 = shl i64 %2, 1
%5 = tail call i32 @swab(i8* %0, i8* %1, i64 %4)
ret void
}
/* Type definitions */
struct feed_text_iterator {
  int dummy;
};

/* Variables and functions */
char feed_text_iterator_set_glyph(struct feed_text_iterator *const,
                                  unsigned long);
char feed_text_iterator_home_glyph(
    struct feed_text_iterator *const p_text_iterator) {
  return feed_text_iterator_set_glyph(p_text_iterator, 0ul);
}


x86 assembly (clang, -O0):
<feed_text_iterator_home_glyph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <feed_text_iterator_set_glyph@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feed_text_iterator_home_glyph>:
xor    %esi,%esi
jmp    1030 <feed_text_iterator_set_glyph@plt>

LLVM IR (-O0):
%struct.feed_text_iterator = type { i32 }
define signext i8 @feed_text_iterator_home_glyph(%struct.feed_text_iterator* %0) {
%2 = alloca %struct.feed_text_iterator*
store %struct.feed_text_iterator* %0, %struct.feed_text_iterator** %2
%3 = load %struct.feed_text_iterator*, %struct.feed_text_iterator** %2
%4 = call signext i8 @feed_text_iterator_set_glyph(%struct.feed_text_iterator* %3, i64 0)
ret i8 %4
}

LLVM IR (-O2):
%struct.feed_text_iterator = type { i32 }
define signext i8 @feed_text_iterator_home_glyph(%struct.feed_text_iterator* %0) {
%2 = tail call signext i8 @feed_text_iterator_set_glyph(%struct.feed_text_iterator* %0, i64 0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ uart_puts(char *);
void irq_handler(void) { uart_puts("IRQ !\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"IRQ !\0A\00"
define void @irq_handler() {
%1 = call i32 @uart_puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"IRQ !\0A\00"
define void @irq_handler() {
%1 = tail call i32 @uart_puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
int foo(int i) {
  if ((i | 3) == 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     $0x3,%eax
cmp    $0x1,%eax
jne    1122 <foo+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1129 <foo+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mdfree(void *tip, int ndim) {
  if (ndim == 1)
    free(tip);
  else {
    mdfree(((void **)tip)[0], ndim - 1);
    free(tip);
  }
}


x86 assembly (clang, -O0):
<mdfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1147 <mdfree+0x27>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
jmp    1162 <mdfree+0x42>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1040 <mdfree@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdfree>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x1,%esi
je     1134 <mdfree+0x14>
mov    (%rbx),%rdi
add    $0xffffffff,%esi
call   1040 <mdfree@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mdfree(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %4, label %6
4: ; preds = %2, %6
%5 = tail call i32 @free(i8* %0)
ret void
6: ; preds = %2
%7 = bitcast i8* %0 to i8**
%8 = load i8*, i8** %7
%9 = add nsw i32 %1, -1
tail call void @mdfree(i8* %8, i32 %9)
br label %4
}
int is_alpha(int ch) {
  return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z');
}


x86 assembly (clang, -O0):
<is_alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1120 <is_alpha+0x20>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    113f <is_alpha+0x3f>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1139 <is_alpha+0x39>
cmpl   $0x5a,-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
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_alpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_alpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit_wrapper(int /*<<< orphan*/);
void __attribute__((destructor)) fini() { exit_wrapper(0); }


x86 assembly (clang, -O0):
<fini>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit_wrapper@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fini>:
xor    %edi,%edi
jmp    1030 <exit_wrapper@plt>

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @fini, i8* null }]
define void @fini() {
%1 = call i32 @exit_wrapper(i32 0)
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @fini, i8* null }]
define void @fini() {
%1 = tail call i32 @exit_wrapper(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ p18_adc();
int /*<<< orphan*/ p18_int_pin();
int /*<<< orphan*/ p18_int_portb();
int /*<<< orphan*/ p18_tmr0();
int /*<<< orphan*/ p18_tmr1();
int /*<<< orphan*/ p18_tmr2();
int /*<<< orphan*/ p18_tmr3();
int /*<<< orphan*/ p18_wdt();
int /*<<< orphan*/ serial(int /*<<< orphan*/);
void PIC18F45K50_periferic(void) {
  p18_adc();
  p18_int_pin();
  p18_int_portb();
  p18_tmr0();
  p18_wdt();
  p18_tmr1();
  p18_tmr2();
  p18_tmr3();
  serial(0);
  ;
}


x86 assembly (clang, -O0):
<PIC18F45K50_periferic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <p18_adc@plt>
mov    $0x0,%al
call   1070 <p18_int_pin@plt>
mov    $0x0,%al
call   1080 <p18_int_portb@plt>
mov    $0x0,%al
call   1050 <p18_tmr0@plt>
mov    $0x0,%al
call   1090 <p18_wdt@plt>
mov    $0x0,%al
call   10a0 <p18_tmr1@plt>
mov    $0x0,%al
call   1040 <p18_tmr2@plt>
mov    $0x0,%al
call   10b0 <p18_tmr3@plt>
xor    %edi,%edi
call   1060 <serial@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIC18F45K50_periferic>:
push   %rax
xor    %eax,%eax
call   1030 <p18_adc@plt>
xor    %eax,%eax
call   1070 <p18_int_pin@plt>
xor    %eax,%eax
call   1080 <p18_int_portb@plt>
xor    %eax,%eax
call   1050 <p18_tmr0@plt>
xor    %eax,%eax
call   1090 <p18_wdt@plt>
xor    %eax,%eax
call   10a0 <p18_tmr1@plt>
xor    %eax,%eax
call   1040 <p18_tmr2@plt>
xor    %eax,%eax
call   10b0 <p18_tmr3@plt>
xor    %edi,%edi
pop    %rax
jmp    1060 <serial@plt>

LLVM IR (-O0):
define void @PIC18F45K50_periferic() {
%1 = call i32 (...) @p18_adc()
%2 = call i32 (...) @p18_int_pin()
%3 = call i32 (...) @p18_int_portb()
%4 = call i32 (...) @p18_tmr0()
%5 = call i32 (...) @p18_wdt()
%6 = call i32 (...) @p18_tmr1()
%7 = call i32 (...) @p18_tmr2()
%8 = call i32 (...) @p18_tmr3()
%9 = call i32 @serial(i32 0)
ret void
}

LLVM IR (-O2):
define void @PIC18F45K50_periferic() {
%1 = tail call i32 (...) @p18_adc()
%2 = tail call i32 (...) @p18_int_pin()
%3 = tail call i32 (...) @p18_int_portb()
%4 = tail call i32 (...) @p18_tmr0()
%5 = tail call i32 (...) @p18_wdt()
%6 = tail call i32 (...) @p18_tmr1()
%7 = tail call i32 (...) @p18_tmr2()
%8 = tail call i32 (...) @p18_tmr3()
%9 = tail call i32 @serial(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glmInverseSqrt3f(float *, float *);
void glmInverseSqrt3f_(float x[3]) { glmInverseSqrt3f(x, x); }


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

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

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

LLVM IR (-O2):
define void @glmInverseSqrt3f_(float* %0) {
%2 = tail call i32 @glmInverseSqrt3f(float* %0, float* %0)
ret void
}