xunge/DecIR huggingface dataset:
void EPINonBlockingReadConfigure(unsigned long ulBase, unsigned long ulChannel,
                                 unsigned long ulDataSize,
                                 unsigned long ulAddress) {
  unsigned long ulOffset;
  ;
  ;
  ;
  ;
  ulOffset = ulChannel * (0x00000030 - 0x00000020);
  (*((volatile unsigned long *)(ulBase + 0x00000020 + ulOffset))) = ulDataSize;
  (*((volatile unsigned long *)(ulBase + 0x00000024 + ulOffset))) = ulAddress;
}


x86 assembly (clang, -O0):
<EPINonBlockingReadConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    $0x20,%rax
add    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    $0x24,%rax
add    -0x28(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPINonBlockingReadConfigure>:
shl    $0x4,%rsi
mov    %rdx,0x20(%rsi,%rdi,1)
mov    %rcx,0x24(%rsi,%rdi,1)
ret

LLVM IR (-O0):
define void @EPINonBlockingReadConfigure(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i64, i64* %6
%11 = mul i64 %10, 16
store i64 %11, i64* %9
%12 = load i64, i64* %7
%13 = load i64, i64* %5
%14 = add i64 %13, 32
%15 = load i64, i64* %9
%16 = add i64 %14, %15
%17 = inttoptr i64 %16 to i64*
store volatile i64 %12, i64* %17
%18 = load i64, i64* %8
%19 = load i64, i64* %5
%20 = add i64 %19, 36
%21 = load i64, i64* %9
%22 = add i64 %20, %21
%23 = inttoptr i64 %22 to i64*
store volatile i64 %18, i64* %23
ret void
}

LLVM IR (-O2):
define void @EPINonBlockingReadConfigure(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = shl i64 %1, 4
%6 = add i64 %5, %0
%7 = add i64 %6, 32
%8 = inttoptr i64 %7 to i64*
store volatile i64 %2, i64* %8
%9 = add i64 %6, 36
%10 = inttoptr i64 %9 to i64*
store volatile i64 %3, i64* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vdmnum(int, char *);
int /*<<< orphan*/ vdmprintf(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void vdmorigin(int newx, int newy) {
  char nx[4], ny[4];
  vdmprintf("}\"%s%s\x1e", vdmnum(newx, nx), vdmnum(newy, ny));
}


x86 assembly (clang, -O0):
<vdmorigin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xc(%rbp),%rsi
call   1030 <vdmnum@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <vdmnum@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xeab(%rip),%rdi
call   1040 <vdmprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdmorigin>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
lea    0x4(%rsp),%rsi
call   1030 <vdmnum@plt>
mov    %eax,%ebp
mov    %rsp,%rsi
mov    %ebx,%edi
call   1030 <vdmnum@plt>
lea    0xebe(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1040 <vdmprintf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"}\22%s%s\1E\00"
define void @vdmorigin(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [4 x i8]
%6 = alloca [4 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%9 = call i32 @vdmnum(i32 %7, i8* %8)
%10 = load i32, i32* %4
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%12 = call i32 @vdmnum(i32 %10, i8* %11)
%13 = call i32 @vdmprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"}\22%s%s\1E\00"
define void @vdmorigin(i32 %0, i32 %1) {
%3 = alloca [4 x i8]
%4 = alloca [4 x i8]
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%7 = call i32 @vdmnum(i32 %0, i8* %5)
%8 = call i32 @vdmnum(i32 %1, i8* %6)
%9 = call i32 @vdmprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_set_epi8(int, int, int, int, int, int, int, int, int,
                                int, int, int, int, int /*<<< orphan*/, int,
                                int);
int /*<<< orphan*/ _mm_shuffle_epi8(int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((always_)) __m128i rot16(__m128i x) {
  return _mm_shuffle_epi8(
      x, _mm_set_epi8(13, 12, 15, 14, 9, 8, 11, 10, 5, 4, 7, 6, 1, 0, 3, 2));
}


x86 assembly (clang, -O0):
<rot16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xd,%edi
mov    $0xc,%esi
mov    $0xf,%edx
mov    $0xe,%ecx
mov    $0x9,%r8d
mov    $0x8,%r9d
xor    %eax,%eax
movl   $0xb,(%rsp)
movl   $0xa,0x8(%rsp)
movl   $0x5,0x10(%rsp)
movl   $0x4,0x18(%rsp)
movl   $0x7,0x20(%rsp)
movl   $0x6,0x28(%rsp)
movl   $0x1,0x30(%rsp)
movl   $0x0,0x38(%rsp)
movl   $0x3,0x40(%rsp)
movl   $0x2,0x48(%rsp)
call   1040 <_mm_set_epi8@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_shuffle_epi8@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot16>:
push   %rbx
mov    %edi,%ebx
mov    $0xd,%edi
mov    $0xc,%esi
mov    $0xf,%edx
mov    $0xe,%ecx
mov    $0x9,%r8d
mov    $0x8,%r9d
push   $0x2
push   $0x3
push   $0x0
push   $0x1
push   $0x6
push   $0x7
push   $0x4
push   $0x5
push   $0xa
push   $0xb
call   1040 <_mm_set_epi8@plt>
add    $0x50,%rsp
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <_mm_shuffle_epi8@plt>

LLVM IR (-O0):
define i32 @rot16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_mm_set_epi8(i32 13, i32 12, i32 15, i32 14, i32 9, i32 8, i32 11, i32 10, i32 5, i32 4, i32 7, i32 6, i32 1, i32 0, i32 3, i32 2)
%5 = call i32 @_mm_shuffle_epi8(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @rot16(i32 %0) {
%2 = tail call i32 @_mm_set_epi8(i32 13, i32 12, i32 15, i32 14, i32 9, i32 8, i32 11, i32 10, i32 5, i32 4, i32 7, i32 6, i32 1, i32 0, i32 3, i32 2)
%3 = tail call i32 @_mm_shuffle_epi8(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *routine(void *arg) {
  int thrd_id = (int)arg;
  printf("Hello from thread #%d\n", thrd_id);
  return NULL;
}


x86 assembly (clang, -O0):
<routine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<routine>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Hello from thread #%d\0A\00"
define i8* @routine(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i8* null
}

LLVM IR (-O2):
@.str = [23 x i8] c"Hello from thread #%d\0A\00"
define noalias i8* @routine(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* null
}
/* Variables and functions */
int mcfioC_NTupleMult(int, int, char *);
int mcfio_ntuplemult_(int *stream, int *ntupleid, char *version, int ll) {
  return mcfioC_NTupleMult(*stream, *ntupleid, version);
}


x86 assembly (clang, -O0):
<mcfio_ntuplemult_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
call   1030 <mcfioC_NTupleMult@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcfio_ntuplemult_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <mcfioC_NTupleMult@plt>

LLVM IR (-O0):
define i32 @mcfio_ntuplemult_(i32* %0, i32* %1, i8* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = load i8*, i8** %7
%14 = call i32 @mcfioC_NTupleMult(i32 %10, i32 %12, i8* %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @mcfio_ntuplemult_(i32* nocapture %0, i32* nocapture %1, i8* %2, i32 %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %1
%7 = tail call i32 @mcfioC_NTupleMult(i32 %5, i32 %6, i8* %2)
ret i32 %7
}
int test_imm_94int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x94 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_94int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0x94,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_94int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 635655159808
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int ___compare(const char *a, const char *b) {
  if (*a == '.')
    ++a;
  if (*b == '.')
    ++b;
  return strcasecmp(a, b);
}


x86 assembly (clang, -O0):
<___compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    113c <___compare+0x2c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1158 <___compare+0x48>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcasecmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<___compare>:
xor    %eax,%eax
cmpb   $0x2e,(%rdi)
sete   %al
add    %rax,%rdi
xor    %eax,%eax
cmpb   $0x2e,(%rsi)
sete   %al
add    %rax,%rsi
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
define i32 @___compare(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* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 46
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
br label %12
12: ; preds = %9, %2
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 46
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %4
br label %20
20: ; preds = %17, %12
%21 = load i8*, i8** %3
%22 = load i8*, i8** %4
%23 = call i32 @strcasecmp(i8* %21, i8* %22)
ret i32 %23
}

LLVM IR (-O2):
define i32 @___compare(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 46
%5 = zext i1 %4 to i64
%6 = getelementptr i8, i8* %0, i64 %5
%7 = load i8, i8* %1
%8 = icmp eq i8 %7, 46
%9 = zext i1 %8 to i64
%10 = getelementptr i8, i8* %1, i64 %9
%11 = tail call i32 @strcasecmp(i8* %6, i8* %10)
ret i32 %11
}
unsigned int simple_hash_str(const char *str) {
  const int MULTIPLIER = 33;
  unsigned int h;
  unsigned const char *p;
  h = 0;
  for (p = (unsigned const char *)str; *p != '\0'; p++)
    h = MULTIPLIER * h + *p;
  h += (h >> 5);
  return h;
}


x86 assembly (clang, -O0):
<simple_hash_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x21,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     114f <simple_hash_str+0x4f>
imul   $0x21,-0x10(%rbp),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111e <simple_hash_str+0x1e>
mov    -0x10(%rbp),%eax
shr    $0x5,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_hash_str>:
mov    (%rdi),%al
test   %al,%al
je     1129 <simple_hash_str+0x29>
add    $0x1,%rdi
xor    %edx,%edx
mov    %edx,%ecx
xchg   %ax,%ax
movzbl %al,%eax
shl    $0x5,%ecx
add    %edx,%ecx
add    %eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
mov    %ecx,%edx
test   %al,%al
jne    1110 <simple_hash_str+0x10>
jmp    112b <simple_hash_str+0x2b>
xor    %ecx,%ecx
mov    %ecx,%eax
shr    $0x5,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @simple_hash_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = zext i8 %5 to i32
%9 = mul i32 %7, 33
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
%16 = lshr i32 %15, 5
%17 = add i32 %16, %15
ret i32 %17
}
int test_imm_F5uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xF5 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F5uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 245
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void nop(void *junk) {}


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

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

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

LLVM IR (-O2):
define void @nop(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ read_word_data(int, int);
uint16_t io_get_bus_pullups() { return read_word_data(0x20, 0x0C); }


x86 assembly (clang, -O0):
<io_get_bus_pullups>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0xc,%esi
call   1030 <read_word_data@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_get_bus_pullups>:
mov    $0x20,%edi
mov    $0xc,%esi
jmp    1030 <read_word_data@plt>

LLVM IR (-O0):
define i32 @io_get_bus_pullups() {
%1 = call i32 @read_word_data(i32 32, i32 12)
ret i32 %1
}

LLVM IR (-O2):
define i32 @io_get_bus_pullups() {
%1 = tail call i32 @read_word_data(i32 32, i32 12)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x81() {
  Assert_real((isupper(129) == 0),
              "/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_isupper.c",
              650, ("isupper should be 0 for 0x81"));
}


x86 assembly (clang, -O0):
<t_isupper_0x81>:
push   %rbp
mov    %rsp,%rbp
mov    $0x81,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x28a,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x81>:
push   %rax
mov    $0x81,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x28a,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x81\00"
define void @t_isupper_0x81() {
%1 = call i64 @isupper(i32 129)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 650, i8* getelementptr inbounds ([29 x i8], [29 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x81\00"
define void @t_isupper_0x81() {
%1 = tail call i64 @isupper(i32 129)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 650, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void CAN1_RX1_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @CAN1_RX1_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LPI2C4_DriverIRQHandler();
__attribute__((weak)) void LPI2C4_IRQHandler(void) {
  LPI2C4_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @LPI2C4_IRQHandler() {
%1 = call i32 (...) @LPI2C4_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @LPI2C4_IRQHandler() {
%1 = tail call i32 (...) @LPI2C4_DriverIRQHandler()
ret void
}
int funcc() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @funcc() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int pthread_cancel(pthread_t __th) {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_cancel(i32 %0) {
ret i32 0
}
char *str_skip_whitespaces(char *str) {
  while (*str && (*str == ' ' || *str == '\t' || *str == '\n' || *str == '\r'))
    str++;
  return str;
}


x86 assembly (clang, -O0):
<str_skip_whitespaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1172 <str_skip_whitespaces+0x72>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xa(%rbp)
je     116c <str_skip_whitespaces+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0xa(%rbp)
je     116c <str_skip_whitespaces+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0xa(%rbp)
je     116c <str_skip_whitespaces+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1182 <str_skip_whitespaces+0x82>
jmp    1193 <str_skip_whitespaces+0x93>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <str_skip_whitespaces+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_skip_whitespaces>:
mov    %rdi,%rax
movabs $0x100002600,%rcx
nopl   (%rax)
movzbl (%rax),%edx
cmp    $0x20,%rdx
ja     1125 <str_skip_whitespaces+0x25>
bt     %rdx,%rcx
jae    1125 <str_skip_whitespaces+0x25>
add    $0x1,%rax
jmp    1110 <str_skip_whitespaces+0x10>
ret

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

LLVM IR (-O2):
define i8* @str_skip_whitespaces(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 13, label %5
i8 32, label %5
i8 9, label %5
i8 10, label %5
]
5: ; preds = %2, %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
void four_branch() {
  int x;
  if (x) {
    if (x) {
      x = 0;
    } else {
      x = 1;
    }
  } else {
    if (x) {
      x = 0;
    } else {
      x = 1;
    }
  }
}


x86 assembly (clang, -O0):
<four_branch>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,-0x4(%rbp)
je     1130 <four_branch+0x30>
cmpl   $0x0,-0x4(%rbp)
je     1124 <four_branch+0x24>
movl   $0x0,-0x4(%rbp)
jmp    112b <four_branch+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <four_branch+0x52>
cmpl   $0x0,-0x4(%rbp)
je     1146 <four_branch+0x46>
movl   $0x0,-0x4(%rbp)
jmp    114d <four_branch+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1152 <four_branch+0x52>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @four_branch() {
ret void
}
/* Variables and functions */
float exp(double);
float DecibelsToAmplitudeRatio(float decibels) {
  return exp((2.30258509299404568 / 20) * decibels);
}


x86 assembly (clang, -O0):
<DecibelsToAmplitudeRatio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DecibelsToAmplitudeRatio>:
cvtss2sd %xmm0,%xmm0
mulsd  0xee4(%rip),%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define float @DecibelsToAmplitudeRatio(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double 0x3FBD791C5F888823, %4
%6 = call float @exp(double %5)
ret float %6
}

LLVM IR (-O2):
define float @DecibelsToAmplitudeRatio(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x3FBD791C5F888823
%4 = tail call float @exp(double %3)
ret float %4
}
int zaokrozi(int stevilo, int koliko) { return (stevilo / koliko) * koliko; }


x86 assembly (clang, -O0):
<zaokrozi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zaokrozi>:
mov    %edi,%eax
cltd
idiv   %esi
sub    %edx,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @zaokrozi(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 = sdiv i32 %5, %6
%8 = load i32, i32* %4
%9 = mul nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @zaokrozi(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = sub i32 %0, %3
ret i32 %4
}
void delay(int dl) {
  int x;
  for (x = 0; x < dl; x++)
    ;
  return;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <delay+0x2d>
jmp    111f <delay+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
/* Variables and functions */
char *carmen_next_word(char *);
extern __attribute__((gnu_)) char *carmen_next_n_words(char *str, int n) {
  int i;
  char *result;
  result = str;
  for (i = 0; i < n; i++)
    result = carmen_next_word(result);
  return result;
}


x86 assembly (clang, -O0):
<carmen_next_n_words>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1155 <carmen_next_n_words+0x45>
mov    -0x18(%rbp),%rdi
call   1030 <carmen_next_word@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112e <carmen_next_n_words+0x1e>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_next_n_words>:
push   %rbx
mov    %rdi,%rax
test   %esi,%esi
jle    112d <carmen_next_n_words+0x1d>
mov    %esi,%ebx
nopw   0x0(%rax,%rax,1)
mov    %rax,%rdi
call   1030 <carmen_next_word@plt>
add    $0xffffffff,%ebx
jne    1120 <carmen_next_n_words+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @carmen_next_n_words(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i8* [ %7, %4 ], [ %0, %2 ]
%6 = phi i32 [ %8, %4 ], [ 0, %2 ]
%7 = tail call i8* @carmen_next_word(i8* %5)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %2
%11 = phi i8* [ %0, %2 ], [ %7, %4 ]
ret i8* %11
}
float mult(float a, float b) { return a * b; }


x86 assembly (clang, -O0):
<mult>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult>:
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @mult(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 = fmul float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @mult(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int foo(int);
int main() {
  assert(foo(0) == 1);
  assert(foo(1) == 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <foo@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1040 <foo@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <foo@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x1,%edi
call   1040 <foo@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 0)
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @foo(i32 1)
%7 = icmp eq i32 %6, 3
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @foo(i32 1)
%6 = icmp eq i32 %5, 3
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_version(void) {
  printf("blzpack "
         "1.1.0"
         "\n"
         "\n"
         "Copyright (c) 2002-2015 Joergen Ibsen\n"
         "\n"
         "Licensed under the zlib license.\n"
         "There is NO WARRANTY, to the extent permitted by law.\n"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [143 x i8] c"blzpack 1.1.0\0A\0ACopyright (c) 2002-2015 Joergen Ibsen\0A\0ALicensed under the zlib license.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\0A\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [142 x i8] c"blzpack 1.1.0\0A\0ACopyright (c) 2002-2015 Joergen Ibsen\0A\0ALicensed under the zlib license.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([142 x i8], [142 x i8]* @str, i64 0, i64 0))
ret void
}
void AnalyzeImage() {}


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

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

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

LLVM IR (-O2):
define void @AnalyzeImage() {
ret void
}
void dprintf(char *txt, ...) {}


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

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

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

LLVM IR (-O2):
define void @dprintf(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void _swap_elems(void *a, void *b, int elem_size, void *buffer) {
  memcpy(buffer, a, elem_size);
  memcpy(a, b, elem_size);
  memcpy(b, buffer, elem_size);
}


x86 assembly (clang, -O0):
<_swap_elems>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_swap_elems>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%ebp
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rcx,%rdi
mov    %rbx,%rsi
call   1030 <memcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   1030 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @_swap_elems(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @memcpy(i8* %3, i8* %0, i32 %2)
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
%7 = tail call i32 @memcpy(i8* %1, i8* %3, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void WriteWord32(int x, FILE *f) {
  fputc((x >> 24) & 255, f);
  fputc((x >> 16) & 255, f);
  fputc((x >> 8) & 255, f);
  fputc(x & 255, f);
}


x86 assembly (clang, -O0):
<WriteWord32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x18,%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0x4(%rbp),%edi
sar    $0x10,%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteWord32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    %edi,%eax
shr    $0x18,%eax
mov    %eax,%edi
call   1030 <fputc@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
movzbl %bh,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
movzbl %bl,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @WriteWord32(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 = ashr i32 %5, 24
%7 = and i32 %6, 255
%8 = load i32*, i32** %4
%9 = call i32 @fputc(i32 %7, i32* %8)
%10 = load i32, i32* %3
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = load i32*, i32** %4
%14 = call i32 @fputc(i32 %12, i32* %13)
%15 = load i32, i32* %3
%16 = ashr i32 %15, 8
%17 = and i32 %16, 255
%18 = load i32*, i32** %4
%19 = call i32 @fputc(i32 %17, i32* %18)
%20 = load i32, i32* %3
%21 = and i32 %20, 255
%22 = load i32*, i32** %4
%23 = call i32 @fputc(i32 %21, i32* %22)
ret void
}

LLVM IR (-O2):
define void @WriteWord32(i32 %0, i32* nocapture %1) {
%3 = lshr i32 %0, 24
%4 = tail call i32 @fputc(i32 %3, i32* %1)
%5 = lshr i32 %0, 16
%6 = and i32 %5, 255
%7 = tail call i32 @fputc(i32 %6, i32* %1)
%8 = lshr i32 %0, 8
%9 = and i32 %8, 255
%10 = tail call i32 @fputc(i32 %9, i32* %1)
%11 = and i32 %0, 255
%12 = tail call i32 @fputc(i32 %11, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ optimize_token_table();
int /*<<< orphan*/ read_map(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ usage();
int /*<<< orphan*/ write_src();
int main(int argc, char **argv) {
  if (argc != 1)
    usage();
  read_map(stdin);
  optimize_token_table();
  write_src();
  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)
cmpl   $0x1,-0x8(%rbp)
je     1167 <main+0x27>
mov    $0x0,%al
call   1050 <usage@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1030 <read_map@plt>
mov    $0x0,%al
call   1060 <optimize_token_table@plt>
mov    $0x0,%al
call   1040 <write_src@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
je     114d <main+0xd>
xor    %eax,%eax
call   1050 <usage@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1030 <read_map@plt>
xor    %eax,%eax
call   1060 <optimize_token_table@plt>
xor    %eax,%eax
call   1040 <write_src@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
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 = load i32, i32* %4
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @usage()
br label %10
10: ; preds = %8, %2
%11 = load i32, i32* @stdin
%12 = call i32 @read_map(i32 %11)
%13 = call i32 (...) @optimize_token_table()
%14 = call i32 (...) @write_src()
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %6
6: ; preds = %4, %2
%7 = load i32, i32* @stdin
%8 = tail call i32 @read_map(i32 %7)
%9 = tail call i32 (...) @optimize_token_table()
%10 = tail call i32 (...) @write_src()
ret i32 0
}
/* Variables and functions */
float UI_Text_Height(char *, float, int /*<<< orphan*/);
float UI_Text_EmHeight(float scale) { return UI_Text_Height("M", scale, 0); }


x86 assembly (clang, -O0):
<UI_Text_EmHeight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xed7(%rip),%rdi
xor    %esi,%esi
call   1030 <UI_Text_Height@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_Text_EmHeight>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <UI_Text_Height@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"M\00"
define float @UI_Text_EmHeight(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @UI_Text_Height(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), float %3, i32 0)
ret float %4
}

LLVM IR (-O2):
@.str = [2 x i8] c"M\00"
define float @UI_Text_EmHeight(float %0) {
%2 = tail call float @UI_Text_Height(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), float %0, i32 0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ _WBOOT();
void _BIOS_WBOOT() { _WBOOT(); }


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

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

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

LLVM IR (-O2):
define void @_BIOS_WBOOT() {
%1 = tail call i32 (...) @_WBOOT()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int maxSum(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arr[] = {4, 6, 1, 3, 8, 4, 6};
  int n = sizeof(arr) / sizeof(arr[0]);
  printf("Sum of maximum sum increasing subsequence is %d \n", maxSum(arr, n));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x7,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <maxSum@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1030 <maxSum@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [7 x i32] [i32 4, i32 6, i32 1, i32 3, i32 8, i32 4, i32 6]
@.str = [50 x i8] c"Sum of maximum sum increasing subsequence is %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [7 x i32]* %2 to i8*
store i32 7, i32* %3
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @maxSum(i32* %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [7 x i32] [i32 4, i32 6, i32 1, i32 3, i32 8, i32 4, i32 6]
@.str = [50 x i8] c"Sum of maximum sum increasing subsequence is %d \0A\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @maxSum(i32* %3, i32 7)
%5 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef double int64_t;

/* Variables and functions */
double CalculateThroughput(int64_t elapsed, int64_t size) {
  return size / 1024.0 * 1000.0 / 1024.0 / elapsed;
}


x86 assembly (clang, -O0):
<CalculateThroughput>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xee5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xee1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xecd(%rip),%xmm1
divsd  %xmm1,%xmm0
divsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalculateThroughput>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm2,%xmm1
mulsd  0xef4(%rip),%xmm1
mulsd  %xmm1,%xmm2
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @CalculateThroughput(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fdiv double %5, 1.024000e+03
%7 = fmul double %6, 1.000000e+03
%8 = fdiv double %7, 1.024000e+03
%9 = load double, double* %3
%10 = fdiv double %8, %9
ret double %10
}

LLVM IR (-O2):
define double @CalculateThroughput(double %0, double %1) {
%3 = fmul double %1, 0x3F50000000000000
%4 = fmul double %3, 1.000000e+03
%5 = fmul double %4, 0x3F50000000000000
%6 = fdiv double %5, %0
ret double %6
}
/* Type definitions */
struct timeval {
  int dummy;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int olsr_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
                struct timeval *timeout) {
  return select(nfds, readfds, writefds, exceptfds, timeout);
}


x86 assembly (clang, -O0):
<olsr_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <select@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<olsr_select>:
jmp    1030 <select@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @olsr_select(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca %struct.timeval*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store %struct.timeval* %4, %struct.timeval** %10
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load %struct.timeval*, %struct.timeval** %10
%16 = call i32 @select(i32 %11, i32* %12, i32* %13, i32* %14, %struct.timeval* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @olsr_select(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4) {
%6 = tail call i32 @select(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4)
ret i32 %6
}