xunge/DecIR huggingface dataset:
int datetime_is_between(int x, int a, int b) {
  if (a <= b)
    return a <= x && x <= b;
  else
    return b <= x && x <= a;
}


x86 assembly (clang, -O0):
<datetime_is_between>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1146 <datetime_is_between+0x46>
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x11(%rbp)
jg     1136 <datetime_is_between+0x36>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    116e <datetime_is_between+0x6e>
mov    -0x10(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x12(%rbp)
jg     1163 <datetime_is_between+0x63>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<datetime_is_between>:
xor    %r9d,%r9d
cmp    %edi,%edx
setle  %r9b
xor    %r8d,%r8d
xor    %ecx,%ecx
cmp    %esi,%edi
setle  %r8b
setge  %cl
xor    %eax,%eax
cmp    %edx,%edi
setle  %al
cmp    %edx,%esi
cmovg  %r9d,%eax
cmovg  %r8d,%ecx
and    %eax,%ecx
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @datetime_is_between(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = load i32, i32* %7
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %3
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i32, i32* %5
%17 = load i32, i32* %7
%18 = icmp sle i32 %16, %17
br label %19
19: ; preds = %15, %11
%20 = phi i1 [ false, %11 ], [ %18, %15 ]
%21 = zext i1 %20 to i32
store i32 %21, i32* %4
br label %33
22: ; preds = %3
%23 = load i32, i32* %7
%24 = load i32, i32* %5
%25 = icmp sle i32 %23, %24
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load i32, i32* %5
%28 = load i32, i32* %6
%29 = icmp sle i32 %27, %28
br label %30
30: ; preds = %26, %22
%31 = phi i1 [ false, %22 ], [ %29, %26 ]
%32 = zext i1 %31 to i32
store i32 %32, i32* %4
br label %33
33: ; preds = %30, %19
%34 = load i32, i32* %4
ret i32 %34
}

LLVM IR (-O2):
define i32 @datetime_is_between(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %2
%5 = icmp sle i32 %2, %0
%6 = icmp sle i32 %0, %1
%7 = icmp sle i32 %1, %0
%8 = icmp sle i32 %0, %2
%9 = select i1 %4, i1 %5, i1 %8
%10 = select i1 %4, i1 %6, i1 %7
%11 = and i1 %10, %9
%12 = zext i1 %11 to i32
ret i32 %12
}
void ABGRToAR30() {}


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

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

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

LLVM IR (-O2):
define void @ABGRToAR30() {
ret void
}
/* Variables and functions */
void *ho_memchr(const void *s, int c, size_t n) {
  unsigned char *p = (unsigned char *)s;
  for (; n-- > 0; ++p) {
    if (*p == c)
      return (void *)p;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<ho_memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
cmp    $0x0,%rax
jbe    1163 <ho_memchr+0x63>
mov    -0x28(%rbp),%rax
movzbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    114d <ho_memchr+0x4d>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116b <ho_memchr+0x6b>
jmp    1152 <ho_memchr+0x52>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1117 <ho_memchr+0x17>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ho_memchr>:
test   %rdx,%rdx
je     1124 <ho_memchr+0x24>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
movzbl (%rax),%ecx
cmp    %esi,%ecx
je     1126 <ho_memchr+0x26>
add    $0xffffffffffffffff,%rdx
add    $0x1,%rax
test   %rdx,%rdx
jne    1110 <ho_memchr+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @ho_memchr(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i64 %2, i64* %7
%9 = load i8*, i8** %5
store i8* %9, i8** %8
br label %10
10: ; preds = %23, %3
%11 = load i64, i64* %7
%12 = add i64 %11, -1
store i64 %12, i64* %7
%13 = icmp ugt i64 %11, 0
br i1 %13, label %14, label %26
14: ; preds = %10
%15 = load i8*, i8** %8
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i32, i32* %6
%19 = icmp eq i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %14
%21 = load i8*, i8** %8
store i8* %21, i8** %4
br label %27
22: ; preds = %14
br label %23
23: ; preds = %22
%24 = load i8*, i8** %8
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %8
br label %10
26: ; preds = %10
store i8* null, i8** %4
br label %27
27: ; preds = %26, %20
%28 = load i8*, i8** %4
ret i8* %28
}

LLVM IR (-O2):
define i8* @ho_memchr(i8* %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %15, label %5
5: ; preds = %3, %12
%6 = phi i64 [ %8, %12 ], [ %2, %3 ]
%7 = phi i8* [ %13, %12 ], [ %0, %3 ]
%8 = add i64 %6, -1
%9 = load i8, i8* %7
%10 = zext i8 %9 to i32
%11 = icmp eq i32 %10, %1
br i1 %11, label %15, label %12
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = icmp eq i64 %8, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %12, %3
%16 = phi i8* [ null, %3 ], [ null, %12 ], [ %7, %5 ]
ret i8* %16
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ hq3x_32_rb(int *, int, int *, int, int, int);
void hq3x_32(uint32_t *sp, uint32_t *dp, int Xres, int Yres) {
  uint32_t rowBytesL = Xres * 4;
  hq3x_32_rb(sp, rowBytesL, dp, rowBytesL * 3, Xres, Yres);
}


x86 assembly (clang, -O0):
<hq3x_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rdx
imul   $0x3,-0x1c(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
call   1030 <hq3x_32_rb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hq3x_32>:
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %rsi,%rdx
lea    0x0(,%r8,4),%esi
lea    (%rsi,%rsi,2),%ecx
jmp    1030 <hq3x_32_rb@plt>

LLVM IR (-O0):
define void @hq3x_32(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %7
%11 = mul nsw i32 %10, 4
store i32 %11, i32* %9
%12 = load i32*, i32** %5
%13 = load i32, i32* %9
%14 = load i32*, i32** %6
%15 = load i32, i32* %9
%16 = mul nsw i32 %15, 3
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = call i32 @hq3x_32_rb(i32* %12, i32 %13, i32* %14, i32 %16, i32 %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @hq3x_32(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = shl nsw i32 %2, 2
%6 = mul nsw i32 %2, 12
%7 = tail call i32 @hq3x_32_rb(i32* %0, i32 %5, i32* %1, i32 %6, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BinaryenSetAPITracing(int);
int /*<<< orphan*/ test_core();
int /*<<< orphan*/ test_relooper();
void test_tracing() {
  BinaryenSetAPITracing(1);
  test_core();
  test_relooper();
  BinaryenSetAPITracing(0);
}


x86 assembly (clang, -O0):
<test_tracing>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <BinaryenSetAPITracing@plt>
mov    $0x0,%al
call   1030 <test_core@plt>
mov    $0x0,%al
call   1050 <test_relooper@plt>
xor    %edi,%edi
call   1040 <BinaryenSetAPITracing@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_tracing>:
push   %rax
mov    $0x1,%edi
call   1040 <BinaryenSetAPITracing@plt>
xor    %eax,%eax
call   1030 <test_core@plt>
xor    %eax,%eax
call   1050 <test_relooper@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <BinaryenSetAPITracing@plt>

LLVM IR (-O0):
define void @test_tracing() {
%1 = call i32 @BinaryenSetAPITracing(i32 1)
%2 = call i32 (...) @test_core()
%3 = call i32 (...) @test_relooper()
%4 = call i32 @BinaryenSetAPITracing(i32 0)
ret void
}

LLVM IR (-O2):
define void @test_tracing() {
%1 = tail call i32 @BinaryenSetAPITracing(i32 1)
%2 = tail call i32 (...) @test_core()
%3 = tail call i32 (...) @test_relooper()
%4 = tail call i32 @BinaryenSetAPITracing(i32 0)
ret void
}
void av_encryption_info_clone() {}


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

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

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

LLVM IR (-O2):
define void @av_encryption_info_clone() {
ret void
}
int test_imm_40int32_reg(int val) { return ((val) & (0x40 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_40int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x40,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_40int32_reg(i32 %0) {
%2 = and i32 %0, 64
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned long is_tag_ape2long(unsigned char *p) {
  return (((unsigned long)p[0] << 0) | ((unsigned long)p[1] << 8) |
          ((unsigned long)p[2] << 16) | ((unsigned long)p[3] << 24));
}


x86 assembly (clang, -O0):
<is_tag_ape2long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x0,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_tag_ape2long>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i64 @is_tag_ape2long(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl nuw nsw i64 %6, 8
%8 = or i64 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl nuw nsw i64 %11, 16
%13 = or i64 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = shl nuw nsw i64 %16, 24
%18 = or i64 %13, %17
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sigintr_handler(int signum) { exit(0); }


x86 assembly (clang, -O0):
<sigintr_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sigintr_handler>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sigintr_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sigintr_handler(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
long CG_im21(i)
long i;
{
  return (((i & 0x100000) >> 20) | ((i & 0x0ffe00) >> 8) |
          ((i & 0x000180) << 7) | ((i & 0x00007c) << 14) |
          ((i & 0x000003) << 12));
}


x86 assembly (clang, -O0):
<CG_im21>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x100000,%rax
sar    $0x14,%rax
mov    -0x8(%rbp),%rcx
and    $0xffe00,%rcx
sar    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
and    $0x180,%rcx
shl    $0x7,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
and    $0x7c,%rcx
shl    $0xe,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
and    $0x3,%rcx
shl    $0xc,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_im21>:
mov    %rdi,%rax
mov    %eax,%ecx
shr    $0x14,%ecx
and    $0x1,%ecx
mov    %rdi,%rdx
shr    $0x8,%rdx
and    $0xffe,%edx
or     %rdx,%rcx
mov    %eax,%edx
shl    $0x7,%edx
and    $0xc000,%edx
or     %rcx,%rdx
mov    %eax,%ecx
and    $0x7c,%ecx
shl    $0xe,%rcx
or     %rdx,%rcx
and    $0x3,%eax
shl    $0xc,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @CG_im21(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 1048576
%5 = ashr i64 %4, 20
%6 = load i64, i64* %2
%7 = and i64 %6, 1048064
%8 = ashr i64 %7, 8
%9 = or i64 %5, %8
%10 = load i64, i64* %2
%11 = and i64 %10, 384
%12 = shl i64 %11, 7
%13 = or i64 %9, %12
%14 = load i64, i64* %2
%15 = and i64 %14, 124
%16 = shl i64 %15, 14
%17 = or i64 %13, %16
%18 = load i64, i64* %2
%19 = and i64 %18, 3
%20 = shl i64 %19, 12
%21 = or i64 %17, %20
ret i64 %21
}

LLVM IR (-O2):
define i64 @CG_im21(i64 %0) {
%2 = lshr i64 %0, 20
%3 = and i64 %2, 1
%4 = lshr i64 %0, 8
%5 = and i64 %4, 4094
%6 = or i64 %3, %5
%7 = shl i64 %0, 7
%8 = and i64 %7, 49152
%9 = or i64 %6, %8
%10 = shl i64 %0, 14
%11 = and i64 %10, 2031616
%12 = or i64 %9, %11
%13 = shl i64 %0, 12
%14 = and i64 %13, 12288
%15 = or i64 %12, %14
ret i64 %15
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ time(int /*<<< orphan*/ *);
int main(void) {
  time_t t;
  t = time(NULL);
  printf("first time() called = %i\n", (int)t);
  t = time(NULL);
  printf("second time() called = %i\n", (int)t);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <time@plt>
lea    0xed6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"first time() called = %i\0A\00"
@.str.1 = [27 x i8] c"second time() called = %i\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 @time(i32* null)
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i64 @time(i32* null)
store i64 %7, i64* %2
%8 = load i64, i64* %2
%9 = trunc i64 %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
@.str = [26 x i8] c"first time() called = %i\0A\00"
@.str.1 = [27 x i8] c"second time() called = %i\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i64 @time(i32* null)
%5 = trunc i64 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
void emit_type_definition_nat16(
    struct processor_explicatory_state *process_state,
    struct modern_stream *stream, void *stream_state,
    struct modern_vfile *vfile, void *vfile_state) {}


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

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

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

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_type_definition_nat16(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
void scenario_logic(void) {}


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

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

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

LLVM IR (-O2):
define void @scenario_logic() {
ret void
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t getms(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (uint64_t)tv.tv_sec * 1000 + tv.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<getms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0x3e8,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getms>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%ecx
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @getms() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @getms() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %7, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x59() {
  Assert_real((isalpha(89)),
              "/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/ctype/test_isalpha.c",
              450, ("isalpha should be 1 for Y"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x59>:
push   %rbp
mov    %rsp,%rbp
mov    $0x59,%edi
call   1030 <isalpha@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1c2,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x59>:
push   %rax
mov    $0x59,%edi
call   1030 <isalpha@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1c2,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for Y\00"
define void @t_isalpha_0x59() {
%1 = call i32 @isalpha(i32 89)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 450, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for Y\00"
define void @t_isalpha_0x59() {
%1 = tail call i32 @isalpha(i32 89)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 450, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ _atomax(char const *);
long int atol(const char *s) { return (long int)_atomax(s); }


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

x86 assembly (clang, -O2):
<atol>:
jmp    1030 <_atomax@plt>

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

LLVM IR (-O2):
define i64 @atol(i8* %0) {
%2 = tail call i64 @_atomax(i8* %0)
ret i64 %2
}
/* Variables and functions */
void *dlsym(void *, char const *);
void *ATP_sharedLibSymbol(void *p_lib, const char *p_symbol) {
  return dlsym(p_lib, p_symbol);
}


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

x86 assembly (clang, -O2):
<ATP_sharedLibSymbol>:
jmp    1030 <dlsym@plt>

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

LLVM IR (-O2):
define i8* @ATP_sharedLibSymbol(i8* %0, i8* %1) {
%3 = tail call i8* @dlsym(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ I2C_WriteByte(int, int, int);
void TXHAL_InitPostReset(void) {
  I2C_WriteByte(0x72 >> 1, 0x82, 0x25);
  I2C_WriteByte(0x72 >> 1, 0x08, 0x36);
}


x86 assembly (clang, -O0):
<TXHAL_InitPostReset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x39,%edi
mov    $0x82,%esi
mov    $0x25,%edx
call   1030 <I2C_WriteByte@plt>
mov    $0x39,%edi
mov    $0x8,%esi
mov    $0x36,%edx
call   1030 <I2C_WriteByte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TXHAL_InitPostReset>:
push   %rax
mov    $0x39,%edi
mov    $0x82,%esi
mov    $0x25,%edx
call   1030 <I2C_WriteByte@plt>
mov    $0x39,%edi
mov    $0x8,%esi
mov    $0x36,%edx
pop    %rax
jmp    1030 <I2C_WriteByte@plt>

LLVM IR (-O0):
define void @TXHAL_InitPostReset() {
%1 = call i32 @I2C_WriteByte(i32 57, i32 130, i32 37)
%2 = call i32 @I2C_WriteByte(i32 57, i32 8, i32 54)
ret void
}

LLVM IR (-O2):
define void @TXHAL_InitPostReset() {
%1 = tail call i32 @I2C_WriteByte(i32 57, i32 130, i32 37)
%2 = tail call i32 @I2C_WriteByte(i32 57, i32 8, i32 54)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ allow;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_BROADCAST;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int allowBroadcast(int sock, int allow) {
  return setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &allow, sizeof(allow));
}


x86 assembly (clang, -O0):
<allowBroadcast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allowBroadcast>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
define i32 @allowBroadcast(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_BROADCAST
%8 = call i32 @setsockopt(i32 %5, i32 %6, i32 %7, i32* %4, i32 4)
ret i32 %8
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
define i32 @allowBroadcast(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_BROADCAST
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %3, i32 4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ActuatorDesiredHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void ActuatorDesiredLogging() { UAVObjLogging(ActuatorDesiredHandle()); }


x86 assembly (clang, -O0):
<ActuatorDesiredLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ActuatorDesiredHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ActuatorDesiredLogging>:
push   %rax
xor    %eax,%eax
call   1040 <ActuatorDesiredHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @ActuatorDesiredLogging() {
%1 = call i32 (...) @ActuatorDesiredHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @ActuatorDesiredLogging() {
%1 = tail call i32 (...) @ActuatorDesiredHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Type definitions */
struct list_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_count(struct list_t *);
scalar_t__ list_get(struct list_t *, int /*<<< orphan*/);
char *str_token_list_first(struct list_t *token_list) {
  if (!list_count(token_list))
    return "";
  return (char *)list_get(token_list, 0);
}


x86 assembly (clang, -O0):
<str_token_list_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <list_count@plt>
cmp    $0x0,%eax
jne    114e <str_token_list_first+0x2e>
lea    0xebb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115d <str_token_list_first+0x3d>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <list_get@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_token_list_first>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_count@plt>
test   %eax,%eax
je     1139 <str_token_list_first+0x19>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <list_get@plt>
pop    %rbx
ret
lea    0xec0(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.list_t = type { i32 }
@.str = [1 x i8] zeroinitializer
define i8* @str_token_list_first(%struct.list_t* %0) {
%2 = alloca i8*
%3 = alloca %struct.list_t*
store %struct.list_t* %0, %struct.list_t** %3
%4 = load %struct.list_t*, %struct.list_t** %3
%5 = call i32 @list_count(%struct.list_t* %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
8: ; preds = %1
%9 = load %struct.list_t*, %struct.list_t** %3
%10 = call i64 @list_get(%struct.list_t* %9, i32 0)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %2
br label %12
12: ; preds = %8, %7
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
%struct.list_t = type { i32 }
@.str = [1 x i8] zeroinitializer
define i8* @str_token_list_first(%struct.list_t* %0) {
%2 = tail call i32 @list_count(%struct.list_t* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i64 @list_get(%struct.list_t* %0, i32 0)
%6 = inttoptr i64 %5 to i8*
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %8
}
/* Variables and functions */
void *OPL3Create(int, int, int /*<<< orphan*/);
void *ymf262_init(int clock, int rate) { return OPL3Create(clock, rate, (0)); }


x86 assembly (clang, -O0):
<ymf262_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1030 <OPL3Create@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @ymf262_init(i32 %0, i32 %1) {
%3 = tail call i8* @OPL3Create(i32 %0, i32 %1, i32 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printWelcome();
int main() {
  printWelcome();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @printWelcome()
ret i32 0
}
void __attribute__((weak)) tim8_brk_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<tim8_brk_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tim8_brk_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.tim8_brk_isr = [13 x i8] c"tim8_brk_isr\00"
define weak void @tim8_brk_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.tim8_brk_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.tim8_brk_isr = [13 x i8] c"tim8_brk_isr\00"
define weak void @tim8_brk_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.tim8_brk_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ RandomInteger();
double RandomDouble() { return (double)RandomInteger() * (1.0 / 4294967296.0); }


x86 assembly (clang, -O0):
<RandomDouble>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <RandomInteger@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed8(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomDouble>:
push   %rax
xor    %eax,%eax
call   1030 <RandomInteger@plt>
cvtsi2sd %rax,%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @RandomDouble() {
%1 = call i64 (...) @RandomInteger()
%2 = sitofp i64 %1 to double
%3 = fmul double %2, 0x3DF0000000000000
ret double %3
}

LLVM IR (-O2):
define double @RandomDouble() {
%1 = tail call i64 (...) @RandomInteger()
%2 = sitofp i64 %1 to double
%3 = fmul double %2, 0x3DF0000000000000
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, unsigned int);
void memz(void *addr, unsigned int size) { memset(addr, 0, size); }


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

x86 assembly (clang, -O2):
<memz>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @memz(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
ret void
}
/* Variables and functions */
double modf(double, double *);
double trianglewave(double x) {
  double frac, tmp;
  frac = modf(x, &tmp) * 2.0;
  return frac <= 1.0 ? frac : 2.0 - frac;
}


x86 assembly (clang, -O0):
<trianglewave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x18(%rbp),%rdi
call   1030 <modf@plt>
movsd  0xed5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xebc(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     115e <trianglewave+0x4e>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1170 <trianglewave+0x60>
movsd  0xea2(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trianglewave>:
push   %rax
mov    %rsp,%rdi
call   1030 <modf@plt>
addsd  %xmm0,%xmm0
movsd  0xedb(%rip),%xmm1
movapd %xmm0,%xmm2
cmplesd 0xed6(%rip),%xmm2
subsd  %xmm0,%xmm1
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @trianglewave(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @modf(double %5, double* %4)
%7 = fmul double %6, 2.000000e+00
store double %7, double* %3
%8 = load double, double* %3
%9 = fcmp ole double %8, 1.000000e+00
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load double, double* %3
br label %15
12: ; preds = %1
%13 = load double, double* %3
%14 = fsub double 2.000000e+00, %13
br label %15
15: ; preds = %12, %10
%16 = phi double [ %11, %10 ], [ %14, %12 ]
ret double %16
}

LLVM IR (-O2):
define double @trianglewave(double %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call double @modf(double %0, double* %2)
%5 = fmul double %4, 2.000000e+00
%6 = fcmp ole double %5, 1.000000e+00
%7 = fsub double 2.000000e+00, %5
%8 = select i1 %6, double %5, double %7
ret double %8
}
/* Variables and functions */
float sqrt(float);
float fdistance(float x1, float y1, float x2, float y2) {
  float dx = x1 - x2;
  float dy = y1 - y2;
  return sqrt((dx * dx) + (dy * dy));
}


x86 assembly (clang, -O0):
<fdistance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdistance>:
subss  %xmm2,%xmm0
subss  %xmm3,%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1131 <fdistance+0x21>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define float @fdistance(float %0, float %1, float %2, float %3) {
%5 = fsub float %0, %2
%6 = fsub float %1, %3
%7 = fmul float %6, %6
%8 = tail call float @llvm.fmuladd.f32(float %5, float %5, float %7)
%9 = tail call float @sqrt(float %8)
ret float %9
}
void CG_ActivateLimboMenu(void) {}


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

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

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

LLVM IR (-O2):
define void @CG_ActivateLimboMenu() {
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
char *skipspaces(char *str) {
  while (isspace(*str))
    str++;
  return str;
}


x86 assembly (clang, -O0):
<skipspaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skipspaces+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipspaces+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipspaces>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skipspaces+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipspaces(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
long XX_httplib_ssl_get_protocol(int version_id) {
  long ret;
  ret = ((long)(0x80000BFFUL));
  if (version_id > 0)
    ret |= (0x01000000L);
  if (version_id > 1)
    ret |= (0x02000000L);
  if (version_id > 2)
    ret |= (0x04000000L);
  if (version_id > 3)
    ret |= (0x10000000L);
  return ret;
}


x86 assembly (clang, -O0):
<XX_httplib_ssl_get_protocol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x80000bff,%eax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1128 <XX_httplib_ssl_get_protocol+0x28>
mov    -0x10(%rbp),%rax
or     $0x1000000,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1140 <XX_httplib_ssl_get_protocol+0x40>
mov    -0x10(%rbp),%rax
or     $0x2000000,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jle    1158 <XX_httplib_ssl_get_protocol+0x58>
mov    -0x10(%rbp),%rax
or     $0x4000000,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
jle    1170 <XX_httplib_ssl_get_protocol+0x70>
mov    -0x10(%rbp),%rax
or     $0x10000000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<XX_httplib_ssl_get_protocol>:
mov    $0x80000bff,%eax
lea    0x1000000(%rax),%rcx
test   %edi,%edi
cmovle %rax,%rcx
lea    0x2000000(%rcx),%rax
cmp    $0x2,%edi
cmovl  %rcx,%rax
lea    0x4000000(%rax),%rcx
cmp    $0x3,%edi
cmovl  %rax,%rcx
lea    0x10000000(%rcx),%rax
cmp    $0x4,%edi
cmovl  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @XX_httplib_ssl_get_protocol(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
store i64 2147486719, i64* %3
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %3
%8 = or i64 %7, 16777216
store i64 %8, i64* %3
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i64, i64* %3
%14 = or i64 %13, 33554432
store i64 %14, i64* %3
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %2
%17 = icmp sgt i32 %16, 2
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i64, i64* %3
%20 = or i64 %19, 67108864
store i64 %20, i64* %3
br label %21
21: ; preds = %18, %15
%22 = load i32, i32* %2
%23 = icmp sgt i32 %22, 3
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load i64, i64* %3
%26 = or i64 %25, 268435456
store i64 %26, i64* %3
br label %27
27: ; preds = %24, %21
%28 = load i64, i64* %3
ret i64 %28
}

LLVM IR (-O2):
define i64 @XX_httplib_ssl_get_protocol(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = select i1 %2, i64 2164263935, i64 2147486719
%4 = icmp sgt i32 %0, 1
%5 = or i64 %3, 33554432
%6 = select i1 %4, i64 %5, i64 %3
%7 = icmp sgt i32 %0, 2
%8 = or i64 %6, 67108864
%9 = select i1 %7, i64 %8, i64 %6
%10 = icmp sgt i32 %0, 3
%11 = or i64 %9, 268435456
%12 = select i1 %10, i64 %11, i64 %9
ret i64 %12
}
extern void TakeIntCallback(void (*cb)(int)) { cb(17); }


x86 assembly (clang, -O0):
<TakeIntCallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x11,%edi
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TakeIntCallback>:
mov    %rdi,%rax
mov    $0x11,%edi
jmp    *%rax

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

LLVM IR (-O2):
define void @TakeIntCallback(void (i32)* nocapture %0) {
tail call void %0(i32 17)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ignore_ws(char **);
char next_char(char **c) {
  ignore_ws(c);
  return *(*c)++;
}


x86 assembly (clang, -O0):
<next_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ignore_ws@plt>
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movsbl (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_char>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ignore_ws@plt>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
mov    (%rax),%al
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @next_char(i8** %0) {
%2 = tail call i32 @ignore_ws(i8** %0)
%3 = load i8*, i8** %0
%4 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %4, i8** %0
%5 = load i8, i8* %3
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("\n");
  printf("Hello from a C source !\n");
  printf("This is Test Release v0.0.4 !\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xf09(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
lea    0xeda(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [25 x i8] c"Hello from a C source !\0A\00"
@.str.2 = [31 x i8] c"This is Test Release v0.0.4 !\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"Hello from a C source !\00"
@str.3 = [30 x i8] c"This is Test Release v0.0.4 !\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
int dummy() { return 0; }


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

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

LLVM IR (-O0):
define i32 @dummy() {
ret i32 0
}

LLVM IR (-O2):
define i32 @dummy() {
ret i32 0
}
float computeAlpha(float left, float right) { return (left - right) / 2.0f; }


x86 assembly (clang, -O0):
<computeAlpha>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  0xee0(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeAlpha>:
subss  %xmm1,%xmm0
mulss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @computeAlpha(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
%8 = fdiv float %7, 2.000000e+00
ret float %8
}

LLVM IR (-O2):
define float @computeAlpha(float %0, float %1) {
%3 = fsub float %0, %1
%4 = fmul float %3, 5.000000e-01
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ test_sessions_client();
void test_sessions() { test_sessions_client(); }


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

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

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

LLVM IR (-O2):
define void @test_sessions() {
%1 = tail call i32 (...) @test_sessions_client()
ret void
}
int snd_hda_hwdep_add_sysfs(struct hda_codec *codec) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.hda_codec = type opaque
define i32 @snd_hda_hwdep_add_sysfs(%struct.hda_codec* nocapture readnone %0) {
ret i32 0
}