xunge/DecIR huggingface dataset:
/* Variables and functions */
double ass_strtod(char *, char **);
int mystrtoll(char **p, long long *res) {
  char *start = *p;
  double temp_res = ass_strtod(*p, p);
  *res = (long long)(temp_res + (temp_res > 0 ? 0.5 : -0.5));
  return *p != start;
}


x86 assembly (clang, -O0):
<mystrtoll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <ass_strtod@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  0xeae(%rip),%xmm4
movsd  0xeae(%rip),%xmm3
xorps  %xmm1,%xmm1
cmpltsd %xmm2,%xmm1
movaps %xmm1,%xmm2
andpd  %xmm4,%xmm2
andnpd %xmm3,%xmm1
orpd   %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrtoll>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <ass_strtod@plt>
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
lea    0xec3(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,(%r14)
xor    %eax,%eax
cmp    %r15,(%rbx)
setne  %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @mystrtoll(i8** %0, i64* %1) {
%3 = alloca i8**
%4 = alloca i64*
%5 = alloca i8*
%6 = alloca double
store i8** %0, i8*** %3
store i64* %1, i64** %4
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
store i8* %8, i8** %5
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
%11 = load i8**, i8*** %3
%12 = call double @ass_strtod(i8* %10, i8** %11)
store double %12, double* %6
%13 = load double, double* %6
%14 = load double, double* %6
%15 = fcmp ogt double %14, 0.000000e+00
%16 = zext i1 %15 to i64
%17 = select i1 %15, double 5.000000e-01, double -5.000000e-01
%18 = fadd double %13, %17
%19 = fptosi double %18 to i64
%20 = load i64*, i64** %4
store i64 %19, i64* %20
%21 = load i8**, i8*** %3
%22 = load i8*, i8** %21
%23 = load i8*, i8** %5
%24 = icmp ne i8* %22, %23
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @mystrtoll(i8** %0, i64* nocapture writeonly %1) {
%3 = load i8*, i8** %0
%4 = tail call double @ass_strtod(i8* %3, i8** %0)
%5 = fcmp ogt double %4, 0.000000e+00
%6 = select i1 %5, double 5.000000e-01, double -5.000000e-01
%7 = fadd double %4, %6
%8 = fptosi double %7 to i64
store i64 %8, i64* %1
%9 = load i8*, i8** %0
%10 = icmp ne i8* %9, %3
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  char name[] = {'R', 'o', 'b', 'e', 'r', 't'};
  printf("\n[Press Enter to close]");
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.name = [6 x i8] c"Robert"
@.str = [24 x i8] c"\0A[Press Enter to close]\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
store i32 0, i32* %1
%3 = bitcast [6 x i8]* %2 to i8*
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0A[Press Enter to close]\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
uint8_t mem_read8(uint8_t *mem, uint16_t addr) {
  if (addr >= 0xFFFF) {
    puts("OOB RAM READ 8\n");
    exit(0);
  }
  return mem[addr];
}


x86 assembly (clang, -O0):
<mem_read8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xffff,-0xc(%rbp)
jl     114f <mem_read8+0x2f>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_read8>:
push   %rax
cmp    $0xffff,%esi
jge    1131 <mem_read8+0x11>
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
pop    %rcx
ret
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"OOB RAM READ 8\0A\00"
define i32 @mem_read8(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sge i32 %5, 65535
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %2
%11 = load i32*, i32** %3
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
ret i32 %15
}

LLVM IR (-O2):
@.str = [16 x i8] c"OOB RAM READ 8\0A\00"
define i32 @mem_read8(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 65534
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("Starting mac! %s\n", argv[1]);
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"Starting mac! %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Starting mac! %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
long long __nv_float2ll_rn(float);
long long __float2ll_rn(float __a) { return __nv_float2ll_rn(__a); }


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

x86 assembly (clang, -O2):
<__float2ll_rn>:
jmp    1030 <__nv_float2ll_rn@plt>

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

LLVM IR (-O2):
define i64 @__float2ll_rn(float %0) {
%2 = tail call i64 @__nv_float2ll_rn(float %0)
ret i64 %2
}
/* Variables and functions */
char *n_strncpy(char *dest, const char *src, size_t n) {
  while ((*dest++ = *src++)) {
    n--;
    if (n == 0)
      break;
  }
  dest--;
  *dest = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<n_strncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     115b <n_strncpy+0x5b>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1156 <n_strncpy+0x56>
jmp    115b <n_strncpy+0x5b>
jmp    1110 <n_strncpy+0x10>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_strncpy>:
add    $0xffffffffffffffff,%rdx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%r8d
mov    %r8b,(%rdi,%rax,1)
lea    0x1(%rax),%rcx
test   %r8b,%r8b
je     112a <n_strncpy+0x2a>
cmp    %rax,%rdx
mov    %rcx,%rax
jne    1110 <n_strncpy+0x10>
lea    (%rdi,%rcx,1),%rax
add    $0xffffffffffffffff,%rax
movb   $0x0,-0x1(%rdi,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @n_strncpy(i8* writeonly %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i8* [ %0, %3 ], [ %10, %4 ]
%6 = phi i8* [ %1, %3 ], [ %11, %4 ]
%7 = phi i64 [ %2, %3 ], [ %12, %4 ]
%8 = load i8, i8* %6
store i8 %8, i8* %5
%9 = icmp eq i8 %8, 0
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = add i64 %7, -1
%13 = icmp eq i64 %12, 0
%14 = select i1 %9, i1 true, i1 %13
br i1 %14, label %15, label %4
15: ; preds = %4
store i8 0, i8* %5
ret i8* %5
}
/* Type definitions */
struct sigaction {
  void (*sa_handler)(int);
  scalar_t__ sa_flags;
  int /*<<< orphan*/ sa_mask;
};

/* Variables and functions */
int /*<<< orphan*/ sigaction(int, struct sigaction *, int /*<<< orphan*/);
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
void install_handler(int sig, void (*handler)(int sig)) {
  struct sigaction s;
  s.sa_handler = handler;
  sigfillset(&s.sa_mask);
  s.sa_flags = 0;
  sigaction(sig, &s, 0);
}


x86 assembly (clang, -O0):
<install_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x28(%rbp),%rdi
add    $0x10,%rdi
call   1040 <sigfillset@plt>
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x28(%rbp),%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<install_handler>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
mov    %rsi,0x8(%rsp)
lea    0x18(%rsp),%rdi
call   1040 <sigfillset@plt>
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    %ebx,%edi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.sigaction = type { void (i32)*, i64, i32 }
define void @install_handler(i32 %0, void (i32)* %1) {
%3 = alloca %struct.sigaction
%4 = bitcast %struct.sigaction* %3 to i8*
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 0
store void (i32)* %1, void (i32)** %5
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 2
%7 = call i32 @sigfillset(i32* %6)
%8 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 1
store i64 0, i64* %8
%9 = call i32 @sigaction(i32 %0, %struct.sigaction* %3, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_add_epi64(int /*<<< orphan*/ const, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_set_epi32(int, int, int, int);
int /*<<< orphan*/ _mm_srli_si128(int /*<<< orphan*/ const, int);
__m128i dct_const_round_shift_64bit(const __m128i in) {
  const __m128i t =
      _mm_add_epi64(in, _mm_set_epi32((int)(0), (int)((1 << (14 - 1)) << 2),
                                      (int)(0), (int)((1 << (14 - 1)) << 2)));
  return _mm_srli_si128(t, 2);
}


x86 assembly (clang, -O0):
<dct_const_round_shift_64bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %edx,%edx
mov    $0x8000,%ecx
mov    %edx,%edi
mov    %ecx,%esi
call   1030 <_mm_set_epi32@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1050 <_mm_add_epi64@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1040 <_mm_srli_si128@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dct_const_round_shift_64bit>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
mov    $0x8000,%esi
xor    %edx,%edx
mov    $0x8000,%ecx
call   1030 <_mm_set_epi32@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1050 <_mm_add_epi64@plt>
mov    %eax,%edi
mov    $0x2,%esi
pop    %rbx
jmp    1040 <_mm_srli_si128@plt>

LLVM IR (-O0):
define i32 @dct_const_round_shift_64bit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @_mm_set_epi32(i32 0, i32 32768, i32 0, i32 32768)
%6 = call i32 @_mm_add_epi64(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @_mm_srli_si128(i32 %7, i32 2)
ret i32 %8
}

LLVM IR (-O2):
define i32 @dct_const_round_shift_64bit(i32 %0) {
%2 = tail call i32 @_mm_set_epi32(i32 0, i32 32768, i32 0, i32 32768)
%3 = tail call i32 @_mm_add_epi64(i32 %0, i32 %2)
%4 = tail call i32 @_mm_srli_si128(i32 %3, i32 2)
ret i32 %4
}
/* Type definitions */
struct iwl_priv {
  int dummy;
};

/* Variables and functions */
int iwl_legacy_is_ready(struct iwl_priv *);
scalar_t__ iwl_legacy_is_rfkill(struct iwl_priv *);
int iwl_legacy_is_ready_rf(struct iwl_priv *priv) {
  if (iwl_legacy_is_rfkill(priv))
    return 0;
  return iwl_legacy_is_ready(priv);
}


x86 assembly (clang, -O0):
<iwl_legacy_is_ready_rf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <iwl_legacy_is_rfkill@plt>
cmp    $0x0,%rax
je     114b <iwl_legacy_is_ready_rf+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1157 <iwl_legacy_is_ready_rf+0x37>
mov    -0x10(%rbp),%rdi
call   1030 <iwl_legacy_is_ready@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iwl_legacy_is_ready_rf>:
push   %rbx
mov    %rdi,%rbx
call   1040 <iwl_legacy_is_rfkill@plt>
test   %rax,%rax
je     1132 <iwl_legacy_is_ready_rf+0x12>
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <iwl_legacy_is_ready@plt>

LLVM IR (-O0):
%struct.iwl_priv = type { i32 }
define i32 @iwl_legacy_is_ready_rf(%struct.iwl_priv* %0) {
%2 = alloca i32
%3 = alloca %struct.iwl_priv*
store %struct.iwl_priv* %0, %struct.iwl_priv** %3
%4 = load %struct.iwl_priv*, %struct.iwl_priv** %3
%5 = call i64 @iwl_legacy_is_rfkill(%struct.iwl_priv* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %11
8: ; preds = %1
%9 = load %struct.iwl_priv*, %struct.iwl_priv** %3
%10 = call i32 @iwl_legacy_is_ready(%struct.iwl_priv* %9)
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.iwl_priv = type { i32 }
define i32 @iwl_legacy_is_ready_rf(%struct.iwl_priv* %0) {
%2 = tail call i64 @iwl_legacy_is_rfkill(%struct.iwl_priv* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @iwl_legacy_is_ready(%struct.iwl_priv* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void err(FILE *out) {}


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

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

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

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

/* Variables and functions */
int contains_data(int /*<<< orphan*/ *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int is_fat_12_fs(FILE *fp) {
  char *szMagic = "FAT12   ";
  return contains_data(fp, 0x36, szMagic, strlen(szMagic));
}


x86 assembly (clang, -O0):
<is_fat_12_fs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
mov    $0x36,%esi
call   1040 <contains_data@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_fat_12_fs>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    $0x36,%esi
mov    %r14,%rdx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <contains_data@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"FAT12 \00"
define i32 @is_fat_12_fs(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i32* %0, i32** %2
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32*, i32** %2
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @contains_data(i32* %4, i32 54, i8* %5, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [9 x i8] c"FAT12 \00"
define i32 @is_fat_12_fs(i32* %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @contains_data(i32* %0, i32 54, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a = 5;
  int b = 3;
  printf("a=%d b=%d comma operator=%d \n", a, b, (a += 2, b, a + b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x5,%esi
mov    $0x3,%edx
mov    $0xa,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"a=%d b=%d comma operator=%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 5, i32* %1
store i32 3, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 2
store i32 %6, i32* %1
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = add nsw i32 %8, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"a=%d b=%d comma operator=%d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 5, i32 3, i32 10)
ret i32 0
}
void gravity_calculate_variational_acceleration(void) {}


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

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

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

LLVM IR (-O2):
define void @gravity_calculate_variational_acceleration() {
ret void
}
/* Variables and functions */
int to_sign(bool b) { return 2 * b - 1; }


x86 assembly (clang, -O0):
<to_sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_sign>:
lea    (%rdi,%rdi,1),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @to_sign(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
%5 = sub nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @to_sign(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, -1
ret i32 %3
}
unsigned int getImageSize(unsigned int pid) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getImageSize(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ configure_test_enemies();
int /*<<< orphan*/ main_loop();
int /*<<< orphan*/ select_character();
void new_game() {
  select_character();
  configure_test_enemies();
  main_loop();
}


x86 assembly (clang, -O0):
<new_game>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <select_character@plt>
mov    $0x0,%al
call   1040 <configure_test_enemies@plt>
mov    $0x0,%al
call   1050 <main_loop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_game>:
push   %rax
xor    %eax,%eax
call   1030 <select_character@plt>
xor    %eax,%eax
call   1040 <configure_test_enemies@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <main_loop@plt>

LLVM IR (-O0):
define void @new_game() {
%1 = call i32 (...) @select_character()
%2 = call i32 (...) @configure_test_enemies()
%3 = call i32 (...) @main_loop()
ret void
}

LLVM IR (-O2):
define void @new_game() {
%1 = tail call i32 (...) @select_character()
%2 = tail call i32 (...) @configure_test_enemies()
%3 = tail call i32 (...) @main_loop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ logger(char *);
void crashed(void) {
  logger("crashed. halting the CPU.");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<crashed>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <logger@plt>
jmp    1120 <crashed+0x10>

x86 assembly (clang, -O2):
<crashed>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <logger@plt>
nopl   (%rax)
jmp    1120 <crashed+0x10>

LLVM IR (-O0):
@.str = [26 x i8] c"crashed. halting the CPU.\00"
define void @crashed() {
%1 = call i32 @logger(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [26 x i8] c"crashed. halting the CPU.\00"
define void @crashed() {
%1 = tail call i32 @logger(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
void cli_halt(void) { asm volatile("cli ; hlt"); }


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

x86 assembly (clang, -O2):
<cli_halt>:
cli
hlt
ret

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

LLVM IR (-O2):
define void @cli_halt() {
tail call void asm sideeffect "cli ; hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void version(FILE *f) {
  fprintf(f, "peflags version %s\n", "Geoffroy Couprie");
  fprintf(f, "Copyright (c) 2009  Charles Wilson, Dave Korn, Jason Tishler\n");
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xee6(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xee5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
lea    0xee2(%rip),%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xee5(%rip),%rdi
mov    $0x3d,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"peflags version %s\0A\00"
@.str.1 = [17 x i8] c"Geoffroy Couprie\00"
@.str.2 = [62 x i8] c"Copyright (c) 2009 Charles Wilson, Dave Korn, Jason Tishler\0A\00"
define void @version(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"peflags version %s\0A\00"
@.str.1 = [17 x i8] c"Geoffroy Couprie\00"
@.str.2 = [62 x i8] c"Copyright (c) 2009 Charles Wilson, Dave Korn, Jason Tishler\0A\00"
define void @version(i32* nocapture %0) {
%2 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0), i64 61, i64 1, i32* %0)
ret void
}
main(c) {
  while (c = ~getchar())
    printf("%c ", ~c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
xor    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1161 <main+0x41>
mov    -0x8(%rbp),%esi
xor    $0xffffffff,%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1132 <main+0x12>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xffffffff,%eax
je     1158 <main+0x38>
lea    0xecc(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xffffffff,%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c \00"
define i32 @main(i32 %0) {
%2 = tail call i32 (...) @getchar()
%3 = icmp eq i32 %2, -1
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchr(int /*<<< orphan*/);
void tputs(register char *s) {
  while (*s)
    putchr(*s++);
}


x86 assembly (clang, -O0):
<tputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <tputs+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchr@plt>
jmp    111c <tputs+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tputs>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <tputs+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchr@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <tputs+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @tputs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putchr(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mmcau_md5_hash_n(unsigned int *, int, unsigned int *);
int /*<<< orphan*/ mmcau_md5_initialize_output(unsigned int *);
void mmcau_md5_update(unsigned int msg_data[], int num_blks,
                      unsigned int md_state[]) {
  mmcau_md5_initialize_output(md_state);
  mmcau_md5_hash_n(msg_data, num_blks, md_state);
}


x86 assembly (clang, -O0):
<mmcau_md5_update>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <mmcau_md5_initialize_output@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <mmcau_md5_hash_n@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmcau_md5_update>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rdx,%rdi
call   1040 <mmcau_md5_initialize_output@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <mmcau_md5_hash_n@plt>

LLVM IR (-O0):
define void @mmcau_md5_update(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** %6
%8 = call i32 @mmcau_md5_initialize_output(i32* %7)
%9 = load i32*, i32** %4
%10 = load i32, i32* %5
%11 = load i32*, i32** %6
%12 = call i32 @mmcau_md5_hash_n(i32* %9, i32 %10, i32* %11)
ret void
}

LLVM IR (-O2):
define void @mmcau_md5_update(i32* %0, i32 %1, i32* %2) {
%4 = tail call i32 @mmcau_md5_initialize_output(i32* %2)
%5 = tail call i32 @mmcau_md5_hash_n(i32* %0, i32 %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void logback(char *s) { fprintf(stderr, "LibSAM: %s\n", s); }


x86 assembly (clang, -O0):
<logback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logback>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"LibSAM: %s\0A\00"
define void @logback(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"LibSAM: %s\0A\00"
define void @logback(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ foo();
scalar_t__ jump();
int main(void) {
loop:
  foo();
  if (jump())
    goto loop;
  cleanup();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1040 <jump@plt>
cmp    $0x0,%rax
je     115c <main+0x2c>
jmp    113f <main+0xf>
mov    $0x0,%al
call   1050 <cleanup@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <jump@plt>
test   %rax,%rax
jne    1140 <main+0x10>
xor    %eax,%eax
call   1050 <cleanup@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @foo()
%3 = tail call i64 (...) @jump()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
%6 = tail call i32 (...) @cleanup()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGHUP;
int /*<<< orphan*/ SIGTSTP;
int /*<<< orphan*/ SIGTTIN;
int /*<<< orphan*/ SIGTTOU;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void ignore_signals(void) {
  signal(SIGTTOU, SIG_IGN);
  signal(SIGTTIN, SIG_IGN);
  signal(SIGTSTP, SIG_IGN);
  signal(SIGHUP, SIG_IGN);
}


x86 assembly (clang, -O0):
<ignore_signals>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    0x2e76(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    0x2e5f(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_signals>:
push   %rbx
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rbx
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
pop    %rbx
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGTTOU = global i32 0
@SIG_IGN = global i32 0
@SIGTTIN = global i32 0
@SIGTSTP = global i32 0
@SIGHUP = global i32 0
define void @ignore_signals() {
%1 = load i32, i32* @SIGTTOU
%2 = load i32, i32* @SIG_IGN
%3 = call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGTTIN
%5 = load i32, i32* @SIG_IGN
%6 = call i32 @signal(i32 %4, i32 %5)
%7 = load i32, i32* @SIGTSTP
%8 = load i32, i32* @SIG_IGN
%9 = call i32 @signal(i32 %7, i32 %8)
%10 = load i32, i32* @SIGHUP
%11 = load i32, i32* @SIG_IGN
%12 = call i32 @signal(i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@SIGTTOU = global i32 0
@SIG_IGN = global i32 0
@SIGTTIN = global i32 0
@SIGTSTP = global i32 0
@SIGHUP = global i32 0
define void @ignore_signals() {
%1 = load i32, i32* @SIGTTOU
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGTTIN
%5 = load i32, i32* @SIG_IGN
%6 = tail call i32 @signal(i32 %4, i32 %5)
%7 = load i32, i32* @SIGTSTP
%8 = load i32, i32* @SIG_IGN
%9 = tail call i32 @signal(i32 %7, i32 %8)
%10 = load i32, i32* @SIGHUP
%11 = load i32, i32* @SIG_IGN
%12 = tail call i32 @signal(i32 %10, i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *, int, int **);
int main(void) {
  int *a = malloc(sizeof(int));
  free(a);
  a = NULL;
  int *b = malloc(sizeof(int));
  *b = 128;
  printf("a: %d, %p\n", *a, &a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x80,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xe84(%rip),%rdi
lea    -0x8(%rbp),%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [11 x i8] c"a: %d, %p\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* @malloc(i32 4)
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @free(i32* %4)
store i32* null, i32** %1
%6 = call i32* @malloc(i32 4)
store i32* %6, i32** %2
%7 = load i32*, i32** %2
store i32 128, i32* %7
%8 = load i32*, i32** %1
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %9, i32** %1)
ret i32 0
}

LLVM IR (-O2):
void __attribute__((__warning__(
    "curl_easy_setopt expects a curl_write_callback argument for this option")))
__attribute__((__unused__)) __attribute__((__no__))
_curl_easy_setopt_err_write_callback(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_write_callback() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int hello_add(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<hello_add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @hello_add(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @hello_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int foo(double xx, double xy) {
  int p = xx < xy;
  int np = !p;
  if (np)
    return 5;
  return 2;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     114e <foo+0x4e>
movl   $0x5,-0x4(%rbp)
jmp    1155 <foo+0x55>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setbe  %al
lea    (%rax,%rax,2),%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @foo(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca i32
%7 = alloca i32
store double %0, double* %4
store double %1, double* %5
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fcmp olt double %8, %9
%11 = zext i1 %10 to i32
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
%15 = zext i1 %14 to i32
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %2
store i32 5, i32* %3
br label %20
19: ; preds = %2
store i32 2, i32* %3
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @foo(double %0, double %1) {
%3 = fcmp uge double %0, %1
%4 = select i1 %3, i32 5, i32 2
ret i32 %4
}
int main(void) {
  *(char *)10;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i8, i8* inttoptr (i64 10 to i8*)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PSTR(char *);
int /*<<< orphan*/ writePgmStringToSerial(int /*<<< orphan*/);
void writeNewLine() { writePgmStringToSerial(PSTR("\r\n")); }


x86 assembly (clang, -O0):
<writeNewLine>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <PSTR@plt>
mov    %eax,%edi
call   1040 <writePgmStringToSerial@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeNewLine>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <PSTR@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <writePgmStringToSerial@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define void @writeNewLine() {
%1 = call i32 @PSTR(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @writePgmStringToSerial(i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @writeNewLine() {
%1 = tail call i32 @PSTR(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @writePgmStringToSerial(i32 %1)
ret void
}
/* Variables and functions */
int rom_present(char *);
int ati28800_available(void) {
  return (rom_present(L"roms/video/ati28800/bios.bin"));
}


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

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

LLVM IR (-O0):
@.str = [29 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 97, i32 116, i32 105, i32 50, i32 56, i32 56, i32 48, i32 48, i32 47, i32 98, i32 105, i32 111, i32 115, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @ati28800_available() {
%1 = call i32 @rom_present(i8* bitcast ([29 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [29 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 97, i32 116, i32 105, i32 50, i32 56, i32 56, i32 48, i32 48, i32 47, i32 98, i32 105, i32 111, i32 115, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @ati28800_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([29 x i32]* @.str to i8*))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ gpio_config(int, int, int);
void led_init(void) {
  gpio_config(9, 10, (1));
  gpio_config(0, 15, (1));
}


x86 assembly (clang, -O0):
<led_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%edi
mov    $0xa,%esi
mov    $0x1,%edx
call   1030 <gpio_config@plt>
xor    %edi,%edi
mov    $0xf,%esi
mov    $0x1,%edx
call   1030 <gpio_config@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_init>:
push   %rax
mov    $0x9,%edi
mov    $0xa,%esi
mov    $0x1,%edx
call   1030 <gpio_config@plt>
xor    %edi,%edi
mov    $0xf,%esi
mov    $0x1,%edx
pop    %rax
jmp    1030 <gpio_config@plt>

LLVM IR (-O0):
define void @led_init() {
%1 = call i32 @gpio_config(i32 9, i32 10, i32 1)
%2 = call i32 @gpio_config(i32 0, i32 15, i32 1)
ret void
}

LLVM IR (-O2):
define void @led_init() {
%1 = tail call i32 @gpio_config(i32 9, i32 10, i32 1)
%2 = tail call i32 @gpio_config(i32 0, i32 15, i32 1)
ret void
}
double fahr2cels(double fahrenheit) { return (fahrenheit - 32.0) * 5.0 / 9.0; }


x86 assembly (clang, -O0):
<fahr2cels>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xefa(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahr2cels>:
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @fahr2cels(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 3.200000e+01
%5 = fmul double %4, 5.000000e+00
%6 = fdiv double %5, 9.000000e+00
ret double %6
}

LLVM IR (-O2):
define double @fahr2cels(double %0) {
%2 = fadd double %0, -3.200000e+01
%3 = fmul double %2, 5.000000e+00
%4 = fdiv double %3, 9.000000e+00
ret double %4
}
int fun979() { return 979; }


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

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

LLVM IR (-O0):
define i32 @fun979() {
ret i32 979
}

LLVM IR (-O2):
define i32 @fun979() {
ret i32 979
}
/* Variables and functions */
int /*<<< orphan*/ expect(int, char *);
void expect_not(int value, char *description) {
  expect(value == -1 ? 0 : -1, description);
}


x86 assembly (clang, -O0):
<expect_not>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0xffffffff,%ecx
cmove  %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <expect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_not>:
xor    %eax,%eax
cmp    $0xffffffff,%edi
setne  %al
neg    %eax
mov    %eax,%edi
jmp    1030 <expect@plt>

LLVM IR (-O0):
define void @expect_not(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, -1
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 0, i32 -1
%9 = load i8*, i8** %4
%10 = call i32 @expect(i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @expect_not(i32 %0, i8* %1) {
%3 = icmp ne i32 %0, -1
%4 = sext i1 %3 to i32
%5 = tail call i32 @expect(i32 %4, i8* %1)
ret void
}
int fn3(int i) {
  switch (i) {
  case 1:
    if (i == 5)
      goto done;
    else
      goto done;
  }
done:;
}


x86 assembly (clang, -O0):
<fn3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
jne    112c <fn3+0x2c>
jmp    1118 <fn3+0x18>
cmpl   $0x5,-0x8(%rbp)
jne    1127 <fn3+0x27>
jmp    1131 <fn3+0x31>
jmp    1131 <fn3+0x31>
jmp    1131 <fn3+0x31>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %10 [
i32 1, label %5
]
5: ; preds = %1
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 5
br i1 %7, label %8, label %9
8: ; preds = %5
br label %11
9: ; preds = %5
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %9, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @fn3(i32 %0) {
ret i32 undef
}
void RTLockValidatorIsEnabled(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorIsEnabled() {
ret void
}