xunge/DecIR huggingface dataset:
/* Variables and functions */
double cblas_dnrm2(int const, double const *, int const);
double c_dnrm2(const int N, const double *X, const int stride) {
  return cblas_dnrm2(N, X, stride);
}


x86 assembly (clang, -O0):
<c_dnrm2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <cblas_dnrm2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_dnrm2>:
jmp    1030 <cblas_dnrm2@plt>

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

LLVM IR (-O2):
define double @c_dnrm2(i32 %0, double* %1, i32 %2) {
%4 = tail call double @cblas_dnrm2(i32 %0, double* %1, i32 %2)
ret double %4
}
/* Variables and functions */
scalar_t__ mcas_fixup(void **, void *);
void *read_barrier(void **ptr) {
  void *v;
  do {
    v = *ptr;
  } while (mcas_fixup(ptr, v));
  return v;
}


x86 assembly (clang, -O0):
<read_barrier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <mcas_fixup@plt>
cmp    $0x0,%rax
jne    111c <read_barrier+0xc>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_barrier>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
mov    (%r14),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <mcas_fixup@plt>
test   %rax,%rax
jne    1120 <read_barrier+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @read_barrier(i8** %0) {
br label %2
2: ; preds = %2, %1
%3 = load i8*, i8** %0
%4 = tail call i64 @mcas_fixup(i8** %0, i8* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int log2_int32(int);
int get_bin_idx_for_chunk(int chunk_size) {
  int idx = log2_int32(chunk_size) - 5;
  ((void)0);
  if (idx >= (31 - 5 + 1))
    idx = (31 - 5 + 1) - 1;
  return idx;
}


x86 assembly (clang, -O0):
<get_bin_idx_for_chunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <log2_int32@plt>
sub    $0x5,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1b,-0x8(%rbp)
jl     113a <get_bin_idx_for_chunk+0x2a>
movl   $0x1a,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bin_idx_for_chunk>:
push   %rax
call   1030 <log2_int32@plt>
cmp    $0x1f,%eax
mov    $0x1f,%ecx
cmovge %ecx,%eax
add    $0xfffffffb,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_bin_idx_for_chunk(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @log2_int32(i32 %4)
%6 = sub nsw i32 %5, 5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 27
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 26, i32* %3
br label %10
10: ; preds = %9, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_bin_idx_for_chunk(i32 %0) {
%2 = tail call i32 @log2_int32(i32 %0)
%3 = icmp slt i32 %2, 31
%4 = select i1 %3, i32 %2, i32 31
%5 = add nsw i32 %4, -5
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
void zigbee_setZigBeeFrameSize(uint8_t *buffer, uint32_t sizeFrame) {
  buffer[1] = ((uint16_t)(sizeFrame - ((3) + 1))) >> 8;
  buffer[2] = (uint8_t)(sizeFrame - ((3) + 1));
}


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

x86 assembly (clang, -O2):
<zigbee_setZigBeeFrameSize>:
add    $0xfffffffc,%esi
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,0x4(%rdi)
mov    %esi,0x8(%rdi)
ret

LLVM IR (-O0):
define void @zigbee_setZigBeeFrameSize(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sub nsw i32 %5, 4
%7 = ashr i32 %6, 8
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 4
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 2
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @zigbee_setZigBeeFrameSize(i32* nocapture writeonly %0, i32 %1) {
%3 = add nsw i32 %1, -4
%4 = ashr i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
%6 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %3, i32* %6
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int read_byte();
uint64_t read_fixed(int bytes) {
  uint64_t value = 0;
  int i;
  for (i = bytes; i > 0; --i)
    value = (value << 8) | read_byte();
  return value;
}


x86 assembly (clang, -O0):
<read_fixed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    115a <read_fixed+0x4a>
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <read_byte@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <read_fixed+0x18>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_fixed>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1136 <read_fixed+0x26>
mov    %edi,%ebx
add    $0x1,%ebx
xor    %ebp,%ebp
xchg   %ax,%ax
shl    $0x8,%ebp
xor    %eax,%eax
call   1030 <read_byte@plt>
or     %eax,%ebp
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <read_fixed+0x10>
jmp    1138 <read_fixed+0x28>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @read_fixed(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%5 = load i32, i32* %2
store i32 %5, i32* %4
br label %6
6: ; preds = %14, %1
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load i32, i32* %3
%11 = shl i32 %10, 8
%12 = call i32 (...) @read_byte()
%13 = or i32 %11, %12
store i32 %13, i32* %3
br label %14
14: ; preds = %9
%15 = load i32, i32* %4
%16 = add nsw i32 %15, -1
store i32 %16, i32* %4
br label %6
17: ; preds = %6
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @read_fixed(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = shl i32 %5, 8
%7 = tail call i32 (...) @read_byte()
%8 = or i32 %7, %6
%9 = add nsw i32 %4, -1
%10 = icmp ugt i32 %4, 1
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
signed char compareFloat(void *t1, void *t2) {
  float _t1 = *(float *)t1;
  float _t2 = *(float *)t2;
  if (_t1 < _t2)
    return -1;
  else if (_t1 > _t2)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compareFloat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm1
movss  -0x20(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1142 <compareFloat+0x42>
movb   $0xff,-0x1(%rbp)
jmp    115e <compareFloat+0x5e>
movss  -0x1c(%rbp),%xmm0
ucomiss -0x20(%rbp),%xmm0
jbe    115a <compareFloat+0x5a>
movb   $0x1,-0x1(%rbp)
jmp    115e <compareFloat+0x5e>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareFloat>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
ucomiss %xmm0,%xmm1
mov    $0xff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @compareFloat(i8* %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca float
%7 = alloca float
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
store float %10, float* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to float*
%13 = load float, float* %12
store float %13, float* %7
%14 = load float, float* %6
%15 = load float, float* %7
%16 = fcmp olt float %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i8 -1, i8* %3
br label %24
18: ; preds = %2
%19 = load float, float* %6
%20 = load float, float* %7
%21 = fcmp ogt float %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i8 1, i8* %3
br label %24
23: ; preds = %18
store i8 0, i8* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i8, i8* %3
ret i8 %25
}

LLVM IR (-O2):
define signext i8 @compareFloat(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp olt float %4, %6
%8 = fcmp ogt float %4, %6
%9 = zext i1 %8 to i8
%10 = select i1 %7, i8 -1, i8 %9
ret i8 %10
}
/* Type definitions */
struct timespec {
  int /*<<< orphan*/ tv_nsec;
  int /*<<< orphan*/ tv_sec;
};
struct stat {
  int /*<<< orphan*/ st_ctime;
};

/* Variables and functions */
int /*<<< orphan*/ get_stat_ctime_ns(struct stat const *);
struct timespec get_stat_ctime(struct stat const *st) {
  struct timespec t;
  t.tv_sec = st->st_ctime;
  t.tv_nsec = get_stat_ctime_ns(st);
  return t;
}


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

x86 assembly (clang, -O2):
<get_stat_ctime>:
push   %rbx
mov    (%rdi),%ebx
call   1030 <get_stat_ctime_ns@plt>
shl    $0x20,%rbx
mov    %eax,%eax
or     %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.timespec = type { i32, i32 }
define i64 @get_stat_ctime(%struct.stat* %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %3
%4 = load %struct.stat*, %struct.stat** %3
%5 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i32 %6, i32* %7
%8 = load %struct.stat*, %struct.stat** %3
%9 = call i32 @get_stat_ctime_ns(%struct.stat* %8)
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i32 %9, i32* %10
%11 = bitcast %struct.timespec* %2 to i64*
%12 = load i64, i64* %11
ret i64 %12
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i64 @get_stat_ctime(%struct.stat* %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @get_stat_ctime_ns(%struct.stat* %0)
%5 = zext i32 %3 to i64
%6 = shl nuw i64 %5, 32
%7 = zext i32 %4 to i64
%8 = or i64 %6, %7
ret i64 %8
}
/* Type definitions */
struct ncpaddr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ncpaddr_ntoa(struct ncpaddr const *);
char *subst(char *, char const *, int /*<<< orphan*/);
char *substipv6(char *tgt, const char *oldstr, const struct ncpaddr *ip) {
  return subst(tgt, oldstr, ncpaddr_ntoa(ip));
}


x86 assembly (clang, -O0):
<substipv6>:
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)
mov    -0x18(%rbp),%rdi
call   1030 <ncpaddr_ntoa@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1040 <subst@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substipv6>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1030 <ncpaddr_ntoa@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <subst@plt>

LLVM IR (-O0):
%struct.ncpaddr = type { i32 }
define i8* @substipv6(i8* %0, i8* %1, %struct.ncpaddr* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.ncpaddr*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.ncpaddr* %2, %struct.ncpaddr** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load %struct.ncpaddr*, %struct.ncpaddr** %6
%10 = call i32 @ncpaddr_ntoa(%struct.ncpaddr* %9)
%11 = call i8* @subst(i8* %7, i8* %8, i32 %10)
ret i8* %11
}

LLVM IR (-O2):
%struct.ncpaddr = type { i32 }
define i8* @substipv6(i8* %0, i8* %1, %struct.ncpaddr* %2) {
%4 = tail call i32 @ncpaddr_ntoa(%struct.ncpaddr* %2)
%5 = tail call i8* @subst(i8* %0, i8* %1, i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
void foo(void) {
  int n = 16875;
  while (n) {
    if (n & 1)
      bar(n);
    n >>= 1;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x41eb,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114e <foo+0x3e>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1140 <foo+0x30>
mov    -0x4(%rbp),%edi
call   1030 <bar@plt>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <foo+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    $0x41eb,%edi
call   1030 <bar@plt>
mov    $0x20f5,%edi
call   1030 <bar@plt>
mov    $0x83d,%edi
call   1030 <bar@plt>
mov    $0x20f,%edi
call   1030 <bar@plt>
mov    $0x107,%edi
call   1030 <bar@plt>
mov    $0x83,%edi
call   1030 <bar@plt>
mov    $0x41,%edi
call   1030 <bar@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
store i32 16875, i32* %1
br label %2
2: ; preds = %12, %0
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = load i32, i32* %1
%7 = and i32 %6, 1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %1
%11 = call i32 @bar(i32 %10)
br label %12
12: ; preds = %9, %5
%13 = load i32, i32* %1
%14 = ashr i32 %13, 1
store i32 %14, i32* %1
br label %2
15: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @bar(i32 16875)
%2 = tail call i32 @bar(i32 8437)
%3 = tail call i32 @bar(i32 2109)
%4 = tail call i32 @bar(i32 527)
%5 = tail call i32 @bar(i32 263)
%6 = tail call i32 @bar(i32 131)
%7 = tail call i32 @bar(i32 65)
%8 = tail call i32 @bar(i32 1)
ret void
}
/* Type definitions */
struct plainstring {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cstr_loaddouble(char *, double);
int /*<<< orphan*/ plainstring_add(struct plainstring *, char *);
void plainstring_add_double(struct plainstring *this_string, double d) {
  char buffer[0xFF];
  cstr_loaddouble(buffer, d);
  plainstring_add(this_string, buffer);
}


x86 assembly (clang, -O0):
<plainstring_add_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
call   1030 <cstr_loaddouble@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1040 <plainstring_add@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plainstring_add_double>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <cstr_loaddouble@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <plainstring_add@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.plainstring = type { i32 }
define void @plainstring_add_double(%struct.plainstring* %0, double %1) {
%3 = alloca %struct.plainstring*
%4 = alloca double
%5 = alloca [255 x i8]
store %struct.plainstring* %0, %struct.plainstring** %3
store double %1, double* %4
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%7 = load double, double* %4
%8 = call i32 @cstr_loaddouble(i8* %6, double %7)
%9 = load %struct.plainstring*, %struct.plainstring** %3
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%11 = call i32 @plainstring_add(%struct.plainstring* %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.plainstring = type { i32 }
define void @plainstring_add_double(%struct.plainstring* %0, double %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = call i32 @cstr_loaddouble(i8* %4, double %1)
%6 = call i32 @plainstring_add(%struct.plainstring* %0, i8* %4)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
int /*<<< orphan*/ bzero(struct stat *, int);
int /*<<< orphan*/ stat(char const *, struct stat *);
bool is_reg_file(const char *filename) {
  struct stat buf;
  bzero(&buf, sizeof buf);
  stat(filename, &buf);
  return (S_ISREG(buf.st_mode) ? true : false);
}


x86 assembly (clang, -O0):
<is_reg_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1050 <bzero@plt>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    -0x10(%rbp),%edi
call   1040 <S_ISREG@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_reg_file>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x4,%esi
call   1050 <bzero@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <stat@plt>
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_reg_file(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = call i32 @bzero(%struct.stat* %3, i32 4)
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %3)
%7 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISREG(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 1, i32 0
ret i32 %12
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_reg_file(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @bzero(%struct.stat* %2, i32 4)
%5 = call i32 @stat(i8* %0, %struct.stat* %2)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = tail call i64 @S_ISREG(i32 %7)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void print_bin(int number) {
  if (number) {
    print_bin(number >> 1);
    putc((number & 1) ? '1' : '0', stdout);
  } else {
    putc('0', stdout);
  }
}


x86 assembly (clang, -O0):
<print_bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     116c <print_bin+0x4c>
mov    -0x4(%rbp),%edi
sar    $0x1,%edi
call   1040 <print_bin@plt>
mov    -0x4(%rbp),%edx
and    $0x1,%edx
mov    $0x30,%eax
mov    $0x31,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    0x2e83(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1030 <putc@plt>
jmp    117f <print_bin+0x5f>
mov    0x2e6d(%rip),%rax
mov    (%rax),%esi
mov    $0x30,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bin>:
push   %rbx
test   %edi,%edi
je     1136 <print_bin+0x16>
mov    %edi,%ebx
sar    %edi
call   1040 <print_bin@plt>
and    $0x1,%bl
or     $0x30,%bl
jmp    1138 <print_bin+0x18>
mov    $0x30,%bl
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
movzbl %bl,%edi
pop    %rbx
jmp    1030 <putc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @print_bin(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %16
5: ; preds = %1
%6 = load i32, i32* %2
%7 = ashr i32 %6, 1
%8 = load i32, i32* %2
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 49, i32 48
%13 = trunc i32 %12 to i8
%14 = load i32, i32* @stdout
%15 = call i32 @putc(i8 signext %13, i32 %14)
br label %19
16: ; preds = %1
%17 = load i32, i32* @stdout
%18 = call i32 @putc(i8 signext 48, i32 %17)
br label %19
19: ; preds = %16, %5
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @print_bin(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1, %7
%4 = phi i8 [ %11, %7 ], [ 48, %1 ]
%5 = load i32, i32* @stdout
%6 = tail call i32 @putc(i8 signext %4, i32 %5)
ret void
7: ; preds = %1
%8 = ashr i32 %0, 1
tail call void @print_bin(i32 %8)
%9 = trunc i32 %0 to i8
%10 = and i8 %9, 1
%11 = or i8 %10, 48
br label %3
}
void INT_Excep_SSI0_SSIF0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SSI0_SSIF0() {
ret void
}
__attribute__((no, noclone)) unsigned __int128 t174_5sub(signed __int128 x) {
  unsigned __int128 r;
  if (__builtin_sub_overflow(x, (signed __int128)(-4), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t174_5sub>:
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
mov    %rcx,%r9
sar    $0x3f,%r9
add    $0x4,%rdx
adc    $0x0,%rcx
mov    %r9,%r8
adc    $0x0,%r8
adc    $0x0,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1187 <t174_5sub+0x77>
jmp    118e <t174_5sub+0x7e>
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):
<t174_5sub>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
add    $0x4,%r14
mov    %rsi,%rbx
adc    $0x0,%rbx
mov    $0xfffffffffffffffb,%rax
cmp    %rdi,%rax
mov    $0xffffffffffffffff,%rax
sbb    %rsi,%rax
jl     113f <t174_5sub+0x2f>
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 } @t174_5sub(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 = sext i128 %11 to i129
%13 = call { i129, i1 } @llvm.ssub.with.overflow.i129(i129 %12, i129 -4)
%14 = extractvalue { i129, i1 } %13, 1
%15 = extractvalue { i129, i1 } %13, 0
%16 = trunc i129 %15 to i128
%17 = zext i128 %16 to i129
%18 = icmp ne i129 %15, %17
%19 = or i1 %14, %18
store i128 %16, i128* %6
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 (...) @bar()
br label %22
22: ; preds = %20, %2
%23 = load i128, i128* %6
store i128 %23, i128* %3
%24 = bitcast i128* %3 to { i64, i64 }*
%25 = load { i64, i64 }, { i64, i64 }* %24
ret { i64, i64 } %25
}

LLVM IR (-O2):
define { i64, i64 } @t174_5sub(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 = zext i128 %6 to i129
%8 = add nuw i129 %7, 4
%9 = icmp slt i128 %6, -4
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i129 %8 to i64
%14 = lshr i129 %8, 64
%15 = trunc i129 %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 target_signal_to_host(int);
int host_signal_from_nto(int sig) {
  return target_signal_to_host(target_signal_to_host(sig));
}


x86 assembly (clang, -O0):
<host_signal_from_nto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <target_signal_to_host@plt>
mov    %eax,%edi
call   1030 <target_signal_to_host@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<host_signal_from_nto>:
push   %rax
call   1030 <target_signal_to_host@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <target_signal_to_host@plt>

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

LLVM IR (-O2):
define i32 @host_signal_from_nto(i32 %0) {
%2 = tail call i32 @target_signal_to_host(i32 %0)
%3 = tail call i32 @target_signal_to_host(i32 %2)
ret i32 %3
}
/* Variables and functions */
int strlen(char *);
void chomp(char *x) {
  int len;
  len = strlen(x);
  if ((len > 0) && (x[len - 1] == '\n')) {
    x[len - 1] = '\0';
  }
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    115d <chomp+0x4d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    115d <chomp+0x4d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    112a <chomp+0x1a>
add    $0xffffffff,%eax
cmpb   $0xa,(%rbx,%rax,1)
jne    112a <chomp+0x1a>
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @chomp(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = add nsw i32 %2, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %4
store i8 0, i8* %7
br label %11
11: ; preds = %10, %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int getpid();
int /*<<< orphan*/ stderr;
pid_t forkchild(void) {
  pid_t pid;
  if ((pid = fork()) < 0) {
    fprintf(stderr, "Fork failure in pid %d\n", getpid());
    exit(1);
  } else {
    return pid;
  }
}


x86 assembly (clang, -O0):
<forkchild>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <fork@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jge    1189 <forkchild+0x49>
mov    0x2e7e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%edx
lea    0xe86(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forkchild>:
push   %rbx
xor    %eax,%eax
call   1060 <fork@plt>
test   %eax,%eax
js     114e <forkchild+0xe>
pop    %rbx
ret
mov    0x2e8b(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xe9b(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Fork failure in pid %d\0A\00"
define i32 @forkchild() {
%1 = alloca i32
%2 = call i32 (...) @fork()
store i32 %2, i32* %1
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = call i32 (...) @getpid()
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Fork failure in pid %d\0A\00"
define i32 @forkchild() {
%1 = tail call i32 (...) @fork()
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 (...) @getpid()
%6 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
ret i32 %1
}
/* Type definitions */
struct timespec {
  unsigned long tv_sec;
  unsigned long tv_nsec;
};

/* Variables and functions */
scalar_t__ nanosleep(struct timespec *, struct timespec *);
extern void mt_safe_usleep(unsigned long usec) {
  struct timespec ts;
  ts.tv_sec = usec / 1000000;
  ts.tv_nsec = (usec % 1000000) * 1000;
  while (nanosleep(&ts, &ts) != 0)
    ;
}


x86 assembly (clang, -O0):
<mt_safe_usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %rcx
imul   $0x3e8,%rdx,%rax
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rsi
mov    %rsi,%rdi
call   1030 <nanosleep@plt>
cmp    $0x0,%rax
je     1162 <mt_safe_usleep+0x52>
jmp    1147 <mt_safe_usleep+0x37>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_safe_usleep>:
push   %rbx
sub    $0x10,%rsp
movabs $0x431bde82d7b634db,%rcx
de 1b 43
mov    %rdi,%rax
mul    %rcx
shr    $0x12,%rdx
mov    %rdx,(%rsp)
imul   $0xf4240,%rdx,%rax
sub    %rax,%rdi
imul   $0x3e8,%rdi,%rax
mov    %rax,0x8(%rsp)
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <nanosleep@plt>
test   %rax,%rax
jne    1150 <mt_safe_usleep+0x40>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @mt_safe_usleep(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timespec
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = udiv i64 %4, 1000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %5, i64* %6
%7 = load i64, i64* %2
%8 = urem i64 %7, 1000000
%9 = mul i64 %8, 1000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 %9, i64* %10
br label %11
11: ; preds = %14, %1
%12 = call i64 @nanosleep(%struct.timespec* %3, %struct.timespec* %3)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %11
br label %11
15: ; preds = %11
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @mt_safe_usleep(i64 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = udiv i64 %0, 1000000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %4, i64* %5
%6 = urem i64 %0, 1000000
%7 = mul nuw nsw i64 %6, 1000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 %7, i64* %8
br label %9
9: ; preds = %9, %1
%10 = call i64 @nanosleep(%struct.timespec* %2, %struct.timespec* %2)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %9
12: ; preds = %9
ret void
}
unsigned callee_deep_u(unsigned bla) { return callee_deep_u(bla + 1); }


x86 assembly (clang, -O0):
<callee_deep_u>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <callee_deep_u@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callee_deep_u>:
jmp    1100 <callee_deep_u>

LLVM IR (-O0):
define i32 @callee_deep_u(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 1
%5 = call i32 @callee_deep_u(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @callee_deep_u(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int sscanf(char *, char *, char **, char **);
int read_pair(char *line, char **key, char **value) {
  *key = *value = NULL;
  return sscanf(line, "%ms = %ms\n", key, value) - 2;
}


x86 assembly (clang, -O0):
<read_pair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeb3(%rip),%rsi
call   1030 <sscanf@plt>
sub    $0x2,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_pair>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
movq   $0x0,(%rcx)
movq   $0x0,(%rsi)
lea    0xed4(%rip),%rsi
call   1030 <sscanf@plt>
add    $0xfffffffe,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%ms = %ms\0A\00"
define i32 @read_pair(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %6
store i8* null, i8** %7
%8 = load i8**, i8*** %5
store i8* null, i8** %8
%9 = load i8*, i8** %4
%10 = load i8**, i8*** %5
%11 = load i8**, i8*** %6
%12 = call i32 @sscanf(i8* %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %10, i8** %11)
%13 = sub nsw i32 %12, 2
ret i32 %13
}

LLVM IR (-O2):
@.str = [11 x i8] c"%ms = %ms\0A\00"
define i32 @read_pair(i8* nocapture %0, i8** %1, i8** %2) {
store i8* null, i8** %2
store i8* null, i8** %1
%4 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %1, i8** %2)
%5 = add nsw i32 %4, -2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ mvaddstr(short, short, char const *);
int strlen(char const *);
void center(short row, const char *buf) {
  short margin;
  margin = ((80 - strlen(buf)) / 2);
  mvaddstr(row, margin, buf);
}


x86 assembly (clang, -O0):
<center>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0x50,%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %ax,-0x12(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x12(%rbp),%ax
mov    -0x10(%rbp),%rdx
movswl %cx,%edi
movswl %ax,%esi
call   1040 <mvaddstr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<center>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    $0x50,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
shr    %eax
movswl %ax,%esi
mov    %ebp,%edi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <mvaddstr@plt>

LLVM IR (-O0):
define void @center(i16 signext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
%5 = alloca i16
store i16 %0, i16* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
%8 = sub nsw i32 80, %7
%9 = sdiv i32 %8, 2
%10 = trunc i32 %9 to i16
store i16 %10, i16* %5
%11 = load i16, i16* %3
%12 = load i16, i16* %5
%13 = load i8*, i8** %4
%14 = call i32 @mvaddstr(i16 signext %11, i16 signext %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @center(i16 signext %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = sub nsw i32 80, %3
%5 = sdiv i32 %4, 2
%6 = trunc i32 %5 to i16
%7 = tail call i32 @mvaddstr(i16 signext %0, i16 signext %6, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int x = 10;
  int *pointer1, *pointer2;
  pointer1 = &x;
  printf("pointer1 value: %d\n", *pointer1);
  pointer2 = NULL;
  if (pointer2 == NULL)
    printf("%s", "NULL Pointer");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116a <main+0x5a>
lea    0xeb8(%rip),%rdi
lea    0xeb4(%rip),%rsi
mov    $0x0,%al
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    $0xa,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"pointer1 value: %d\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [13 x i8] c"NULL Pointer\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
store i32 0, i32* %1
store i32 10, i32* %2
store i32* %2, i32** %3
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %6)
store i32* null, i32** %4
%8 = load i32*, i32** %4
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"pointer1 value: %d\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [13 x i8] c"NULL Pointer\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ callrts(char *);
void convSint2doub(void) { callrts("float"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"float\00"
define void @convSint2doub() {
%1 = tail call i32 @callrts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_81uint8_reg(unsigned char val) {
  return ((val) & (0x81 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_81uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -127
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void vla_type_indirect(int x) {
  int(*p_vla)[x];
  void (*fp_vla)(int[x]);
}


x86 assembly (clang, -O0):
<vla_type_indirect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @vla_type_indirect(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca void (i32*)*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
ret void
}

LLVM IR (-O2):
define void @vla_type_indirect(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_unix_socket_is_stale() {
  printf("NOT IMPLEMENTED:"
         "pa_unix_socket_is_stale"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [40 x i8] c"NOT IMPLEMENTED:pa_unix_socket_is_stale\00"
define i32 @pa_unix_socket_is_stale() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void SampleFunction1() {}


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

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

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

LLVM IR (-O2):
define void @SampleFunction1() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int strlen(char *);
char *mk_concat_strings(char *s1, char *s2) {
  char *s = ((char *)malloc((1 + strlen(s1) + strlen(s2)) * sizeof(char)));
  sprintf(s, "%s%s", s1, s2);
  return s;
}


x86 assembly (clang, -O0):
<mk_concat_strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe7d(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_concat_strings>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1030 <strlen@plt>
mov    %eax,%r15d
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r15,%rax,1),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xe9c(%rip),%rsi
mov    %rax,%rdi
mov    %r12,%rdx
mov    %r14,%rcx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
define i8* @mk_concat_strings(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 1, %7
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 %8, %10
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 1
%14 = trunc i64 %13 to i32
%15 = call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %5
%17 = load i8*, i8** %5
%18 = load i8*, i8** %3
%19 = load i8*, i8** %4
%20 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %18, i8* %19)
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define i8* @mk_concat_strings(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 1
%5 = tail call i32 @strlen(i8* %1)
%6 = add nsw i32 %4, %5
%7 = tail call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %8, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int read(int, int *, int);
int /*<<< orphan*/ syserr(char *, int);
int readInt(int readDescriptor) {
  int *value = (int *)malloc(sizeof(int));
  if (read(readDescriptor, value, sizeof(int)) != sizeof(int)) {
    syserr("read from %d\n", readDescriptor);
  }
  int ret = *value;
  free(value);
  return ret;
}


x86 assembly (clang, -O0):
<readInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1050 <read@plt>
cltq
cmp    $0x4,%rax
je     1185 <readInt+0x45>
mov    -0x4(%rbp),%esi
lea    0xe80(%rip),%rdi
call   1040 <syserr@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInt>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x4,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %rax,%rsi
mov    $0x4,%edx
call   1050 <read@plt>
cmp    $0x4,%eax
je     1174 <readInt+0x34>
lea    0xe93(%rip),%rdi
mov    %ebp,%esi
call   1040 <syserr@plt>
mov    (%rbx),%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"read from %d\0A\00"
define i32 @readInt(i32 %0) {
%2 = tail call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
%4 = tail call i32 @read(i32 %0, i32* %3, i32 4)
%5 = icmp eq i32 %4, 4
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @syserr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %3
%10 = tail call i32 @free(i32* %3)
ret i32 %9
}