xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int btor_num_digits_util(int x) {
  int result;
  assert(x >= 0);
  result = 0;
  do {
    x /= 10;
    result++;
  } while (x > 0);
  return result;
}


x86 assembly (clang, -O0):
<btor_num_digits_util>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1133 <btor_num_digits_util+0x23>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btor_num_digits_util>:
push   %rbx
mov    %edi,%ebx
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
xor    %eax,%eax
nop
movslq %ebx,%rcx
imul   $0x66666667,%rcx,%rbx
mov    %rbx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rbx
add    %edx,%ebx
add    $0x1,%eax
cmp    $0x9,%ecx
jg     1120 <btor_num_digits_util+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @btor_num_digits_util(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
br label %5
5: ; preds = %5, %1
%6 = phi i32 [ %0, %1 ], [ %8, %5 ]
%7 = phi i32 [ 0, %1 ], [ %9, %5 ]
%8 = sdiv i32 %6, 10
%9 = add nuw nsw i32 %7, 1
%10 = icmp sgt i32 %6, 9
br i1 %10, label %5, label %11
11: ; preds = %5
ret i32 %9
}
/* Variables and functions */
scalar_t__ floor(float);
float uniform();
int r0n(int n) { return (int)floor((float)n * uniform()); }


x86 assembly (clang, -O0):
<r0n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <uniform@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
mulss  %xmm1,%xmm0
call   1040 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r0n>:
push   %rax
cvtsi2ss %edi,%xmm0
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <uniform@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
jmp    1040 <floor@plt>

LLVM IR (-O0):
define i32 @r0n(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to float
%5 = call float (...) @uniform()
%6 = fmul float %4, %5
%7 = call i64 @floor(float %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @r0n(i32 %0) {
%2 = sitofp i32 %0 to float
%3 = tail call float (...) @uniform()
%4 = fmul float %3, %2
%5 = tail call i64 @floor(float %4)
%6 = trunc i64 %5 to i32
ret i32 %6
}
void initxlist() {
  extern char *sndexcept[], *rcvexcept[];
  int i;
  for (i = 0; i < 64; i++) {
    sndexcept[i] = 0L;
    rcvexcept[i] = 0L;
  }
}


x86 assembly (clang, -O0):
<initxlist>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jge    1149 <initxlist+0x49>
movslq -0x4(%rbp),%rcx
mov    0x2ed0(%rip),%rax
movq   $0x0,(%rax,%rcx,8)
movslq -0x4(%rbp),%rcx
mov    0x2ec5(%rip),%rax
movq   $0x0,(%rax,%rcx,8)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <initxlist+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initxlist>:
push   %rax
mov    0x2ed8(%rip),%rdi
mov    $0x200,%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    0x2ecd(%rip),%rdi
mov    $0x200,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

LLVM IR (-O0):
@sndexcept = external global [0 x i8*]
@rcvexcept = external global [0 x i8*]
define void @initxlist() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %12, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 64
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = load i32, i32* %1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sndexcept, i64 0, i64 %7
store i8* null, i8** %8
%9 = load i32, i32* %1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [0 x i8*], [0 x i8*]* @rcvexcept, i64 0, i64 %10
store i8* null, i8** %11
br label %12
12: ; preds = %5
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %2
15: ; preds = %2
ret void
}

LLVM IR (-O2):
@sndexcept = external global [0 x i8*]
@rcvexcept = external global [0 x i8*]
define void @initxlist() {
ret void
}
void writeLog() {}


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

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

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

LLVM IR (-O2):
define void @writeLog() {
ret void
}
/* Variables and functions */
char *mempcpy(char *, char const *, scalar_t__);
scalar_t__ strlen(char const *);
char *stpcpy(char *restrict whither, const char *restrict whence) {
  return mempcpy(whither, whence, strlen(whence) + 1) - 1;
}


x86 assembly (clang, -O0):
<stpcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stpcpy>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <memcpy@plt>
add    %r15,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @stpcpy(i8* noalias %0, i8* noalias %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i8* @mempcpy(i8* %5, i8* %6, i64 %9)
%11 = getelementptr inbounds i8, i8* %10, i64 -1
ret i8* %11
}

LLVM IR (-O2):
define i8* @stpcpy(i8* noalias writeonly %0, i8* noalias nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %4, i1 false)
%5 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %5
}
void RTAvllU32Destroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvllU32Destroy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ IPPROTO_ICMP;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  int sock;
  sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_ICMP);
  if (sock < 0) {
    printf("error:%d\n", sock);
    perror("create sock failed..");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
mov    0x2e80(%rip),%rax
mov    (%rax),%edx
call   1050 <socket@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1187 <main+0x57>
mov    -0x8(%rbp),%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
lea    0xe88(%rip),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    0x2e8e(%rip),%rax
mov    (%rax),%edx
call   1050 <socket@plt>
test   %eax,%eax
js     1159 <main+0x29>
xor    %eax,%eax
pop    %rcx
ret
lea    0xea0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xe9c(%rip),%rdi
call   1040 <perror@plt>
jmp    1155 <main+0x25>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@IPPROTO_ICMP = global i32 0
@.str = [10 x i8] c"error:%d\0A\00"
@.str.1 = [21 x i8] c"create sock failed..\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @AF_INET
%4 = load i32, i32* @SOCK_DGRAM
%5 = load i32, i32* @IPPROTO_ICMP
%6 = call i32 @socket(i32 %3, i32 %4, i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %9, %0
ret i32 0
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@IPPROTO_ICMP = global i32 0
@.str = [10 x i8] c"error:%d\0A\00"
@.str.1 = [21 x i8] c"create sock failed..\00"
define i32 @main() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_DGRAM
%3 = load i32, i32* @IPPROTO_ICMP
%4 = tail call i32 @socket(i32 %1, i32 %2, i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
%8 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_function();
int main() {
  test_function();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_function@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_function()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_function()
ret i32 0
}
int dpll_cascading_blocker_release(struct device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define i32 @dpll_cascading_blocker_release(%struct.device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void add_reg64_reg64(unsigned int reg1, unsigned int reg2) {
  put8(0x48);
  put8(0x01);
  put8(0xC0 | (reg2 << 3) | reg1);
}


x86 assembly (clang, -O0):
<add_reg64_reg64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0x1,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x4(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_reg64_reg64>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0x1,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @add_reg64_reg64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 72)
%6 = call i32 @put8(i32 1)
%7 = load i32, i32* %4
%8 = shl i32 %7, 3
%9 = or i32 192, %8
%10 = load i32, i32* %3
%11 = or i32 %9, %10
%12 = call i32 @put8(i32 %11)
ret void
}

LLVM IR (-O2):
define void @add_reg64_reg64(i32 %0, i32 %1) {
%3 = tail call i32 @put8(i32 72)
%4 = tail call i32 @put8(i32 1)
%5 = shl i32 %1, 3
%6 = or i32 %5, %0
%7 = or i32 %6, 192
%8 = tail call i32 @put8(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
long foo(short *);
int main() {
  short a = 0xff00;
  if (foo(&a) != (long)(short)0xff00)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0xff00,-0x6(%rbp)
lea    -0x6(%rbp),%rdi
call   1040 <foo@plt>
cmp    $0xffffffffffffff00,%rax
je     1161 <main+0x31>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0xff00,0x6(%rsp)
lea    0x6(%rsp),%rdi
call   1040 <foo@plt>
cmp    $0xffffffffffffff00,%rax
jne    1151 <main+0x21>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
store i32 0, i32* %1
store i16 -256, i16* %2
%3 = call i64 @foo(i16* %2)
%4 = icmp ne i64 %3, -256
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
store i16 -256, i16* %1
%3 = call i64 @foo(i16* %1)
%4 = icmp eq i64 %3, -256
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = call i32 @exit(i32 0)
unreachable
}
void quota_mbcs_free(char *zOld) {}


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

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

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

LLVM IR (-O2):
define void @quota_mbcs_free(i8* nocapture %0) {
ret void
}
void _M2_bounce3_finish(__attribute__((unused)) int argc,
                        __attribute__((unused)) char *argv[]) {}


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

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

LLVM IR (-O0):
define void @_M2_bounce3_finish(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret void
}

LLVM IR (-O2):
define void @_M2_bounce3_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void jbe_rj(unsigned char saut) {
  put8(0x76);
  put8(saut);
}


x86 assembly (clang, -O0):
<jbe_rj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x76,%edi
call   1030 <put8@plt>
movzbl -0x1(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jbe_rj>:
push   %rbx
mov    %edi,%ebx
mov    $0x76,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @jbe_rj(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @put8(i8 zeroext 118)
%4 = load i8, i8* %2
%5 = call i32 @put8(i8 zeroext %4)
ret void
}

LLVM IR (-O2):
define void @jbe_rj(i8 zeroext %0) {
%2 = tail call i32 @put8(i8 zeroext 118)
%3 = tail call i32 @put8(i8 zeroext %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void be32enc(void *pp, uint32_t u) {
  uint8_t *p = (uint8_t *)pp;
  p[0] = (u >> 24) & 0xff;
  p[1] = (u >> 16) & 0xff;
  p[2] = (u >> 8) & 0xff;
  p[3] = u & 0xff;
}


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

x86 assembly (clang, -O2):
<be32enc>:
mov    %esi,%eax
mov    %esi,%ecx
movzbl %ah,%edx
movzbl %al,%esi
shr    $0x18,%eax
mov    %eax,(%rdi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x4(%rdi)
mov    %edx,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @be32enc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = ashr i32 %8, 24
%10 = and i32 %9, 255
%11 = load i32*, i32** %5
%12 = getelementptr inbounds i32, i32* %11, i64 0
store i32 %10, i32* %12
%13 = load i32, i32* %4
%14 = ashr i32 %13, 16
%15 = and i32 %14, 255
%16 = load i32*, i32** %5
%17 = getelementptr inbounds i32, i32* %16, i64 1
store i32 %15, i32* %17
%18 = load i32, i32* %4
%19 = ashr i32 %18, 8
%20 = and i32 %19, 255
%21 = load i32*, i32** %5
%22 = getelementptr inbounds i32, i32* %21, i64 2
store i32 %20, i32* %22
%23 = load i32, i32* %4
%24 = and i32 %23, 255
%25 = load i32*, i32** %5
%26 = getelementptr inbounds i32, i32* %25, i64 3
store i32 %24, i32* %26
ret void
}

LLVM IR (-O2):
define void @be32enc(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = lshr i32 %1, 24
store i32 %4, i32* %3
%5 = lshr i32 %1, 16
%6 = and i32 %5, 255
%7 = getelementptr inbounds i8, i8* %0, i64 4
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
%9 = lshr i32 %1, 8
%10 = and i32 %9, 255
%11 = getelementptr inbounds i8, i8* %0, i64 8
%12 = bitcast i8* %11 to i32*
store i32 %10, i32* %12
%13 = and i32 %1, 255
%14 = getelementptr inbounds i8, i8* %0, i64 12
%15 = bitcast i8* %14 to i32*
store i32 %13, i32* %15
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_176() {
  Assert_real((isqrt(176) == 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",
              885, ("Integer square root of 176 should be 13"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_176>:
push   %rax
mov    $0xb0,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xd,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x375,%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 176 should be 13\00"
define void @t_sqrt_176() {
%1 = call i32 @isqrt(i32 176)
%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 885, 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 176 should be 13\00"
define void @t_sqrt_176() {
%1 = tail call i32 @isqrt(i32 176)
%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 885, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
void genBlockFileName(char *sender, char *filename) {
  sprintf(filename, "%s.dat", sender);
}


x86 assembly (clang, -O0):
<genBlockFileName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genBlockFileName>:
mov    %rsi,%rax
mov    %rdi,%rdx
lea    0xee3(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s.dat\00"
define void @genBlockFileName(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s.dat\00"
define void @genBlockFileName(i8* %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct ipr_ses_config_pg {
  int dummy;
};

/* Variables and functions */
int ipr_elem_offset(struct ipr_ses_config_pg *, int);
int ipr_esm_elem_offset(struct ipr_ses_config_pg *ses_cfg) {
  return ipr_elem_offset(ses_cfg, 0x07);
}


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

x86 assembly (clang, -O2):
<ipr_esm_elem_offset>:
mov    $0x7,%esi
jmp    1030 <ipr_elem_offset@plt>

LLVM IR (-O0):
%struct.ipr_ses_config_pg = type { i32 }
define i32 @ipr_esm_elem_offset(%struct.ipr_ses_config_pg* %0) {
%2 = alloca %struct.ipr_ses_config_pg*
store %struct.ipr_ses_config_pg* %0, %struct.ipr_ses_config_pg** %2
%3 = load %struct.ipr_ses_config_pg*, %struct.ipr_ses_config_pg** %2
%4 = call i32 @ipr_elem_offset(%struct.ipr_ses_config_pg* %3, i32 7)
ret i32 %4
}

LLVM IR (-O2):
%struct.ipr_ses_config_pg = type { i32 }
define i32 @ipr_esm_elem_offset(%struct.ipr_ses_config_pg* %0) {
%2 = tail call i32 @ipr_elem_offset(%struct.ipr_ses_config_pg* %0, i32 7)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void method__(int *i) { printf("-DFORTRAN_DOUBLE_TRAILINGBAR"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"-DFORTRAN_DOUBLE_TRAILINGBAR\00"
define void @method__(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"-DFORTRAN_DOUBLE_TRAILINGBAR\00"
define void @method__(i32* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
void fmt_oct3(char *dest, unsigned char w) {
  dest[2] = (char)((w & 7) + '0');
  w >>= 3;
  dest[1] = (char)((w & 7) + '0');
  w >>= 3;
  dest[0] = (char)((w & 7) + '0');
}


x86 assembly (clang, -O0):
<fmt_oct3>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
and    $0x7,%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
movzbl -0x9(%rbp),%eax
sar    $0x3,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
and    $0x7,%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
movzbl -0x9(%rbp),%eax
sar    $0x3,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
and    $0x7,%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_oct3>:
mov    %esi,%eax
and    $0x7,%al
or     $0x30,%al
mov    %al,0x2(%rdi)
mov    %esi,%eax
shr    $0x3,%al
and    $0x7,%al
or     $0x30,%al
mov    %al,0x1(%rdi)
shr    $0x6,%sil
or     $0x30,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @fmt_oct3(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 7
%8 = add nsw i32 %7, 48
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 2
store i8 %9, i8* %11
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = ashr i32 %13, 3
%15 = trunc i32 %14 to i8
store i8 %15, i8* %4
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = and i32 %17, 7
%19 = add nsw i32 %18, 48
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 %20, i8* %22
%23 = load i8, i8* %4
%24 = zext i8 %23 to i32
%25 = ashr i32 %24, 3
%26 = trunc i32 %25 to i8
store i8 %26, i8* %4
%27 = load i8, i8* %4
%28 = zext i8 %27 to i32
%29 = and i32 %28, 7
%30 = add nsw i32 %29, 48
%31 = trunc i32 %30 to i8
%32 = load i8*, i8** %3
%33 = getelementptr inbounds i8, i8* %32, i64 0
store i8 %31, i8* %33
ret void
}

LLVM IR (-O2):
define void @fmt_oct3(i8* nocapture writeonly %0, i8 zeroext %1) {
%3 = and i8 %1, 7
%4 = or i8 %3, 48
%5 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %4, i8* %5
%6 = lshr i8 %1, 3
%7 = and i8 %6, 7
%8 = or i8 %7, 48
%9 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %8, i8* %9
%10 = lshr i8 %1, 6
%11 = or i8 %10, 48
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
void *_malloc(int);
void *malloc(int bytes) { return _malloc(bytes); }


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

x86 assembly (clang, -O2):
<malloc>:
jmp    1030 <_malloc@plt>

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

LLVM IR (-O2):
define i8* @malloc(i32 %0) {
%2 = tail call i8* @_malloc(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ GetProcessHeap();
int /*<<< orphan*/ HeapFree(int /*<<< orphan*/, int /*<<< orphan*/, void *);
void MemFree(void *Pointer) {
  if (0 != Pointer)
    HeapFree(GetProcessHeap(), 0, Pointer);
}


x86 assembly (clang, -O0):
<MemFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     114c <MemFree+0x2c>
mov    $0x0,%al
call   1040 <GetProcessHeap@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <HeapFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MemFree>:
test   %rdi,%rdi
je     113d <MemFree+0x1d>
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <GetProcessHeap@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <HeapFree@plt>
ret

LLVM IR (-O0):
define void @MemFree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* null, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 (...) @GetProcessHeap()
%7 = load i8*, i8** %2
%8 = call i32 @HeapFree(i32 %6, i32 0, i8* %7)
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @MemFree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 (...) @GetProcessHeap()
%5 = tail call i32 @HeapFree(i32 %4, i32 0, i8* %0)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
unsigned long paravirt_read_msr(int, int *);
__attribute__((always_)) unsigned long get_debugctlmsr(void) {
  unsigned long debugctlmsr = 0;
  do {
    int _err;
    debugctlmsr = paravirt_read_msr(0x000001d9, &_err);
  } while (0);
  return debugctlmsr;
}


x86 assembly (clang, -O0):
<get_debugctlmsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x1d9,%edi
lea    -0xc(%rbp),%rsi
call   1030 <paravirt_read_msr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_debugctlmsr>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0x1d9,%edi
call   1030 <paravirt_read_msr@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @get_debugctlmsr() {
%1 = alloca i64
%2 = alloca i32
store i64 0, i64* %1
br label %3
3: ; preds = %0
%4 = call i64 @paravirt_read_msr(i32 473, i32* %2)
store i64 %4, i64* %1
br label %5
5: ; preds = %3
%6 = load i64, i64* %1
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_debugctlmsr() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @paravirt_read_msr(i32 473, i32* %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ reset_svg_box();
void Reset_SVG_Box() { reset_svg_box(); }


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

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

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

LLVM IR (-O2):
define void @Reset_SVG_Box() {
%1 = tail call i32 (...) @reset_svg_box()
ret void
}
/* Variables and functions */
int strlen(char *);
void Strip_newline(char *string) {
  string[strlen(string) - 1] = '\0';
  return;
}


x86 assembly (clang, -O0):
<Strip_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strip_newline>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @Strip_newline(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
store i8 0, i8* %8
ret void
}

LLVM IR (-O2):
define void @Strip_newline(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ printf(char *);
int main() {
  for (int i = 0; i < 50000; i++)
    foo();
#pragma xmp task on p(1)
  { printf("PASS\n"); }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xc350,-0x8(%rbp)
jge    1158 <main+0x38>
mov    $0x0,%al
call   1040 <foo@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xc350,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <foo@plt>
add    $0xffffffff,%ebx
jne    1130 <main+0x10>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [5 x i8] c"PASS\00"
define i32 @main() {
br label %3
1: ; preds = %3
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %6, %3 ]
%5 = tail call i32 (...) @foo()
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 50000
br i1 %7, label %1, label %3
}
/* Variables and functions */
char *last_dir_separator(const char *filename) {
  const char *p, *ret = NULL;
  for (p = (filename); *p; p++)
    if (((*p) == '/'))
      ret = p;
  return (char *)ret;
}


x86 assembly (clang, -O0):
<last_dir_separator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <last_dir_separator+0x53>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    113d <last_dir_separator+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1142 <last_dir_separator+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <last_dir_separator+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_dir_separator>:
xor    %eax,%eax
jmp    1117 <last_dir_separator+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rdi,%rax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x2f,%cl
je     1110 <last_dir_separator+0x10>
test   %cl,%cl
jne    1113 <last_dir_separator+0x13>
ret

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

LLVM IR (-O2):
define i8* @last_dir_separator(i8* %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %0, %1 ], [ %9, %7 ]
%4 = phi i8* [ null, %1 ], [ %8, %7 ]
%5 = load i8, i8* %3
switch i8 %5, label %7 [
i8 0, label %10
i8 47, label %6
]
6: ; preds = %2
br label %7
7: ; preds = %2, %6
%8 = phi i8* [ %3, %6 ], [ %4, %2 ]
%9 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
10: ; preds = %2
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ gmtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, size_t, char *, int /*<<< orphan*/);
void mmp_time_1036_format(time_t t, char *datestr, size_t strsize) {
  if (datestr == NULL || strsize == 0)
    return;
  strftime(datestr, strsize, "%A, %d-%b-%y %H:%M:%S GMT", gmtime(&t));
}


x86 assembly (clang, -O0):
<mmp_time_1036_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1149 <mmp_time_1036_format+0x29>
cmpq   $0x0,-0x18(%rbp)
jne    114e <mmp_time_1036_format+0x2e>
jmp    117d <mmp_time_1036_format+0x5d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x4(%rbp),%rdi
call   1040 <gmtime@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%ecx
lea    0xe88(%rip),%rdx
call   1030 <strftime@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmp_time_1036_format>:
push   %r14
push   %rbx
push   %rax
mov    %edi,0x4(%rsp)
test   %rsi,%rsi
je     1156 <mmp_time_1036_format+0x36>
mov    %rdx,%r14
test   %rdx,%rdx
je     1156 <mmp_time_1036_format+0x36>
mov    %rsi,%rbx
lea    0x4(%rsp),%rdi
call   1040 <gmtime@plt>
lea    0xeb7(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%ecx
call   1030 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [26 x i8] c"%A, %d-%b-%y %H:%M:%S GMT\00"
define void @mmp_time_1036_format(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 i8*, i8** %5
%8 = icmp eq i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = load i64, i64* %6
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9, %3
br label %18
13: ; preds = %9
%14 = load i8*, i8** %5
%15 = load i64, i64* %6
%16 = call i32 @gmtime(i32* %4)
%17 = call i32 @strftime(i8* %14, i64 %15, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %13, %12
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"%A, %d-%b-%y %H:%M:%S GMT\00"
define void @mmp_time_1036_format(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
store i32 %0, i32* %4
%5 = icmp eq i8* %1, null
%6 = icmp eq i64 %2, 0
%7 = or i1 %5, %6
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = call i32 @gmtime(i32* %4)
%10 = call i32 @strftime(i8* %1, i64 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %3, %8
ret void
}
int intel_cleanup_io(void) {}


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

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

LLVM IR (-O0):
define i32 @intel_cleanup_io() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @intel_cleanup_io() {
ret i32 undef
}
unsigned unsigned_high_prod(unsigned x, unsigned y) {
  int w = sizeof(int) << 3;
  unsigned long long prod = ((unsigned long long)x) * ((unsigned long long)y);
  return (unsigned)(prod >> w);
}


x86 assembly (clang, -O0):
<unsigned_high_prod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_high_prod>:
mov    %edi,%ecx
mov    %esi,%eax
imul   %rcx,%rax
shr    $0x20,%rax
ret

LLVM IR (-O0):
define i32 @unsigned_high_prod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 32, i32* %5
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %6
%12 = load i64, i64* %6
%13 = load i32, i32* %5
%14 = zext i32 %13 to i64
%15 = lshr i64 %12, %14
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @unsigned_high_prod(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = zext i32 %1 to i64
%5 = mul nuw i64 %4, %3
%6 = lshr i64 %5, 32
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int musbgm_getpos(int);
int mus_bgm_getpos(int no) { return musbgm_getpos(no); }


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

x86 assembly (clang, -O2):
<mus_bgm_getpos>:
jmp    1030 <musbgm_getpos@plt>

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

LLVM IR (-O2):
define i32 @mus_bgm_getpos(i32 %0) {
%2 = tail call i32 @musbgm_getpos(i32 %0)
ret i32 %2
}
extern void outsl(unsigned short port, const void *addr, unsigned long count) {
  __asm__ __volatile__("rep ; outs"
                       "l"
                       : "=S"(addr), "=c"(count)
                       : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<outsl>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
rep outsl %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsl>:
mov    %rdx,%rcx
mov    %edi,%edx
rep outsl %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsl(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call { i8*, i64 } asm sideeffect "rep ; outsl", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %7, i8* %8, i64 %9)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @outsl(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep ; outsl", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
void func_p(char *i __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @func_p(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
void *hello(void *arg) { printf("Hello Thread : %lu\n", pthread_self()); }


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Hello Thread : %lu\0A\00"
define i8* @hello(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @pthread_self()
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
@.str = [20 x i8] c"Hello Thread : %lu\0A\00"
define noalias i8* @hello(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i8* undef
}
/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("1");
  if (fork() > 0) {
    printf("2");
    printf("3");
  } else {
    printf("4");
    printf("5");
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <fork@plt>
cmp    $0x0,%rax
jle    1169 <main+0x49>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    1181 <main+0x61>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x31,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <fork@plt>
xor    %ecx,%ecx
test   %rax,%rax
setle  %cl
lea    (%rcx,%rcx,1),%edi
add    $0x32,%edi
lea    (%rcx,%rcx,1),%ebx
add    $0x33,%ebx
call   1030 <putchar@plt>
mov    %ebx,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 49)
%2 = tail call i64 (...) @fork()
%3 = icmp sgt i64 %2, 0
%4 = select i1 %3, i32 50, i32 52
%5 = select i1 %3, i32 51, i32 53
%6 = tail call i32 @putchar(i32 %4)
%7 = tail call i32 @putchar(i32 %5)
%8 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long long);
void pll(unsigned long long x) { printf("%llx\n", x); }


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

x86 assembly (clang, -O2):
<pll>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%llx\0A\00"
define void @pll(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
int main() { return 25 * 7; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0xaf,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 175
}

LLVM IR (-O2):
define i32 @main() {
ret i32 175
}