xunge/DecIR huggingface dataset:
unsigned query_count(const char *str) {
  unsigned count = 0;
  if (str) {
    do
      if (*str == '=')
        count++;
    while (*++str);
  }
  return count;
}


x86 assembly (clang, -O0):
<query_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115b <query_count+0x5b>
jmp    111f <query_count+0x1f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
jne    1138 <query_count+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <query_count+0x3d>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,0x1(%rax)
jne    111f <query_count+0x1f>
jmp    115b <query_count+0x5b>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<query_count>:
test   %rdi,%rdi
je     1126 <query_count+0x26>
mov    (%rdi),%cl
add    $0x1,%rdi
xor    %eax,%eax
nopl   (%rax)
xor    %edx,%edx
cmp    $0x3d,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <query_count+0x10>
ret
xor    %eax,%eax
ret

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

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


x86 assembly (clang, -O0):
<hash1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0xb,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash1>:
movslq (%rdi),%rax
imul   $0x2e8ba2e9,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rcx,%rdx,2),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hash1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = srem i32 %5, 11
ret i32 %6
}

LLVM IR (-O2):
define i32 @hash1(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = srem i32 %3, 11
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void PINT_dotconf_wild_card_cleanup(char *path, char *pre) {
  if (path != NULL) {
    free(path);
  }
  if (pre != NULL) {
    free(pre);
  }
}


x86 assembly (clang, -O0):
<PINT_dotconf_wild_card_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <PINT_dotconf_wild_card_cleanup+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x10(%rbp)
je     1148 <PINT_dotconf_wild_card_cleanup+0x38>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PINT_dotconf_wild_card_cleanup>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
je     111e <PINT_dotconf_wild_card_cleanup+0xe>
call   1030 <free@plt>
test   %rbx,%rbx
je     112c <PINT_dotconf_wild_card_cleanup+0x1c>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @PINT_dotconf_wild_card_cleanup(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %7, %2
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
br label %16
16: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
define void @PINT_dotconf_wild_card_cleanup(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %4, %2
%7 = icmp eq i8* %1, null
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @free(i8* %1)
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int getuid();
int md_getuid() { return (getuid()); }


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

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

LLVM IR (-O0):
define i32 @md_getuid() {
%1 = call i32 (...) @getuid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @md_getuid() {
%1 = tail call i32 (...) @getuid()
ret i32 %1
}
/* Variables and functions */
double const fabsf(float const);
bool z_fequal(float const a, float const b) {
  static double const precision = 1.0 / 2048;
  return fabsf(b - a) < precision;
}


x86 assembly (clang, -O0):
<z_fequal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
call   1030 <fabsf@plt>
movaps %xmm0,%xmm1
movsd  0xec4(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<z_fequal>:
push   %rax
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
call   1030 <fabsf@plt>
movsd  0xedb(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
@z_fequal.precision = internal constant double 0x3F40000000000000
define i32 @z_fequal(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = fsub float %5, %6
%8 = call double @fabsf(float %7)
%9 = fcmp olt double %8, 0x3F40000000000000
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @z_fequal(float %0, float %1) {
%3 = fsub float %1, %0
%4 = tail call double @fabsf(float %3)
%5 = fcmp olt double %4, 0x3F40000000000000
%6 = zext i1 %5 to i32
ret i32 %6
}
void DMTimerEnable(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0x38)))) |= (0x00000001u);
}


x86 assembly (clang, -O0):
<DMTimerEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x38,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DMTimerEnable>:
add    $0x38,%edi
orl    $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @DMTimerEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 56
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 1
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @DMTimerEnable(i32 %0) {
%2 = add i32 %0, 56
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 1
store volatile i32 %6, i32* %4
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int get_int16_le(const uint8_t *buffer) {
  uint32_t n;
  n = (buffer[1] << 8) | buffer[0];
  return n;
}


x86 assembly (clang, -O0):
<get_int16_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     (%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int16_le>:
mov    0x4(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_int16_le(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = load i32, i32* %0
%6 = or i32 %4, %5
ret i32 %6
}
int set_nosigpipe(int fd) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @set_nosigpipe(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ recurser_void2(int);
int /*<<< orphan*/ track(int);
void __attribute__((no)) recurser_void1(int n) {
  if (n == 0 || n == 7 || n == 8)
    track(n);
  if (n == 10)
    return;
  recurser_void2(n + 1);
}


x86 assembly (clang, -O0):
<recurser_void1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1149 <recurser_void1+0x29>
cmpl   $0x7,-0x4(%rbp)
je     1149 <recurser_void1+0x29>
cmpl   $0x8,-0x4(%rbp)
jne    1151 <recurser_void1+0x31>
mov    -0x4(%rbp),%edi
call   1040 <track@plt>
cmpl   $0xa,-0x4(%rbp)
jne    1160 <recurser_void1+0x40>
jmp    116b <recurser_void1+0x4b>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <recurser_void2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recurser_void1>:
push   %rbx
mov    %edi,%ebx
lea    -0x7(%rbx),%eax
cmp    $0x2,%eax
jb     1134 <recurser_void1+0x14>
cmp    $0xa,%ebx
je     1146 <recurser_void1+0x26>
test   %ebx,%ebx
jne    113b <recurser_void1+0x1b>
mov    %ebx,%edi
call   1040 <track@plt>
add    $0x1,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <recurser_void2@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @recurser_void1(i32 %0) {
switch i32 %0, label %4 [
i32 8, label %2
i32 7, label %2
i32 0, label %2
i32 10, label %7
]
2: ; preds = %1, %1, %1
%3 = tail call i32 @track(i32 %0)
br label %4
4: ; preds = %2, %1
%5 = add nsw i32 %0, 1
%6 = tail call i32 @recurser_void2(i32 %5)
br label %7
7: ; preds = %1, %4
ret void
}
int LZ4_decoderRingBufferSize(int maxBlockSize) {
  if (maxBlockSize < 0)
    return 0;
  if (maxBlockSize > 0x7E000000)
    return 0;
  if (maxBlockSize < 16)
    maxBlockSize = 16;
  return (65536 + 14 + (maxBlockSize));
}


x86 assembly (clang, -O0):
<LZ4_decoderRingBufferSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <LZ4_decoderRingBufferSize+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1152 <LZ4_decoderRingBufferSize+0x52>
cmpl   $0x7e000000,-0x8(%rbp)
jle    1136 <LZ4_decoderRingBufferSize+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1152 <LZ4_decoderRingBufferSize+0x52>
cmpl   $0x10,-0x8(%rbp)
jge    1147 <LZ4_decoderRingBufferSize+0x47>
movl   $0x10,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1000e,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_decoderRingBufferSize>:
cmp    $0x11,%edi
mov    $0x10,%ecx
cmovge %edi,%ecx
add    $0x1000e,%ecx
xor    %eax,%eax
cmp    $0x7e000001,%edi
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @LZ4_decoderRingBufferSize(i32 %0) {
%2 = icmp ugt i32 %0, 2113929216
%3 = icmp sgt i32 %0, 16
%4 = select i1 %3, i32 %0, i32 16
%5 = add nuw nsw i32 %4, 65550
%6 = select i1 %2, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int unix_check(const char *msg, int result) {
  if (result < 0) {
    perror(msg);
    exit(2);
  }
  return result;
}


x86 assembly (clang, -O0):
<unix_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    114c <unix_check+0x2c>
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x2,%edi
call   1040 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unix_check>:
test   %esi,%esi
js     1127 <unix_check+0x7>
mov    %esi,%eax
ret
push   %rax
call   1030 <perror@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @unix_check(i8* nocapture %0, i32 returned %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @perror(i8* %0)
%6 = tail call i32 @exit(i32 2)
unreachable
7: ; preds = %2
ret i32 %1
}
void def_disabled_free(void *instance) {}


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

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

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

LLVM IR (-O2):
define void @def_disabled_free(i8* nocapture %0) {
ret void
}
void EC_GROUP_get_order(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_GROUP_get_order() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ munmap(int *, int);
void close_score(int f, int *m) {
  if (f < 0)
    return;
  munmap(m, sizeof(*m));
  close(f);
}


x86 assembly (clang, -O0):
<close_score>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    113e <close_score+0x1e>
jmp    1154 <close_score+0x34>
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1040 <munmap@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_score>:
test   %edi,%edi
js     113c <close_score+0x1c>
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
mov    $0x4,%esi
call   1040 <munmap@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
define void @close_score(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 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %13
8: ; preds = %2
%9 = load i32*, i32** %4
%10 = call i32 @munmap(i32* %9, i32 4)
%11 = load i32, i32* %3
%12 = call i32 @close(i32 %11)
br label %13
13: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @close_score(i32 %0, i32* %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @munmap(i32* %1, i32 4)
%6 = tail call i32 @close(i32 %0)
br label %7
7: ; preds = %2, %4
ret void
}
/* Variables and functions */
bool nrf53_errata_16(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_16() {
ret i32 0
}
/* Variables and functions */
float sla_range_(float *);
float slaRange(float a) { return sla_range_(&a); }


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

x86 assembly (clang, -O2):
<slaRange>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <sla_range_@plt>
pop    %rax
ret

LLVM IR (-O0):
define float @slaRange(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float @sla_range_(float* %2)
ret float %3
}

LLVM IR (-O2):
define float @slaRange(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float @sla_range_(float* %2)
ret float %3
}
extern unsigned get_minor_version_SM_SOCKET() { return 4; }


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

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

LLVM IR (-O0):
define i32 @get_minor_version_SM_SOCKET() {
ret i32 4
}

LLVM IR (-O2):
define i32 @get_minor_version_SM_SOCKET() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage:\n");
  fprintf(stderr, "  test_decode <batch>\n");
  fprintf(stderr, "  test_decode <batch> -dump\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"usage:\0A\00"
@.str.1 = [23 x i8] c" test_decode <batch>\0A\00"
@.str.2 = [29 x i8] c" test_decode <batch> -dump\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"usage:\0A\00"
@.str.1 = [23 x i8] c" test_decode <batch>\0A\00"
@.str.2 = [29 x i8] c" test_decode <batch> -dump\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ g();
__attribute__((no, noclone)) void f(void) { g(); }


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

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

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

LLVM IR (-O2):
define void @f() {
%1 = tail call i32 (...) @g()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void flash_set_waitstates(unsigned int waitstates) {
  uint32_t reg = (*(volatile uint32_t *)(0x40022000 + 0x00));
  if ((reg & (0x03)) != waitstates)
    (*(volatile uint32_t *)(0x40022000 + 0x00)) |=
        ((reg & ~(0x03)) | waitstates);
}


x86 assembly (clang, -O0):
<flash_set_waitstates>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x40022000,%eax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x3,%eax
cmp    -0x4(%rbp),%eax
je     1139 <flash_set_waitstates+0x39>
mov    -0x8(%rbp),%eax
and    $0xfffffffc,%eax
or     -0x4(%rbp),%eax
mov    $0x40022000,%ecx
mov    (%rcx),%ecx
or     %eax,%ecx
mov    $0x40022000,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_set_waitstates>:
mov    0x40022000,%eax
mov    %eax,%ecx
and    $0x3,%ecx
cmp    %edi,%ecx
je     111c <flash_set_waitstates+0x1c>
and    $0xfffffffc,%eax
or     %edi,%eax
or     %eax,0x40022000
ret

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

LLVM IR (-O2):
define void @flash_set_waitstates(i32 %0) {
%2 = load volatile i32, i32* inttoptr (i64 1073881088 to i32*)
%3 = and i32 %2, 3
%4 = icmp eq i32 %3, %0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = and i32 %2, -4
%7 = or i32 %6, %0
%8 = load volatile i32, i32* inttoptr (i64 1073881088 to i32*)
%9 = or i32 %7, %8
store volatile i32 %9, i32* inttoptr (i64 1073881088 to i32*)
br label %10
10: ; preds = %5, %1
ret void
}
void draw_check(void) {}


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

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

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

LLVM IR (-O2):
define void @draw_check() {
ret void
}
/* Variables and functions */
scalar_t__ IsPrime(int);
int /*<<< orphan*/ printf(char *, int);
main() {
  int i;
  for (i = 101; i < 200; i += 2)
    if (IsPrime(i))
      printf("%d is prime\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x65,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jge    1177 <main+0x57>
mov    -0x8(%rbp),%edi
call   1040 <IsPrime@plt>
cmp    $0x0,%rax
je     1164 <main+0x44>
mov    -0x8(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    1169 <main+0x49>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x63,%ebx
lea    0xed0(%rip),%r14
jmp    1148 <main+0x28>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0xc6,%ebx
jae    1163 <main+0x43>
add    $0x2,%ebx
mov    %ebx,%edi
call   1040 <IsPrime@plt>
test   %rax,%rax
je     1140 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%d is prime\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 101, i32* %2
br label %3
3: ; preds = %14, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 200
br i1 %5, label %6, label %17
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i64 @IsPrime(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %6
br label %14
14: ; preds = %13
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 2
store i32 %16, i32* %2
br label %3
17: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d is prime\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 101, %0 ], [ %8, %7 ]
%3 = tail call i64 @IsPrime(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %1, %5
%8 = add nuw nsw i32 %2, 2
%9 = icmp ult i32 %2, 198
br i1 %9, label %1, label %10
10: ; preds = %7
ret i32 0
}
/* Variables and functions */
double pow(double, double);
double itor(double interval) { return pow((1.0594630943592953), interval); }


x86 assembly (clang, -O0):
<itor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xed6(%rip),%xmm0
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itor>:
movaps %xmm0,%xmm1
movsd  0xee5(%rip),%xmm0
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @itor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double 0x3FF0F38F92D97963, double %3)
ret double %4
}

LLVM IR (-O2):
define double @itor(double %0) {
%2 = tail call double @pow(double 0x3FF0F38F92D97963, double %0)
ret double %2
}
const char *str_expr_block(void) { return "block"; }


x86 assembly (clang, -O0):
<str_expr_block>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_expr_block>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"block\00"
define i8* @str_expr_block() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"block\00"
define i8* @str_expr_block() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ geteuid();
int check_root(void) {
  static int is_root = -1;
  if (is_root < 0)
    is_root = !geteuid();
  return is_root;
}


x86 assembly (clang, -O0):
<check_root>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f0d(%rip)
jge    113b <check_root+0x2b>
mov    $0x0,%al
call   1030 <geteuid@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,0x2eed(%rip)
mov    0x2ee7(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_root>:
push   %rax
mov    0x2f11(%rip),%eax
test   %eax,%eax
js     111d <check_root+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <geteuid@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
mov    %eax,0x2ef5(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@check_root.is_root = internal global i32 -1
define i32 @check_root() {
%1 = load i32, i32* @check_root.is_root
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = call i32 (...) @geteuid()
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
store i32 %7, i32* @check_root.is_root
br label %8
8: ; preds = %3, %0
%9 = load i32, i32* @check_root.is_root
ret i32 %9
}

LLVM IR (-O2):
@check_root.is_root = internal unnamed_addr global i32 -1
define i32 @check_root() {
%1 = load i32, i32* @check_root.is_root
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 (...) @geteuid()
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
store i32 %6, i32* @check_root.is_root
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ %6, %3 ], [ %1, %0 ]
ret i32 %8
}
int flags(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @flags() {
ret i32 2
}

LLVM IR (-O2):
define i32 @flags() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ print_pattern(int);
int main() {
  int n = 4;
  for (int i = 0; i < n; i++) {
    print_pattern(8);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1151 <main+0x41>
mov    $0x8,%edi
call   1030 <print_pattern@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1030 <print_pattern@plt>
mov    $0x8,%edi
call   1030 <print_pattern@plt>
mov    $0x8,%edi
call   1030 <print_pattern@plt>
mov    $0x8,%edi
call   1030 <print_pattern@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print_pattern(i32 8)
%2 = tail call i32 @print_pattern(i32 8)
%3 = tail call i32 @print_pattern(i32 8)
%4 = tail call i32 @print_pattern(i32 8)
ret i32 0
}
void mem_cgroup_page_migration(struct page *page, struct page *newpage) {}


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

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

LLVM IR (-O0):
%struct.page = type opaque
define void @mem_cgroup_page_migration(%struct.page* %0, %struct.page* %1) {
%3 = alloca %struct.page*
%4 = alloca %struct.page*
store %struct.page* %0, %struct.page** %3
store %struct.page* %1, %struct.page** %4
ret void
}

LLVM IR (-O2):
%struct.page = type opaque
define void @mem_cgroup_page_migration(%struct.page* nocapture %0, %struct.page* nocapture %1) {
ret void
}
int test_imm_9Bint64_midword_reg(long long val) {
  return ((val >> 16) & (0x9B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_9Bint64_midword_reg>:
test   $0x9b0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Bint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 155
%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_9Bint64_midword_reg(i64 %0) {
%2 = and i64 %0, 10158080
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ putc(char);
int /*<<< orphan*/ putdln(int);
int /*<<< orphan*/ puts(char *);
void section(char name[], int align) {
  putc('\n');
  puts("\tsection .");
  puts(name);
  puts(" align=");
  putdln(align);
}


x86 assembly (clang, -O0):
<section>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xa,%edi
call   1050 <putc@plt>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
mov    -0xc(%rbp),%edi
call   1040 <putdln@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<section>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0xa,%edi
call   1050 <putc@plt>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <putdln@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\09section .\00"
@.str.1 = [8 x i8] c" align=\00"
define void @section(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @putc(i8 signext 10)
%6 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
%8 = call i32 @puts(i8* %7)
%9 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %4
%11 = call i32 @putdln(i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\09section .\00"
@.str.1 = [8 x i8] c" align=\00"
define void @section(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @putc(i8 signext 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) %0)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @putdln(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void version() { printf("nSense (NS) Build (0.0.0)"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"nSense (NS) Build (0.0.0)\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"nSense (NS) Build (0.0.0)\00"
define void @version() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ ceil(double);
float ceilf_tml(float f) { return (float)ceil((double)f); }


x86 assembly (clang, -O0):
<ceilf_tml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <ceil@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceilf_tml>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <ceil@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ceilf_tml(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @ceil(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @ceilf_tml(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @ceil(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int xs2qpa(int);
int xs2qpa_(int *panelid) { return xs2qpa(*panelid); }


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

x86 assembly (clang, -O2):
<xs2qpa_>:
mov    (%rdi),%edi
jmp    1030 <xs2qpa@plt>

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

LLVM IR (-O2):
define i32 @xs2qpa_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @xs2qpa(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ japi_setsize(int, int, int);
void j_setsize(int arg0, int arg1, int arg2) { japi_setsize(arg0, arg1, arg2); }


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

x86 assembly (clang, -O2):
<j_setsize>:
jmp    1030 <japi_setsize@plt>

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

LLVM IR (-O2):
define void @j_setsize(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @japi_setsize(i32 %0, i32 %1, i32 %2)
ret void
}
void rtp_initialization_extra(void) {}


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

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

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

LLVM IR (-O2):
define void @rtp_initialization_extra() {
ret void
}
const void *fdt_offset_ptr_(const void *fdt, int offset) {
  return (const char *)fdt + fdt_off_dt_struct(fdt) + offset;
}


x86 assembly (clang, -O0):
<fdt_offset_ptr_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <fdt_off_dt_struct@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdt_offset_ptr_>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <fdt_off_dt_struct@plt>
movslq %eax,%rcx
add    %rbx,%rcx
movslq %ebp,%rax
add    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @fdt_offset_ptr_(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 i8*, i8** %3
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @fdt_off_dt_struct to i32 (i8*, ...)*)(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
ret i8* %12
}

LLVM IR (-O2):
define i8* @fdt_offset_ptr_(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fdt_off_dt_struct to i32 (i8*, ...)*)(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %5, i64 %6
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, int);
void Q_strncpyz(char *dest, const char *src, int destsize) {
  strncpy(dest, src, destsize - 1);
  dest[destsize - 1] = 0;
}


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

x86 assembly (clang, -O2):
<Q_strncpyz>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movslq %edx,%rbx
lea    -0x1(%rbx),%rdx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @Q_strncpyz(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = sub nsw i32 %9, 1
%11 = call i32 @strncpy(i8* %7, i8* %8, i32 %10)
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
store i8 0, i8* %16
ret void
}

LLVM IR (-O2):
define void @Q_strncpyz(i8* %0, i8* %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %4)
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pnp_read_config(unsigned char, int);
int pnp_read_enable(unsigned char port) {
  return !!pnp_read_config(port, 0x30);
}


x86 assembly (clang, -O0):
<pnp_read_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x30,%esi
movzbl -0x1(%rbp),%edi
call   1030 <pnp_read_config@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pnp_read_enable>:
push   %rax
mov    $0x30,%esi
call   1030 <pnp_read_config@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pnp_read_enable(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @pnp_read_config(i8 zeroext %3, i32 48)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @pnp_read_enable(i8 zeroext %0) {
%2 = tail call i32 @pnp_read_config(i8 zeroext %0, i32 48)
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int hello();
int main() { return hello(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @hello()
ret i32 %1
}
void _CRT_INIT() {}


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

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

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

LLVM IR (-O2):
define void @_CRT_INIT() {
ret void
}
char *yperr_string(incode)
int incode;
{
  static char err[80];
  if (incode == 0)
    return "Success";
  snprintf(err, sizeof(err), "YP FAKE error %d\n", incode);
  return err;
}


x86 assembly (clang, -O0):
<yperr_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1135 <yperr_string+0x25>
lea    0xed4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115d <yperr_string+0x4d>
mov    -0xc(%rbp),%ecx
lea    0x2f01(%rip),%rdi
mov    $0x50,%esi
lea    0xebd(%rip),%rdx
mov    $0x0,%al
call   1030 <snprintf@plt>
lea    0x2ee7(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yperr_string>:
push   %rbx
test   %edi,%edi
je     1136 <yperr_string+0x26>
mov    %edi,%ecx
lea    0x2f22(%rip),%rbx
lea    0xee3(%rip),%rdx
mov    $0x50,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <snprintf@plt>
jmp    113d <yperr_string+0x2d>
lea    0xec3(%rip),%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@yperr_string.err = internal global [80 x i8] zeroinitializer
@.str = [8 x i8] c"Success\00"
@.str.1 = [18 x i8] c"YP FAKE error %d\0A\00"
define i8* @yperr_string(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @yperr_string.err, i64 0, i64 0), i64 80, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %8)
store i8* getelementptr inbounds ([80 x i8], [80 x i8]* @yperr_string.err, i64 0, i64 0), i8** %2
br label %10
10: ; preds = %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@yperr_string.err = internal global [80 x i8] zeroinitializer
@.str = [8 x i8] c"Success\00"
@.str.1 = [18 x i8] c"YP FAKE error %d\0A\00"
define i8* @yperr_string(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (i8*, i64, i8*, ...) @snprintf(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @yperr_string.err, i64 0, i64 0), i64 80, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ getelementptr inbounds ([80 x i8], [80 x i8]* @yperr_string.err, i64 0, i64 0), %3 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ static_assert(int, char *);
void assertions() {
  static_assert(sizeof(float) == sizeof(uint32_t), "incompatible float type");
  static_assert(sizeof(double) == sizeof(uint64_t), "incompatible double type");
  static_assert(sizeof(intptr_t) == sizeof(uint32_t) ||
                    sizeof(intptr_t) == sizeof(uint64_t),
                "incompatible pointer type");
}


x86 assembly (clang, -O0):
<assertions>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <static_assert@plt>
xor    %edi,%edi
lea    0xeea(%rip),%rsi
call   1030 <static_assert@plt>
xor    %edi,%edi
lea    0xef5(%rip),%rsi
call   1030 <static_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertions>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
call   1030 <static_assert@plt>
lea    0xeef(%rip),%rsi
xor    %edi,%edi
call   1030 <static_assert@plt>
lea    0xefa(%rip),%rsi
xor    %edi,%edi
pop    %rax
jmp    1030 <static_assert@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"incompatible float type\00"
@.str.1 = [25 x i8] c"incompatible double type\00"
@.str.2 = [26 x i8] c"incompatible pointer type\00"
define void @assertions() {
%1 = call i32 @static_assert(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @static_assert(i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @static_assert(i32 0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"incompatible float type\00"
@.str.1 = [25 x i8] c"incompatible double type\00"
@.str.2 = [26 x i8] c"incompatible pointer type\00"
define void @assertions() {
%1 = tail call i32 @static_assert(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @static_assert(i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @static_assert(i32 0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
ret void
}