xunge/DecIR huggingface dataset:
void McASPDITChanStatWrite(unsigned int baseAddr, unsigned int chStatBits,
                           unsigned int channel, unsigned int data) {
  if ((0x000000F0) & channel) {
    (*((volatile unsigned int *)(baseAddr + (0x100 + (chStatBits * 4))))) =
        data;
  }
  if ((0x0000000F) & channel) {
    (*((volatile unsigned int *)(baseAddr + (0x118 + (chStatBits * 4))))) =
        data;
  }
}


x86 assembly (clang, -O0):
<McASPDITChanStatWrite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0xf0,%eax
cmp    $0x0,%eax
je     1139 <McASPDITChanStatWrite+0x39>
mov    -0x10(%rbp),%ecx
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
shl    $0x2,%edx
add    $0x100,%edx
add    %edx,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
and    $0xf,%eax
cmp    $0x0,%eax
je     1160 <McASPDITChanStatWrite+0x60>
mov    -0x10(%rbp),%ecx
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
shl    $0x2,%edx
add    $0x118,%edx
add    %edx,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPDITChanStatWrite>:
test   $0xf0,%dl
je     110f <McASPDITChanStatWrite+0xf>
lea    (%rdi,%rsi,4),%eax
add    $0x100,%eax
mov    %ecx,(%rax)
test   $0xf,%dl
je     111e <McASPDITChanStatWrite+0x1e>
lea    (%rdi,%rsi,4),%eax
add    $0x118,%eax
mov    %ecx,(%rax)
ret

LLVM IR (-O0):
define void @McASPDITChanStatWrite(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = and i32 240, %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %4
%13 = load i32, i32* %8
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = mul i32 %15, 4
%17 = add i32 256, %16
%18 = add i32 %14, %17
%19 = zext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
store volatile i32 %13, i32* %20
br label %21
21: ; preds = %12, %4
%22 = load i32, i32* %7
%23 = and i32 15, %22
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %34
25: ; preds = %21
%26 = load i32, i32* %8
%27 = load i32, i32* %5
%28 = load i32, i32* %6
%29 = mul i32 %28, 4
%30 = add i32 280, %29
%31 = add i32 %27, %30
%32 = zext i32 %31 to i64
%33 = inttoptr i64 %32 to i32*
store volatile i32 %26, i32* %33
br label %34
34: ; preds = %25, %21
ret void
}

LLVM IR (-O2):
define void @McASPDITChanStatWrite(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %2, 240
%6 = icmp eq i32 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %4
%8 = shl i32 %1, 2
%9 = add i32 %0, 256
%10 = add i32 %9, %8
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 %3, i32* %12
br label %13
13: ; preds = %7, %4
%14 = and i32 %2, 15
%15 = icmp eq i32 %14, 0
br i1 %15, label %22, label %16
16: ; preds = %13
%17 = shl i32 %1, 2
%18 = add i32 %0, 280
%19 = add i32 %18, %17
%20 = zext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
store volatile i32 %3, i32* %21
br label %22
22: ; preds = %16, %13
ret void
}
int f(int x, char c) {
  while (x > 10) {
    x++;
    c *= 2;
  }
  int z = c;
  while (c < 100) {
    c += x;
    int w = c / 2;
    x -= w;
  }
  return c;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
cmpl   $0xa,-0x4(%rbp)
jle    112f <f+0x2f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
movsbl -0x5(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x5(%rbp)
jmp    110d <f+0xd>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x64,%eax
jge    116e <f+0x6e>
mov    -0x4(%rbp),%ecx
movsbl -0x5(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <f+0x36>
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cmp    $0xb,%edi
jl     1112 <f+0x12>
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1110 <f+0x10>
cmp    $0x63,%sil
jg     1138 <f+0x38>
nopl   0x0(%rax,%rax,1)
add    %dil,%sil
mov    %esi,%eax
shr    $0x7,%al
add    %sil,%al
sar    %al
movzbl %al,%eax
sub    %eax,%edi
cmp    $0x64,%sil
jl     1120 <f+0x20>
movzbl %sil,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8 %1, i8* %4
br label %7
7: ; preds = %10, %2
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 10
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = mul nsw i32 %14, 2
%16 = trunc i32 %15 to i8
store i8 %16, i8* %4
br label %7
17: ; preds = %7
%18 = load i8, i8* %4
%19 = sext i8 %18 to i32
store i32 %19, i32* %5
br label %20
20: ; preds = %24, %17
%21 = load i8, i8* %4
%22 = sext i8 %21 to i32
%23 = icmp slt i32 %22, 100
br i1 %23, label %24, label %36
24: ; preds = %20
%25 = load i32, i32* %3
%26 = load i8, i8* %4
%27 = sext i8 %26 to i32
%28 = add nsw i32 %27, %25
%29 = trunc i32 %28 to i8
store i8 %29, i8* %4
%30 = load i8, i8* %4
%31 = sext i8 %30 to i32
%32 = sdiv i32 %31, 2
store i32 %32, i32* %6
%33 = load i32, i32* %6
%34 = load i32, i32* %3
%35 = sub nsw i32 %34, %33
store i32 %35, i32* %3
br label %20
36: ; preds = %20
%37 = load i8, i8* %4
%38 = sext i8 %37 to i32
ret i32 %38
}

LLVM IR (-O2):
define i32 @f(i32 %0, i8 signext %1) {
%3 = icmp sgt i32 %0, 10
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = icmp slt i8 %1, 100
br i1 %5, label %7, label %16
6: ; preds = %2, %6
br label %6
7: ; preds = %4, %7
%8 = phi i32 [ %14, %7 ], [ %0, %4 ]
%9 = phi i8 [ %11, %7 ], [ %1, %4 ]
%10 = trunc i32 %8 to i8
%11 = add i8 %9, %10
%12 = sdiv i8 %11, 2
%13 = zext i8 %12 to i32
%14 = sub i32 %8, %13
%15 = icmp slt i8 %11, 100
br i1 %15, label %7, label %16
16: ; preds = %7, %4
%17 = phi i8 [ %1, %4 ], [ %11, %7 ]
%18 = zext i8 %17 to i32
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void schreibe_zeichenkette(char zeichenkette[]) {
  for (int i = 0; zeichenkette[i]; i++)
    putchar(zeichenkette[i]);
}


x86 assembly (clang, -O0):
<schreibe_zeichenkette>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1154 <schreibe_zeichenkette+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <schreibe_zeichenkette+0x13>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @schreibe_zeichenkette(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8 [ %11, %5 ], [ %2, %1 ]
%8 = tail call i32 @putchar(i8 signext %7)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %4, label %5
}
float f(float x) { return x * x * x + 2 * x - 2; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xee0(%rip),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xecb(%rip),%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
addss  %xmm0,%xmm0
addss  %xmm1,%xmm0
addss  0xee5(%rip),%xmm0
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = load float, float* %2
%7 = load float, float* %2
%8 = fmul float 2.000000e+00, %7
%9 = call float @llvm.fmuladd.f32(float %5, float %6, float %8)
%10 = fsub float %9, 2.000000e+00
ret float %10
}

LLVM IR (-O2):
define float @f(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %0, 2.000000e+00
%4 = tail call float @llvm.fmuladd.f32(float %2, float %0, float %3)
%5 = fadd float %4, -2.000000e+00
ret float %5
}
int pm_wake_lock(const char *buf) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pm_wake_lock(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *stbi_zlib_decode_malloc_guesssize(char const *, int, int, int *);
char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen) {
  return stbi_zlib_decode_malloc_guesssize(buffer, len, 16384, outlen);
}


x86 assembly (clang, -O0):
<stbi_zlib_decode_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0x4000,%edx
call   1030 <stbi_zlib_decode_malloc_guesssize@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbi_zlib_decode_malloc>:
mov    %rdx,%rcx
mov    $0x4000,%edx
jmp    1030 <stbi_zlib_decode_malloc_guesssize@plt>

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

LLVM IR (-O2):
define i8* @stbi_zlib_decode_malloc(i8* %0, i32 %1, i32* %2) {
%4 = tail call i8* @stbi_zlib_decode_malloc_guesssize(i8* %0, i32 %1, i32 16384, i32* %2)
ret i8* %4
}
void csv_cstate_end_cpu(__attribute__((unused)) void *report_data) {}


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

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

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

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


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @g_unichar_isprint() {
ret void
}
int test_imm_2Cint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x2C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_2Cint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 2883584
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int unregister_dcbevent_notifier(struct notifier_block *nb) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.notifier_block = type opaque
define i32 @unregister_dcbevent_notifier(%struct.notifier_block* nocapture readnone %0) {
ret i32 0
}
int md_setsuspchar(int c) {
  (c += 0);
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @md_setsuspchar(i32 %0) {
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
char *malloc(int /*<<< orphan*/);
int /*<<< orphan*/ malloc_stats();
int /*<<< orphan*/ strlen(char *);
int main(void) {
  char text[] = "The art of Unix Programming";
  char *str = malloc(strlen(text));
  malloc_stats();
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeb2(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1050 <malloc_stats@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <strlen@plt>
xor    %eax,%eax
call   1040 <malloc_stats@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.text = [28 x i8] c"The art of Unix Programming\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [28 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [28 x i8]* %2 to i8*
%5 = getelementptr inbounds [28 x i8], [28 x i8]* %2, i64 0, i64 0
%6 = call i32 @strlen(i8* %5)
%7 = call i8* @malloc(i32 %6)
store i8* %7, i8** %3
%8 = call i32 (...) @malloc_stats()
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@__const.main.text = [28 x i8] c"The art of Unix Programming\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [28 x i8]
%2 = getelementptr inbounds [28 x i8], [28 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = call i32 (...) @malloc_stats()
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(const int array[], const unsigned len) {
  unsigned i;
  for (i = 0; i < len; i++) {
    printf("%d\t", array[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1158 <print_array+0x48>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,4),%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_array+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1157 <print_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\09\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_array(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
double prior_lower_delta(const void *data) { return *(double *)data; }


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

x86 assembly (clang, -O2):
<prior_lower_delta>:
movsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
define double @prior_lower_delta(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to double*
%5 = load double, double* %4
ret double %5
}

LLVM IR (-O2):
define double @prior_lower_delta(i8* nocapture %0) {
%2 = bitcast i8* %0 to double*
%3 = load double, double* %2
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int /*<<< orphan*/ iswgraph(int /*<<< orphan*/);
void uninitvar_iswgraph(void) {
  wint_t i;
  (void)iswgraph(i);
}


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

x86 assembly (clang, -O2):
<uninitvar_iswgraph>:
jmp    1030 <iswgraph@plt>

LLVM IR (-O0):
define void @uninitvar_iswgraph() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @iswgraph(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_iswgraph() {
%1 = tail call i32 @iswgraph(i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int squareofsum(int);
int sumofsquares(int);
int main() { printf("%d\n", squareofsum(100) - sumofsquares(100)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1050 <squareofsum@plt>
mov    %eax,-0x4(%rbp)
mov    $0x64,%edi
call   1040 <sumofsquares@plt>
mov    -0x4(%rbp),%esi
sub    %eax,%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1050 <squareofsum@plt>
mov    %eax,%ebx
mov    $0x64,%edi
call   1040 <sumofsquares@plt>
sub    %eax,%ebx
lea    0xeb0(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 @squareofsum(i32 100)
%2 = call i32 @sumofsquares(i32 100)
%3 = sub nsw i32 %1, %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @squareofsum(i32 100)
%2 = tail call i32 @sumofsquares(i32 100)
%3 = sub nsw i32 %1, %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int linear_search(int *a, int find, int n) {
  for (int i = 0; i < n; i++) {
    if (find == *(a + i)) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<linear_search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1153 <linear_search+0x53>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    1140 <linear_search+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <linear_search+0x5a>
jmp    1145 <linear_search+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <linear_search+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_search>:
mov    $0xffffffff,%eax
test   %edx,%edx
jle    111e <linear_search+0x1e>
mov    %edx,%edx
xor    %ecx,%ecx
nopl   (%rax)
cmp    %esi,(%rdi,%rcx,4)
je     111f <linear_search+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <linear_search+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @linear_search(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %1
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
long core___core__Int____62d_62d(long self, long p0) {
  long var;
  long var1;
  var1 = self >> p0;
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<core___core__Int____62d_62d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sar    %cl,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<core___core__Int____62d_62d>:
mov    %rsi,%rcx
mov    %rdi,%rax
sar    %cl,%rax
ret

LLVM IR (-O0):
define i64 @core___core__Int____62d_62d(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = ashr i64 %7, %8
store i64 %9, i64* %6
%10 = load i64, i64* %6
store i64 %10, i64* %5
br label %11
11: ; preds = %2
%12 = load i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
define i64 @core___core__Int____62d_62d(i64 %0, i64 %1) {
%3 = ashr i64 %0, %1
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
bool I2CMasterIntStatus(uint32_t ui32Base, bool bMasked) {
  ;
  if (bMasked) {
    return (((*((volatile unsigned long *)(0x40002000 + 0x00000818)))) ? true
                                                                       : false);
  } else {
    return (((*((volatile unsigned long *)(0x40002000 + 0x00000814)))) ? true
                                                                       : false);
  }
}


x86 assembly (clang, -O0):
<I2CMasterIntStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1132 <I2CMasterIntStatus+0x32>
mov    $0x40002818,%eax
mov    (%rax),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    114b <I2CMasterIntStatus+0x4b>
mov    $0x40002814,%eax
mov    (%rax),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterIntStatus>:
xor    %ecx,%ecx
test   %esi,%esi
setne  %cl
xor    %eax,%eax
cmpq   $0x0,0x40002814(,%rcx,4)
setne  %al
ret

LLVM IR (-O0):
define i32 @I2CMasterIntStatus(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load volatile i64, i64* inttoptr (i64 1073752088 to i64*)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 1, i32 0
store i32 %12, i32* %3
br label %18
13: ; preds = %2
%14 = load volatile i64, i64* inttoptr (i64 1073752084 to i64*)
%15 = icmp ne i64 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 0
store i32 %17, i32* %3
br label %18
18: ; preds = %13, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @I2CMasterIntStatus(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i64* inttoptr (i64 1073752084 to i64*), i64* inttoptr (i64 1073752088 to i64*)
%5 = load volatile i64, i64* %4
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
long strlen(const char *s) {
  int i = 0;
  while (s[i])
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     112f <strlen+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
movslq -0xc(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
mov    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = and i64 %3, 4294967295
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ prc(char);
void newline(void) { prc('\n'); }


x86 assembly (clang, -O0):
<newline>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <prc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<newline>:
mov    $0xa,%edi
jmp    1030 <prc@plt>

LLVM IR (-O0):
define void @newline() {
%1 = call i32 @prc(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @newline() {
%1 = tail call i32 @prc(i8 signext 10)
ret void
}
int main() {
  int a = 0;
  int b = 1;
  a = b = 2;
  if (a = 7) {
    b = 3;
  }
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x7,-0x8(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    113d <main+0x3d>
jmp    1144 <main+0x44>
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
store i32 2, i32* %3
store i32 2, i32* %2
store i32 7, i32* %2
br i1 true, label %4, label %5
4: ; preds = %0
store i32 3, i32* %3
br label %5
5: ; preds = %4, %0
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
ret i32 7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int, int, int, int);
void textcolor(int attr, int fg, int bg) {
  char command[13];
  sprintf(command, "%c[%d;%d;%dm", 0x1B, attr, fg + 30, bg + 40);
  printf("%s", command);
}


x86 assembly (clang, -O0):
<textcolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    -0x19(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
add    $0x1e,%r8d
mov    -0xc(%rbp),%r9d
add    $0x28,%r9d
lea    0xeb1(%rip),%rsi
mov    $0x1b,%edx
call   1040 <sprintf@plt>
lea    -0x19(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<textcolor>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ecx
lea    0x1e(%rsi),%r8d
lea    0x28(%rdx),%r9d
lea    0xeca(%rip),%rsi
lea    0x3(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1b,%edx
call   1040 <sprintf@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%c[%d;%d;%dm\00"
@.str.1 = [3 x i8] c"%s\00"
define void @textcolor(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [13 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [13 x i8], [13 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 30
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 40
%14 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 27, i32 %9, i32 %11, i32 %13)
%15 = getelementptr inbounds [13 x i8], [13 x i8]* %7, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%c[%d;%d;%dm\00"
@.str.1 = [3 x i8] c"%s\00"
define void @textcolor(i32 %0, i32 %1, i32 %2) {
%4 = alloca [13 x i8]
%5 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 0
%6 = add nsw i32 %1, 30
%7 = add nsw i32 %2, 40
%8 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 27, i32 %0, i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ run();
int main(void) {
  run();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @run()
ret i32 0
}
__attribute__((always_)) unsigned int cpumask_next(int n,
                                                   const struct cpumask *srcp) {
  return n + 1;
}


x86 assembly (clang, -O0):
<cpumask_next>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpumask_next>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
%struct.cpumask = type opaque
define i32 @cpumask_next(i32 %0, %struct.cpumask* %1) {
%3 = alloca i32
%4 = alloca %struct.cpumask*
store i32 %0, i32* %3
store %struct.cpumask* %1, %struct.cpumask** %4
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
%struct.cpumask = type opaque
define i32 @cpumask_next(i32 %0, %struct.cpumask* nocapture readnone %1) {
%3 = add nsw i32 %0, 1
ret i32 %3
}
void kgsl_cffdump_memory_base(struct kgsl_device *device, unsigned int base,
                              unsigned int range, unsigned int gmemsize) {
  return;
}


x86 assembly (clang, -O0):
<kgsl_cffdump_memory_base>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.kgsl_device = type opaque
define void @kgsl_cffdump_memory_base(%struct.kgsl_device* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.kgsl_device*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.kgsl_device* %0, %struct.kgsl_device** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.kgsl_device = type opaque
define void @kgsl_cffdump_memory_base(%struct.kgsl_device* nocapture %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initial_values_length_us();
int /*<<< orphan*/ printf(char *);
void length_to_us() {
  printf("\nTo US system. (Length)\n");
  initial_values_length_us();
}


x86 assembly (clang, -O0):
<length_to_us>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <initial_values_length_us@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<length_to_us>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <initial_values_length_us@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"\0ATo US system. (Length)\0A\00"
define void @length_to_us() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @initial_values_length_us()
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"\0ATo US system. (Length)\00"
define void @length_to_us() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @initial_values_length_us()
ret void
}
unsigned char inb(int port) {
  unsigned char b = 0;
  __asm__ __volatile__("inb %%dx, %%al" : "=a"(b) : "d"(port));
  return b;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
store i8 0, i8* %3
%4 = load i32, i32* %2
%5 = call i8 asm sideeffect "inb %dx, %al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i32 %0) {
%2 = tail call i8 asm sideeffect "inb %dx, %al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ r1(int /*<<< orphan*/);
int /*<<< orphan*/ w1(int /*<<< orphan*/);
int /*<<< orphan*/ w2(int /*<<< orphan*/);
int /*<<< orphan*/ w3(int /*<<< orphan*/);
int main() {
__CPROVER_ASYNC_0:
  w1(0);
__CPROVER_ASYNC_1:
  w2(0);
__CPROVER_ASYNC_2:
  w3(0);
__CPROVER_ASYNC_3:
  r1(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <w1@plt>
xor    %edi,%edi
call   1050 <w2@plt>
xor    %edi,%edi
call   1040 <w3@plt>
xor    %edi,%edi
call   1060 <r1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <w1@plt>
xor    %edi,%edi
call   1050 <w2@plt>
xor    %edi,%edi
call   1040 <w3@plt>
xor    %edi,%edi
call   1060 <r1@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 = %0
%3 = call i32 @w1(i32 0)
br label %4
4: ; preds = %2
%5 = call i32 @w2(i32 0)
br label %6
6: ; preds = %4
%7 = call i32 @w3(i32 0)
br label %8
8: ; preds = %6
%9 = call i32 @r1(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @w1(i32 0)
%2 = tail call i32 @w2(i32 0)
%3 = tail call i32 @w3(i32 0)
%4 = tail call i32 @r1(i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int /*<<< orphan*/ __get_unaligned_be64(int /*<<< orphan*/ const *);
__u64 get_unaligned_be64(const void *p) {
  return __get_unaligned_be64((const __u8 *)p);
}


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

x86 assembly (clang, -O2):
<get_unaligned_be64>:
jmp    1030 <__get_unaligned_be64@plt>

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

LLVM IR (-O2):
define i32 @get_unaligned_be64(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @__get_unaligned_be64(i32* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ cw_close(int);
void sk_close(int sock, int ssl) { cw_close(sock); }


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

x86 assembly (clang, -O2):
<sk_close>:
jmp    1030 <cw_close@plt>

LLVM IR (-O0):
define void @sk_close(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 = call i32 @cw_close(i32 %5)
ret void
}

LLVM IR (-O2):
define void @sk_close(i32 %0, i32 %1) {
%3 = tail call i32 @cw_close(i32 %0)
ret void
}
int fun792() { return 792; }


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

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

LLVM IR (-O0):
define i32 @fun792() {
ret i32 792
}

LLVM IR (-O2):
define i32 @fun792() {
ret i32 792
}
int isArmstrong(int num) {
  int temp = num, sum = 0, digit;
  while (temp != 0) {
    digit = temp % 10;
    sum = sum + (digit * digit * digit);
    temp = temp / 10;
  }
  if (num == sum)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isArmstrong>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1152 <isArmstrong+0x52>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    1114 <isArmstrong+0x14>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    116a <isArmstrong+0x6a>
movl   $0x1,-0x4(%rbp)
jmp    1171 <isArmstrong+0x71>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isArmstrong>:
xor    %r9d,%r9d
test   %edi,%edi
je     1146 <isArmstrong+0x46>
mov    %edi,%eax
nopl   0x0(%rax)
movslq %eax,%rdx
imul   $0x66666667,%rdx,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rax
add    %esi,%eax
lea    (%rax,%rax,1),%esi
lea    (%rsi,%rsi,4),%r8d
mov    %edx,%ecx
sub    %r8d,%ecx
mov    %ecx,%esi
imul   %ecx,%esi
imul   %ecx,%esi
add    %esi,%r9d
add    $0x9,%edx
cmp    $0x12,%edx
ja     1110 <isArmstrong+0x10>
xor    %eax,%eax
cmp    %edi,%r9d
sete   %al
ret

LLVM IR (-O0):
define i32 @isArmstrong(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
%7 = load i32, i32* %3
store i32 %7, i32* %4
store i32 0, i32* %5
br label %8
8: ; preds = %11, %1
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %23
11: ; preds = %8
%12 = load i32, i32* %4
%13 = srem i32 %12, 10
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = load i32, i32* %6
%17 = mul nsw i32 %15, %16
%18 = load i32, i32* %6
%19 = mul nsw i32 %17, %18
%20 = add nsw i32 %14, %19
store i32 %20, i32* %5
%21 = load i32, i32* %4
%22 = sdiv i32 %21, 10
store i32 %22, i32* %4
br label %8
23: ; preds = %8
%24 = load i32, i32* %3
%25 = load i32, i32* %5
%26 = icmp eq i32 %24, %25
br i1 %26, label %27, label %28
27: ; preds = %23
store i32 1, i32* %2
br label %29
28: ; preds = %23
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @isArmstrong(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi i32 [ %10, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 10
%7 = mul nsw i32 %6, %6
%8 = mul nsw i32 %7, %6
%9 = add nsw i32 %8, %4
%10 = sdiv i32 %5, 10
%11 = add i32 %5, 9
%12 = icmp ult i32 %11, 19
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %9, %3 ]
%15 = icmp eq i32 %14, %0
%16 = zext i1 %15 to i32
ret i32 %16
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ err_msg(char *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int read(int, void *, size_t);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
ssize_t Read(int sockfd, void *buff, size_t count) {
  ssize_t n;
  if ((n = read(sockfd, buff, count)) == -1) {
    err_msg("error reading from socket: %s", strerror(errno));
    exit(EXIT_FAILURE);
  }
  return n;
}


x86 assembly (clang, -O0):
<Read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
jne    1199 <Read+0x59>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %eax,%esi
lea    0xe7a(%rip),%rdi
call   1040 <err_msg@plt>
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Read>:
push   %rax
call   1030 <read@plt>
cmp    $0xffffffff,%eax
je     114d <Read+0xd>
pop    %rcx
ret
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe9e(%rip),%rdi
mov    %eax,%esi
call   1040 <err_msg@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"error reading from socket: %s\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @Read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @read(i32 %8, i8* %9, i64 %10)
store i32 %11, i32* %7
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %19
13: ; preds = %3
%14 = load i32, i32* @errno
%15 = call i32 @strerror(i32 %14)
%16 = call i32 @err_msg(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* @EXIT_FAILURE
%18 = call i32 @exit(i32 %17)
unreachable
19: ; preds = %3
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
@.str = [30 x i8] c"error reading from socket: %s\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @Read(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* @errno
%8 = tail call i32 @strerror(i32 %7)
%9 = tail call i32 @err_msg(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @EXIT_FAILURE
%11 = tail call i32 @exit(i32 %10)
unreachable
12: ; preds = %3
ret i32 %4
}
long double ld(char c) { return c; }


x86 assembly (clang, -O0):
<ld>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %ax,-0x4(%rbp)
filds  -0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld>:
mov    %di,-0x2(%rsp)
filds  -0x2(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @ld(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sitofp i8 %3 to x86_fp80
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @ld(i8 signext %0) {
%2 = sitofp i8 %0 to x86_fp80
ret x86_fp80 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ atomic_bool;

/* Variables and functions */
int /*<<< orphan*/ atomic_load(int /*<<< orphan*/ *);
bool stdatomic_read_bool(atomic_bool *b) { return (bool)atomic_load(b); }


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

x86 assembly (clang, -O2):
<stdatomic_read_bool>:
jmp    1030 <atomic_load@plt>

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

LLVM IR (-O2):
define i32 @stdatomic_read_bool(i32* %0) {
%2 = tail call i32 @atomic_load(i32* %0)
ret i32 %2
}
int nibble2hex(int nibble) {
  if (nibble < 10)
    return nibble + 48;
  else
    return nibble + 55;
}


x86 assembly (clang, -O0):
<nibble2hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    111f <nibble2hex+0x1f>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <nibble2hex+0x28>
mov    -0x8(%rbp),%eax
add    $0x37,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibble2hex>:
lea    0x37(%rdi),%ecx
lea    0x30(%rdi),%eax
cmp    $0xa,%edi
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @nibble2hex(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = select i1 %2, i32 48, i32 55
%4 = add nsw i32 %3, %0
ret i32 %4
}