xunge/DecIR huggingface dataset:
__attribute__((no, noclone)) signed __int128 t120_3mul(signed __int128 y) {
  signed __int128 r;
  if (__builtin_mul_overflow((signed __int128)(2), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t120_3mul>:
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    %rdx,%rdx
adc    %rcx,%rcx
seto   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1156 <t120_3mul+0x46>
jmp    115d <t120_3mul+0x4d>
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):
<t120_3mul>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    %rdi,%rbx
adc    %rsi,%r14
jno    1129 <t120_3mul+0x19>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t120_3mul(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.smul.with.overflow.i128(i128 2, 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 } @t120_3mul(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.smul.with.overflow.i128(i128 %6, i128 2)
%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 */
char *malloc(int);
int /*<<< orphan*/ memcmp(char *, char *, int);
void testPassConstPointerIndirectly() {
  char *p = malloc(1);
  p++;
  memcmp(p, p, sizeof(&p));
  return;
}


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

x86 assembly (clang, -O2):
<testPassConstPointerIndirectly>:
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
lea    0x1(%rax),%rdi
mov    %rdi,%rsi
mov    $0x8,%edx
pop    %rax
jmp    1030 <memcmp@plt>

LLVM IR (-O0):
define void @testPassConstPointerIndirectly() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i32 1
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 @memcmp(i8* %5, i8* %6, i32 8)
ret void
}

LLVM IR (-O2):
define void @testPassConstPointerIndirectly() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%2 = getelementptr inbounds i8, i8* %1, i64 1
%3 = tail call i32 @memcmp(i8* %2, i8* %2, i32 8)
ret void
}
/* Type definitions */
struct timespec {
  unsigned long long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
unsigned long long trace_get_nsec(void) {
  struct timespec tv;
  clock_gettime(CLOCK_REALTIME, &tv);
  return ((unsigned long long)tv.tv_sec * 1000000000) + tv.tv_nsec;
}


x86 assembly (clang, -O0):
<trace_get_nsec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,-0x8(%rbp),%rax
3b
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_get_nsec>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x10(%rsp),%rax
9a 3b
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_REALTIME = global i32 0
define i64 @trace_get_nsec() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_REALTIME = global i32 0
define i64 @trace_get_nsec() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = mul i64 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = add i64 %7, %9
ret i64 %10
}
/* Variables and functions */
double fabs(double const);
void abs_d(const double *source, double *target) { *target = fabs(*source); }


x86 assembly (clang, -O0):
<abs_d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movaps 0xee5(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_d>:
movsd  (%rdi),%xmm0
andps  0xef5(%rip),%xmm0
movlps %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @abs_d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = call double @llvm.fabs.f64(double %6)
%8 = load double*, double** %4
store double %7, double* %8
ret void
}

LLVM IR (-O2):
define void @abs_d(double* nocapture %0, double* nocapture writeonly %1) {
%3 = load double, double* %0
%4 = tail call double @llvm.fabs.f64(double %3)
store double %4, double* %1
ret void
}
int rpi_nano_frequency_to_channel(double frequency) {
  if (frequency < 863.0125 || frequency > 870)
    return -1;
  return (frequency - 863) / 0.0125;
}


x86 assembly (clang, -O0):
<rpi_nano_frequency_to_channel>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
ja     1133 <rpi_nano_frequency_to_channel+0x33>
movsd  -0x10(%rbp),%xmm0
movsd  0xedf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    113f <rpi_nano_frequency_to_channel+0x3f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <rpi_nano_frequency_to_channel+0x63>
movsd  -0x10(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeb8(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpi_nano_frequency_to_channel>:
movsd  0xef8(%rip),%xmm1
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
ja     1131 <rpi_nano_frequency_to_channel+0x31>
ucomisd 0xeed(%rip),%xmm0
ja     1131 <rpi_nano_frequency_to_channel+0x31>
addsd  0xeeb(%rip),%xmm0
divsd  0xeeb(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @rpi_nano_frequency_to_channel(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0x408AF8199999999A
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load double, double* %3
%8 = fcmp ogt double %7, 8.700000e+02
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 -1, i32* %2
br label %15
10: ; preds = %6
%11 = load double, double* %3
%12 = fsub double %11, 8.630000e+02
%13 = fdiv double %12, 1.250000e-02
%14 = fptosi double %13 to i32
store i32 %14, i32* %2
br label %15
15: ; preds = %10, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @rpi_nano_frequency_to_channel(double %0) {
%2 = fcmp olt double %0, 0x408AF8199999999A
%3 = fcmp ogt double %0, 8.700000e+02
%4 = or i1 %2, %3
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = fadd double %0, -8.630000e+02
%7 = fdiv double %6, 1.250000e-02
%8 = fptosi double %7 to i32
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ -1, %1 ]
ret i32 %10
}
int b(void) {
  int i = 0, g = 0;
  while (i++ < 400000) {
    g += i;
  }
  return g;
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x61a80,%eax
jge    1136 <b+0x36>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <b+0x12>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @b() {
ret i32 -1604178624
}
long long uzuu() { return 0x7fff00007fff7fffLL; }


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

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

LLVM IR (-O0):
define i64 @uzuu() {
ret i64 9223090564025516031
}

LLVM IR (-O2):
define i64 @uzuu() {
ret i64 9223090564025516031
}
void VMSetErrorV(void) {}


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

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

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

LLVM IR (-O2):
define void @VMSetErrorV() {
ret void
}
/* Variables and functions */
void populate_array(int *array, size_t arraySize, int (*getNextValue)(void)) {
  for (size_t i = 0; i < arraySize; i++)
    array[i] = getNextValue();
}


x86 assembly (clang, -O0):
<populate_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    114b <populate_array+0x4b>
call   *-0x18(%rbp)
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <populate_array+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<populate_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1130 <populate_array+0x30>
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
call   *%r14
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1120 <populate_array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @populate_array(i32* nocapture writeonly %0, i64 %1, i32 ()* nocapture %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i64 [ %10, %6 ], [ 0, %3 ]
%8 = tail call i32 %2()
%9 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %8, i32* %9
%10 = add nuw i64 %7, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %5, label %6
}
void emit_type_definition_bool(
    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_bool>:
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_bool>:
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_bool(%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_bool(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
/* Type definitions */
struct circular_buffer {
  int dummy;
};

/* Variables and functions */
int cb_read(struct circular_buffer *, char *, int);
int cb_read_single(struct circular_buffer *buffer, char *target) {
  return cb_read(buffer, target, 1);
}


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

x86 assembly (clang, -O2):
<cb_read_single>:
mov    $0x1,%edx
jmp    1030 <cb_read@plt>

LLVM IR (-O0):
%struct.circular_buffer = type { i32 }
define i32 @cb_read_single(%struct.circular_buffer* %0, i8* %1) {
%3 = alloca %struct.circular_buffer*
%4 = alloca i8*
store %struct.circular_buffer* %0, %struct.circular_buffer** %3
store i8* %1, i8** %4
%5 = load %struct.circular_buffer*, %struct.circular_buffer** %3
%6 = load i8*, i8** %4
%7 = call i32 @cb_read(%struct.circular_buffer* %5, i8* %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
%struct.circular_buffer = type { i32 }
define i32 @cb_read_single(%struct.circular_buffer* %0, i8* %1) {
%3 = tail call i32 @cb_read(%struct.circular_buffer* %0, i8* %1, i32 1)
ret i32 %3
}
void txt_smpte(hr, mn, se, fr, ff) {
  prtime();
  printf("SMPTE, hour=%d minute=%d second=%d frame=%d fract-frame=%d\n", hr, mn,
         se, fr, ff);
}


x86 assembly (clang, -O0):
<txt_smpte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    $0x0,%al
call   1040 <prtime@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txt_smpte>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <prtime@plt>
lea    0xebd(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"SMPTE, hour=%d minute=%d second=%d frame=%d fract-frame=%d\0A\00"
define void @txt_smpte(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = call i32 (...) @prtime()
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i32 %14, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [60 x i8] c"SMPTE, hour=%d minute=%d second=%d frame=%d fract-frame=%d\0A\00"
define void @txt_smpte(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 (...) @prtime()
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_171() {
  Assert_real((isqrt(171) == 13),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              860, ("Integer square root of 171 should be 13"));
}


x86 assembly (clang, -O0):
<t_sqrt_171>:
push   %rbp
mov    %rsp,%rbp
mov    $0xab,%edi
call   1030 <isqrt@plt>
cmp    $0xd,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x35c,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_171>:
push   %rax
mov    $0xab,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xd,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x35c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 171 should be 13\00"
define void @t_sqrt_171() {
%1 = call i32 @isqrt(i32 171)
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 860, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 171 should be 13\00"
define void @t_sqrt_171() {
%1 = tail call i32 @isqrt(i32 171)
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 860, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *ec_fopen(const char *path, const char *mode) {
  FILE *file = fopen(path, mode);
  if (file == NULL)
    fatal("in ec_fopen()");
  return file;
}


x86 assembly (clang, -O0):
<ec_fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <ec_fopen+0x38>
lea    0xead(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ec_fopen>:
push   %rbx
call   1030 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <ec_fopen+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"in ec_fopen()\00"
define noalias i32* @ec_fopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32* %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int putchar(int c) {
  while (!((*(volatile uint8_t *)0x5230) & (1 << 7)))
    ;
  (*(volatile uint8_t *)0x5231) = c;
  return c;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x5230,%eax
mov    (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1128 <putchar+0x28>
jmp    112d <putchar+0x2d>
jmp    1107 <putchar+0x7>
mov    -0x4(%rbp),%ecx
mov    $0x5231,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
testl  $0x80,0x5230
je     1110 <putchar+0x10>
mov    %eax,0x5231
ret

LLVM IR (-O0):
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i32, i32* inttoptr (i64 21040 to i32*)
%5 = and i32 %4, 128
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
store volatile i32 %10, i32* inttoptr (i64 21041 to i32*)
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @putchar(i32 returned %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 21040 to i32*)
%4 = and i32 %3, 128
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
store volatile i32 %0, i32* inttoptr (i64 21041 to i32*)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printTooManyFilesError() {
  fprintf(stderr, "Too many files in input; not enough scalars. (see -h)\n");
}


x86 assembly (clang, -O0):
<printTooManyFilesError>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTooManyFilesError>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"Too many files in input; not enough scalars. (see -h)\0A\00"
define void @printTooManyFilesError() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"Too many files in input; not enough scalars. (see -h)\0A\00"
define void @printTooManyFilesError() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret void
}
void logic16(void) {}


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

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

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

LLVM IR (-O2):
define void @logic16() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fortune_cookie(char *);
int main() {
  char msg[] = "Who`s your daddy?!";
  fortune_cookie(msg);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%ax
mov    %ax,-0x10(%rbp)
mov    0xecc(%rip),%al
mov    %al,-0xe(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <fortune_cookie@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x213f79,0xf(%rsp)
mov    %rsp,%rdi
call   1030 <fortune_cookie@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.msg = [19 x i8] c"Who`s your daddy?!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [19 x i8]
store i32 0, i32* %1
%3 = bitcast [19 x i8]* %2 to i8*
%4 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 0
%5 = call i32 @fortune_cookie(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.msg = [19 x i8] c"Who`s your daddy?!\00"
define i32 @main() {
%1 = alloca [19 x i8]
%2 = getelementptr inbounds [19 x i8], [19 x i8]* %1, i64 0, i64 0
%3 = call i32 @fortune_cookie(i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ InitApp();
int /*<<< orphan*/ play_led();
int32_t main(void) {
  InitApp();
  while (1) {
    play_led();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <InitApp@plt>
mov    $0x0,%al
call   1040 <play_led@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <InitApp@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <play_led@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @InitApp()
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @play_led()
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @InitApp()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @play_led()
br label %2
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int getBlue0(int const);
int getGreen0(int const);
int getRed0(int const);
int32_t getGray0(int32_t const rgb3) {
  int32_t const __leon_normexec0 = getRed0(rgb3);
  int32_t const __leon_normexec1 = getGreen0(rgb3);
  int32_t const __leon_normexec2 = getBlue0(rgb3);
  return (((__leon_normexec0 + __leon_normexec1) + __leon_normexec2) / 3);
}


x86 assembly (clang, -O0):
<getGray0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <getRed0@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <getGreen0@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <getBlue0@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getGray0>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
call   1040 <getRed0@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1050 <getGreen0@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <getBlue0@plt>
add    %r14d,%ebp
add    %eax,%ebp
movslq %ebp,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getGray0(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @getRed0(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = call i32 @getGreen0(i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %2
%11 = call i32 @getBlue0(i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
%15 = load i32, i32* %5
%16 = add nsw i32 %14, %15
%17 = sdiv i32 %16, 3
ret i32 %17
}

LLVM IR (-O2):
define i32 @getGray0(i32 %0) {
%2 = tail call i32 @getRed0(i32 %0)
%3 = tail call i32 @getGreen0(i32 %0)
%4 = tail call i32 @getBlue0(i32 %0)
%5 = add nsw i32 %3, %2
%6 = add nsw i32 %5, %4
%7 = sdiv i32 %6, 3
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void test_pointer_2(char *symb[100]) {
  int c = 0;
  printf("1\n");
  c = **symb;
  printf("in test_pointer_2 c = %c; and * * symb = '%c' as char; and * symb = "
         "'%s' as string\n",
         c, **symb, *symb);
  printf("2;\n");
}


x86 assembly (clang, -O0):
<test_pointer_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_pointer_2>:
push   %rbx
mov    %rdi,%rbx
lea    0xf29(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rcx
movsbl (%rcx),%edx
lea    0xec3(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf09(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"1\0A\00"
@.str.1 = [84 x i8] c"in test_pointer_2 c = %c; and * * symb = '%c' as char; and * symb = '%s' as string\0A\00"
@.str.2 = [4 x i8] c"2;\0A\00"
define void @test_pointer_2(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i8**, i8*** %2
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8**, i8*** %2
%15 = load i8*, i8** %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %13, i8* %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [84 x i8] c"in test_pointer_2 c = %c; and * * symb = '%c' as char; and * symb = '%s' as string\0A\00"
@str = [2 x i8] c"1\00"
@str.3 = [3 x i8] c"2;\00"
define void @test_pointer_2(i8** nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%3 = load i8*, i8** %0
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([84 x i8], [84 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %5, i8* %3)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.3, i64 0, i64 0))
ret void
}
float remapf(float x, float lo1, float hi1, float lo2, float hi2) {
  return (x - lo1) / (hi1 - lo1) * (hi2 - lo2) + lo2;
}


x86 assembly (clang, -O0):
<remapf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
subss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm2
subss  -0x10(%rbp),%xmm2
movss  -0x10(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<remapf>:
subss  %xmm1,%xmm0
subss  %xmm1,%xmm2
divss  %xmm2,%xmm0
subss  %xmm3,%xmm4
mulss  %xmm4,%xmm0
addss  %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @remapf(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %6
%12 = load float, float* %7
%13 = fsub float %11, %12
%14 = load float, float* %8
%15 = load float, float* %7
%16 = fsub float %14, %15
%17 = fdiv float %13, %16
%18 = load float, float* %10
%19 = load float, float* %9
%20 = fsub float %18, %19
%21 = load float, float* %9
%22 = call float @llvm.fmuladd.f32(float %17, float %20, float %21)
ret float %22
}

LLVM IR (-O2):
define float @remapf(float %0, float %1, float %2, float %3, float %4) {
%6 = fsub float %0, %1
%7 = fsub float %2, %1
%8 = fdiv float %6, %7
%9 = fsub float %4, %3
%10 = tail call float @llvm.fmuladd.f32(float %8, float %9, float %3)
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test_yajl_start_map(void *ctx) {
  printf("map open '{'\n");
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"map open '{'\0A\00"
define i32 @test_yajl_start_map(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [13 x i8] c"map open '{'\00"
define i32 @test_yajl_start_map(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
char *_add(char *, char *const, char const *const);
int /*<<< orphan*/ snprintf(char *, int, char const *const, int const);
char *_conv(const int n, const char *const format, char *const pt,
            const char *const ptlim) {
  char buf[32];
  (void)snprintf(buf, sizeof(buf), format, n);
  return _add(buf, pt, ptlim);
}


x86 assembly (clang, -O0):
<_conv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x4(%rbp),%ecx
mov    $0x20,%esi
call   1030 <snprintf@plt>
lea    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <_add@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_conv>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rsi,%rdx
mov    %edi,%ecx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x20,%esi
call   1030 <snprintf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <_add@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @_conv(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [32 x i8]
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %6
%12 = load i32, i32* %5
%13 = call i32 @snprintf(i8* %10, i32 32, i8* %11, i32 %12)
%14 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%15 = load i8*, i8** %7
%16 = load i8*, i8** %8
%17 = call i8* @_add(i8* %14, i8* %15, i8* %16)
ret i8* %17
}

LLVM IR (-O2):
define i8* @_conv(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca [32 x i8]
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = call i32 @snprintf(i8* %6, i32 32, i8* %1, i32 %0)
%8 = call i8* @_add(i8* %6, i8* %2, i8* %3)
ret i8* %8
}
/* Type definitions */
struct statvfs {
  int dummy;
};
struct statfs {
  int dummy;
};

/* Variables and functions */
scalar_t__ __statfs(char const *, struct statfs *);
int /*<<< orphan*/ fixup(struct statvfs *, struct statfs *);
int statvfs(const char *restrict path, struct statvfs *restrict buf) {
  struct statfs kbuf;
  if (__statfs(path, &kbuf) < 0)
    return -1;
  fixup(buf, &kbuf);
  return 0;
}


x86 assembly (clang, -O0):
<statvfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <__statfs@plt>
cmp    $0x0,%rax
jge    1153 <statvfs+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <statvfs+0x47>
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <fixup@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<statvfs>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <__statfs@plt>
test   %rax,%rax
js     1148 <statvfs+0x28>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <fixup@plt>
xor    %eax,%eax
jmp    114d <statvfs+0x2d>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.statvfs = type { i32 }
%struct.statfs = type { i32 }
define i32 @statvfs(i8* noalias %0, %struct.statvfs* noalias %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.statvfs*
%6 = alloca %struct.statfs
store i8* %0, i8** %4
store %struct.statvfs* %1, %struct.statvfs** %5
%7 = load i8*, i8** %4
%8 = call i64 @__statfs(i8* %7, %struct.statfs* %6)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %14
11: ; preds = %2
%12 = load %struct.statvfs*, %struct.statvfs** %5
%13 = call i32 @fixup(%struct.statvfs* %12, %struct.statfs* %6)
store i32 0, i32* %3
br label %14
14: ; preds = %11, %10
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.statvfs = type { i32 }
%struct.statfs = type { i32 }
define i32 @statvfs(i8* noalias %0, %struct.statvfs* noalias %1) {
%3 = alloca %struct.statfs
%4 = bitcast %struct.statfs* %3 to i8*
%5 = call i64 @__statfs(i8* %0, %struct.statfs* %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @fixup(%struct.statvfs* %1, %struct.statfs* %3)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ _IOFBF;
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/,
                           size_t);
void setbuffer(FILE *fp, char *buf, size_t size) {
  setvbuf(fp, buf, buf ? _IOFBF : _IONBF, size);
}


x86 assembly (clang, -O0):
<setbuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1150 <setbuffer+0x40>
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
jmp    115c <setbuffer+0x4c>
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <setvbuf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbuffer>:
mov    %rdx,%rcx
test   %rsi,%rsi
jne    1126 <setbuffer+0x16>
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <setvbuf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
jmp    1030 <setvbuf@plt>

LLVM IR (-O0):
@_IOFBF = global i32 0
@_IONBF = global i32 0
define void @setbuffer(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* @_IOFBF
br label %15
13: ; preds = %3
%14 = load i32, i32* @_IONBF
br label %15
15: ; preds = %13, %11
%16 = phi i32 [ %12, %11 ], [ %14, %13 ]
%17 = load i64, i64* %6
%18 = call i32 @setvbuf(i32* %7, i8* %8, i32 %16, i64 %17)
ret void
}

LLVM IR (-O2):
@_IOFBF = global i32 0
@_IONBF = global i32 0
define void @setbuffer(i32* nocapture %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %1, null
%5 = load i32, i32* @_IOFBF
%6 = load i32, i32* @_IONBF
%7 = select i1 %4, i32 %6, i32 %5
%8 = tail call i32 @setvbuf(i32* %0, i8* %1, i32 %7, i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  char buf[] = "Hello world!\n";
  write(1, buf, sizeof(buf));
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec2(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0x12(%rbp),%rsi
mov    $0x1,%edi
mov    $0xe,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0xa21646c726f77,%rax
mov    %rax,0xe(%rsp)
movabs $0x6f77206f6c6c6548,%rax
20 77 6f
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edi
mov    $0xe,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@__const.main.buf = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [14 x i8]
store i32 0, i32* %1
%3 = bitcast [14 x i8]* %2 to i8*
%4 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%5 = call i32 @write(i32 1, i8* %4, i32 14)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@__const.main.buf = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = alloca [14 x i8]
%2 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%3 = call i32 @write(i32 1, i8* %2, i32 14)
%4 = tail call i32 @exit(i32 0)
unreachable
}
unsigned int charlen(char *s) {
  unsigned int len = 0;
  while (*(s + len) != '\0') {
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<charlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1131 <charlen+0x31>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <charlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi,%rax,1)
jne    1110 <charlen+0x10>
ret

LLVM IR (-O0):
define i32 @charlen(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 = zext 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 %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @charlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 5, b, i, c = 0;
  for (i = 0; i <= 31; i++) {
    b = (a >> i) & 0x1;
    c = c | b << 31 - i;
  }
  printf("%x\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x1f,-0x10(%rbp)
jg     1171 <main+0x61>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%edx
mov    $0x1f,%ecx
sub    -0x10(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <main+0x24>
mov    -0x14(%rbp),%esi
lea    0xe85(%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    $0xa0000000,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%x\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 0, i32* %5
store i32 0, i32* %4
br label %6
6: ; preds = %20, %0
%7 = load i32, i32* %4
%8 = icmp sle i32 %7, 31
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %4
%12 = ashr i32 %10, %11
%13 = and i32 %12, 1
store i32 %13, i32* %3
%14 = load i32, i32* %5
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = sub nsw i32 31, %16
%18 = shl i32 %15, %17
%19 = or i32 %14, %18
store i32 %19, i32* %5
br label %20
20: ; preds = %9
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %6
23: ; preds = %6
%24 = load i32, i32* %5
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -1610612736)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, int, char);
int fun_stub_base_5_stub(char a, int b, char c) {
  printf("fun_stub_base_5_stub:a = %d, b = %d, c = %d\n", a, b, c);
  return a + b + c;
}


x86 assembly (clang, -O0):
<fun_stub_base_5_stub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%edx
lea    0xecd(%rip),%rdi
movsbl %al,%esi
movsbl -0x9(%rbp),%ecx
call   1030 <printf@plt>
movsbl -0x1(%rbp),%eax
add    -0x8(%rbp),%eax
movsbl -0x9(%rbp),%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_stub_base_5_stub>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xede(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1030 <printf@plt>
add    %ebp,%ebx
add    %r14d,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [45 x i8] c"fun_stub_base_5_stub:a = %d, b = %d, c = %d\0A\00"
define i32 @fun_stub_base_5_stub(i8 signext %0, i32 %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i8
store i8 %0, i8* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = load i32, i32* %5
%9 = load i8, i8* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8 signext %7, i32 %8, i8 signext %9)
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = load i32, i32* %5
%14 = add nsw i32 %12, %13
%15 = load i8, i8* %6
%16 = sext i8 %15 to i32
%17 = add nsw i32 %14, %16
ret i32 %17
}

LLVM IR (-O2):
@.str = [45 x i8] c"fun_stub_base_5_stub:a = %d, b = %d, c = %d\0A\00"
define i32 @fun_stub_base_5_stub(i8 signext %0, i32 %1, i8 signext %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8 signext %0, i32 %1, i8 signext %2)
%5 = sext i8 %0 to i32
%6 = add nsw i32 %5, %1
%7 = sext i8 %2 to i32
%8 = add nsw i32 %6, %7
ret i32 %8
}