xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ascii_to_bin(int ch) {
  int sch = (ch < 0x80) ? ch : -(0x100 - ch);
  int retval;
  retval = sch - '.';
  if (sch >= 'A') {
    retval = sch - ('A' - 12);
    if (sch >= 'a')
      retval = sch - ('a' - 38);
  }
  retval &= 0x3f;
  return retval;
}


x86 assembly (clang, -O0):
<ascii_to_bin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x80,-0x4(%rbp)
jge    111f <ascii_to_bin+0x1f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112e <ascii_to_bin+0x2e>
mov    $0x100,%ecx
sub    -0x4(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x2e,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1168 <ascii_to_bin+0x68>
mov    -0x8(%rbp),%eax
sub    $0x35,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1163 <ascii_to_bin+0x63>
mov    -0x8(%rbp),%eax
sub    $0x3b,%eax
mov    %eax,-0xc(%rbp)
jmp    1168 <ascii_to_bin+0x68>
mov    -0xc(%rbp),%eax
and    $0x3f,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_to_bin>:
lea    -0x100(%rdi),%ecx
cmp    $0x80,%edi
cmovl  %edi,%ecx
cmp    $0x61,%ecx
mov    $0x5,%eax
mov    $0xb,%edx
cmovge %eax,%edx
cmp    $0x41,%ecx
mov    $0x12,%eax
cmovge %edx,%eax
add    %ecx,%eax
and    $0x3f,%eax
ret

LLVM IR (-O0):
define i32 @ascii_to_bin(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 128
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %2
br label %13
9: ; preds = %1
%10 = load i32, i32* %2
%11 = sub nsw i32 256, %10
%12 = sub nsw i32 0, %11
br label %13
13: ; preds = %9, %7
%14 = phi i32 [ %8, %7 ], [ %12, %9 ]
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 46
store i32 %16, i32* %4
%17 = load i32, i32* %3
%18 = icmp sge i32 %17, 65
br i1 %18, label %19, label %28
19: ; preds = %13
%20 = load i32, i32* %3
%21 = sub nsw i32 %20, 53
store i32 %21, i32* %4
%22 = load i32, i32* %3
%23 = icmp sge i32 %22, 97
br i1 %23, label %24, label %27
24: ; preds = %19
%25 = load i32, i32* %3
%26 = sub nsw i32 %25, 59
store i32 %26, i32* %4
br label %27
27: ; preds = %24, %19
br label %28
28: ; preds = %27, %13
%29 = load i32, i32* %4
%30 = and i32 %29, 63
store i32 %30, i32* %4
%31 = load i32, i32* %4
ret i32 %31
}

LLVM IR (-O2):
define i32 @ascii_to_bin(i32 %0) {
%2 = icmp slt i32 %0, 128
%3 = add i32 %0, -256
%4 = select i1 %2, i32 %0, i32 %3
%5 = icmp sgt i32 %4, 64
%6 = icmp sgt i32 %4, 96
%7 = select i1 %6, i32 5, i32 11
%8 = select i1 %5, i32 %7, i32 18
%9 = add nsw i32 %8, %4
%10 = and i32 %9, 63
ret i32 %10
}
/* Variables and functions */
int ulog2(unsigned int);
unsigned ispow2(unsigned x) { return x == (1 << ulog2(x)); }


x86 assembly (clang, -O0):
<ispow2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ulog2@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispow2>:
push   %rbx
mov    %edi,%ebx
call   1030 <ulog2@plt>
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%edx
xor    %eax,%eax
cmp    %ebx,%edx
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ispow2(i32 %0) {
%2 = tail call i32 @ulog2(i32 %0)
%3 = shl nuw i32 1, %2
%4 = icmp eq i32 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
int sellt(int x, int y, int z) { return x < 0 ? y : z; }


x86 assembly (clang, -O0):
<sellt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1122 <sellt+0x22>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <sellt+0x28>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sellt>:
mov    %esi,%eax
test   %edi,%edi
cmovns %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @sellt(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, 0
%5 = select i1 %4, i32 %1, i32 %2
ret i32 %5
}
/* Variables and functions */
void *malloc(size_t);
void *ALCloopback_New(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<ALCloopback_New>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @ALCloopback_New(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_list(int *x, int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("%d\t", x[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_list>:
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
jge    1159 <print_list+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_list+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_list>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_list+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_list+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_list(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 slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext 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 nsw 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_list(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
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 hoursSpent(void) { return 72.0; }


x86 assembly (clang, -O0):
<hoursSpent>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hoursSpent>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @hoursSpent() {
ret double 7.200000e+01
}

LLVM IR (-O2):
define double @hoursSpent() {
ret double 7.200000e+01
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void end_user_section() { write("msproject.xml", "</Resources>\n", NULL); }


x86 assembly (clang, -O0):
<end_user_section>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeec(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_user_section>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [14 x i8] c"</Resources>\0A\00"
define void @end_user_section() {
%1 = call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [14 x i8] c"</Resources>\0A\00"
define void @end_user_section() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void advertisingStoppedCallback(void) {
  printf("\r\nAdv: Stopped");
  return;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"\0D\0AAdv: Stopped\00"
define void @advertisingStoppedCallback() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"\0D\0AAdv: Stopped\00"
define void @advertisingStoppedCallback() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
int tlsf_fls(unsigned int word) {
  const int bit = word ? 32 - __builtin_clz(word) : 0;
  return bit - 1;
}


x86 assembly (clang, -O0):
<tlsf_fls>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1129 <tlsf_fls+0x29>
mov    -0x4(%rbp),%eax
bsr    %eax,%ecx
xor    $0x1f,%ecx
mov    $0x20,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <tlsf_fls+0x33>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <tlsf_fls+0x33>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlsf_fls>:
test   %edi,%edi
je     1108 <tlsf_fls+0x8>
bsr    %edi,%eax
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @tlsf_fls(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @llvm.ctlz.i32(i32 %7, i1 true)
%9 = sub nsw i32 32, %8
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %6
%12 = phi i32 [ %9, %6 ], [ 0, %10 ]
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
ret i32 %14
}

LLVM IR (-O2):
define i32 @tlsf_fls(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%5 = xor i32 %4, 31
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ -1, %1 ]
ret i32 %7
}
/* Type definitions */
struct pci_bus_operations {
  int dummy;
};

/* Variables and functions */
const struct pci_bus_operations *pci_config_default(void) { return NULL; }


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

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

LLVM IR (-O0):
%struct.pci_bus_operations = type { i32 }
define %struct.pci_bus_operations* @pci_config_default() {
ret %struct.pci_bus_operations* null
}

LLVM IR (-O2):
%struct.pci_bus_operations = type { i32 }
define noalias %struct.pci_bus_operations* @pci_config_default() {
ret %struct.pci_bus_operations* null
}
char *test_mySub_small(const char **_ja_name) {
  do {
    *_ja_name = __func__;
    if (!(mySub(0, 0) == 0))
      return "0 - 0 == 0";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_mySub_small>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
mov    %rcx,(%rax)
xor    %esi,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1030 <mySub@plt>
cmp    $0x0,%eax
je     114e <test_mySub_small+0x3e>
lea    0xecc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <test_mySub_small+0x4b>
jmp    1153 <test_mySub_small+0x43>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mySub_small>:
push   %rbx
lea    0xee8(%rip),%rax
mov    %rax,(%rdi)
xor    %ebx,%ebx
xor    %edi,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <mySub@plt>
test   %eax,%eax
lea    0xee0(%rip),%rax
cmovne %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@__func__.test_mySub_small = [17 x i8] c"test_mySub_small\00"
@.str = [11 x i8] c"0 - 0 == 0\00"
define i8* @test_mySub_small(i8** %0) {
%2 = alloca i8*
%3 = alloca i8**
store i8** %0, i8*** %3
br label %4
4: ; preds = %1
%5 = load i8**, i8*** %3
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.test_mySub_small, i64 0, i64 0), i8** %5
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @mySub to i32 (i32, i32, ...)*)(i32 0, i32 0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %4
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
br label %11
9: ; preds = %4
br label %10
10: ; preds = %9
store i8* null, i8** %2
br label %11
11: ; preds = %10, %8
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@__func__.test_mySub_small = [17 x i8] c"test_mySub_small\00"
@.str = [11 x i8] c"0 - 0 == 0\00"
define i8* @test_mySub_small(i8** nocapture writeonly %0) {
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.test_mySub_small, i64 0, i64 0), i8** %0
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @mySub to i32 (i32, i32, ...)*)(i32 0, i32 0)
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8* null, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ OS_ReadPeriodicTime();
int /*<<< orphan*/ UART_OutString(char *);
int /*<<< orphan*/ UART_OutUDec(int /*<<< orphan*/);
void term_ReadClock(void) {
  UART_OutString("\n\rThe Clock Counter is :");
  UART_OutUDec(OS_ReadPeriodicTime());
  UART_OutString(" tick units.\n\r");
}


x86 assembly (clang, -O0):
<term_ReadClock>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <UART_OutString@plt>
mov    $0x0,%al
call   1030 <OS_ReadPeriodicTime@plt>
mov    %eax,%edi
call   1050 <UART_OutUDec@plt>
lea    0xec4(%rip),%rdi
call   1040 <UART_OutString@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_ReadClock>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <UART_OutString@plt>
xor    %eax,%eax
call   1030 <OS_ReadPeriodicTime@plt>
mov    %eax,%edi
call   1050 <UART_OutUDec@plt>
lea    0xec7(%rip),%rdi
pop    %rax
jmp    1040 <UART_OutString@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"\0A\0DThe Clock Counter is :\00"
@.str.1 = [15 x i8] c" tick units.\0A\0D\00"
define void @term_ReadClock() {
%1 = call i32 @UART_OutString(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @OS_ReadPeriodicTime()
%3 = call i32 @UART_OutUDec(i32 %2)
%4 = call i32 @UART_OutString(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0A\0DThe Clock Counter is :\00"
@.str.1 = [15 x i8] c" tick units.\0A\0D\00"
define void @term_ReadClock() {
%1 = tail call i32 @UART_OutString(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @OS_ReadPeriodicTime()
%3 = tail call i32 @UART_OutUDec(i32 %2)
%4 = tail call i32 @UART_OutString(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void LightGlobalDev() {}


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

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

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

LLVM IR (-O2):
define void @LightGlobalDev() {
ret void
}
/* Variables and functions */
scalar_t__ pthread_self();
unsigned long ssl_id_callback(void) { return ((unsigned long)pthread_self()); }


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

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

LLVM IR (-O0):
define i64 @ssl_id_callback() {
%1 = call i64 (...) @pthread_self()
ret i64 %1
}

LLVM IR (-O2):
define i64 @ssl_id_callback() {
%1 = tail call i64 (...) @pthread_self()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ foo01();
void bar01() { foo01(); }


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

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

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

LLVM IR (-O2):
define void @bar01() {
%1 = tail call i32 (...) @foo01()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ beginblock();
void beginparamblock(void) { beginblock(); }


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

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

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

LLVM IR (-O2):
define void @beginparamblock() {
%1 = tail call i32 (...) @beginblock()
ret void
}
void inslash2bol_rv() {}


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

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

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

LLVM IR (-O2):
define void @inslash2bol_rv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void check_allocated_or_abort(void *ptr) {
  if (ptr == NULL) {
    fprintf(stderr, "Failed to allocate a vector. ABORT.\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<check_allocated_or_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115a <check_allocated_or_abort+0x3a>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_allocated_or_abort>:
test   %rdi,%rdi
je     1126 <check_allocated_or_abort+0x6>
ret
push   %rax
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Failed to allocate a vector. ABORT.\0A\00"
@EXIT_FAILURE = global i32 0
define void @check_allocated_or_abort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Failed to allocate a vector. ABORT.\0A\00"
@EXIT_FAILURE = global i32 0
define void @check_allocated_or_abort(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
int isLetter(char c) {
  return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
}


x86 assembly (clang, -O0):
<isLetter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <isLetter+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <isLetter+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <isLetter+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLetter>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isLetter(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isLetter(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
scalar_t__ get_cache_slice(int, int);
int in_same_cache_set(uint64_t phys1, uint64_t phys2, int bad_bit) {
  uint64_t mask = ((uint64_t)1 << 17) - 1;
  return ((phys1 & mask) == (phys2 & mask) &&
          get_cache_slice(phys1, bad_bit) == get_cache_slice(phys2, bad_bit));
}


x86 assembly (clang, -O0):
<in_same_cache_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x1ffff,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
and    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%edx
and    -0x10(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
jne    116b <in_same_cache_set+0x5b>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <get_cache_slice@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <get_cache_slice@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_same_cache_set>:
mov    %esi,%ecx
xor    %edi,%ecx
xor    %eax,%eax
test   $0x1ffff,%ecx
je     111f <in_same_cache_set+0xf>
ret
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edx,%esi
call   1030 <get_cache_slice@plt>
mov    %rax,%r14
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <get_cache_slice@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%r14
sete   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @in_same_cache_set(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 131071, i32* %7
%8 = load i32, i32* %4
%9 = load i32, i32* %7
%10 = and i32 %8, %9
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = and i32 %11, %12
%14 = icmp eq i32 %10, %13
br i1 %14, label %15, label %23
15: ; preds = %3
%16 = load i32, i32* %4
%17 = load i32, i32* %6
%18 = call i64 @get_cache_slice(i32 %16, i32 %17)
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = call i64 @get_cache_slice(i32 %19, i32 %20)
%22 = icmp eq i64 %18, %21
br label %23
23: ; preds = %15, %3
%24 = phi i1 [ false, %3 ], [ %22, %15 ]
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @in_same_cache_set(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, %0
%5 = and i32 %4, 131071
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = tail call i64 @get_cache_slice(i32 %0, i32 %2)
%9 = tail call i64 @get_cache_slice(i32 %1, i32 %2)
%10 = icmp eq i64 %8, %9
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %7, %3
%13 = phi i32 [ 0, %3 ], [ %11, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ gpio_write_bit(int, char);
void sclk(char value) { gpio_write_bit(3, value); }


x86 assembly (clang, -O0):
<sclk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3,%edi
movsbl -0x1(%rbp),%esi
call   1030 <gpio_write_bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sclk>:
mov    %edi,%esi
mov    $0x3,%edi
jmp    1030 <gpio_write_bit@plt>

LLVM IR (-O0):
define void @sclk(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @gpio_write_bit(i32 3, i8 signext %3)
ret void
}

LLVM IR (-O2):
define void @sclk(i8 signext %0) {
%2 = tail call i32 @gpio_write_bit(i32 3, i8 signext %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef scalar_t__ ssize_t;
struct TYPE_3__ {
  scalar_t__ _IO_write_ptr;
  scalar_t__ _IO_write_end;
};
typedef TYPE_1__ FILE;

/* Variables and functions */
ssize_t diminuto_file_empty(const FILE *fp) {
  return (fp->_IO_write_end - fp->_IO_write_ptr);
}


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

x86 assembly (clang, -O2):
<diminuto_file_empty>:
mov    0x8(%rdi),%rax
sub    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
define i64 @diminuto_file_empty(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = sub nsw i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64, i64 }
define i64 @diminuto_file_empty(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%5 = load i64, i64* %4
%6 = sub nsw i64 %3, %5
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ NRF24_InsWrite(int, int /*<<< orphan*/ const *, int);
void NRF24_TXFIFO_Write(const uint8_t *pbuff, uint32_t num) {
  NRF24_InsWrite(0xA0, pbuff, num <= 32 ? num : 32);
}


x86 assembly (clang, -O0):
<NRF24_TXFIFO_Write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x20,-0xc(%rbp)
jg     113c <NRF24_TXFIFO_Write+0x2c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1149 <NRF24_TXFIFO_Write+0x39>
mov    $0x20,%eax
mov    %eax,-0x1c(%rbp)
jmp    1149 <NRF24_TXFIFO_Write+0x39>
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    $0xa0,%edi
call   1030 <NRF24_InsWrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NRF24_TXFIFO_Write>:
mov    %rdi,%rax
cmp    $0x20,%esi
mov    $0x20,%edx
cmovl  %esi,%edx
mov    $0xa0,%edi
mov    %rax,%rsi
jmp    1030 <NRF24_InsWrite@plt>

LLVM IR (-O0):
define void @NRF24_TXFIFO_Write(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 = icmp sle i32 %6, 32
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %11
10: ; preds = %2
br label %11
11: ; preds = %10, %8
%12 = phi i32 [ %9, %8 ], [ 32, %10 ]
%13 = call i32 @NRF24_InsWrite(i32 160, i32* %5, i32 %12)
ret void
}

LLVM IR (-O2):
define void @NRF24_TXFIFO_Write(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 32
%4 = select i1 %3, i32 %1, i32 32
%5 = tail call i32 @NRF24_InsWrite(i32 160, i32* %0, i32 %4)
ret void
}
/* Variables and functions */
int *getenv(char *);
void shortcircuit_and(int *x) {
  if (!x && !(x = getenv("BLOCK"))) {
    x = 17;
  } else {
    *x = 32;
  };
}


x86 assembly (clang, -O0):
<shortcircuit_and>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114f <shortcircuit_and+0x3f>
lea    0xed2(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    114f <shortcircuit_and+0x3f>
mov    $0x11,%eax
mov    %rax,-0x8(%rbp)
jmp    1159 <shortcircuit_and+0x49>
mov    -0x8(%rbp),%rax
movl   $0x20,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shortcircuit_and>:
push   %rax
test   %rdi,%rdi
jne    112a <shortcircuit_and+0x1a>
lea    0xee3(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rdi
test   %rax,%rax
je     1130 <shortcircuit_and+0x20>
movl   $0x20,(%rdi)
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"BLOCK\00"
define void @shortcircuit_and(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = call i32* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %2
%7 = icmp ne i32* %6, null
br i1 %7, label %9, label %8
8: ; preds = %5
store i32* inttoptr (i64 17 to i32*), i32** %2
br label %11
9: ; preds = %5, %1
%10 = load i32*, i32** %2
store i32 32, i32* %10
br label %11
11: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"BLOCK\00"
define void @shortcircuit_and(i32* writeonly %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3, %1
%7 = phi i32* [ %0, %1 ], [ %4, %3 ]
store i32 32, i32* %7
br label %8
8: ; preds = %3, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void log_string(const char *s) { fprintf(stderr, "%s\n", s); }


x86 assembly (clang, -O0):
<log_string>:
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):
<log_string>:
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 = [4 x i8] c"%s\0A\00"
define void @log_string(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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @log_string(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int read_standard_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(11, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<read_standard_target_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xb,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_standard_target_system>:
mov    $0xb,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @read_standard_target_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 11, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @read_standard_target_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 11, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ assertEquals(char *, int /*<<< orphan*/);
int /*<<< orphan*/ getNumberInWords(int);
void testValuesOutsideRange() {
  assertEquals("no result", getNumberInWords(-1));
  assertEquals("no result", getNumberInWords(1000000000));
}


x86 assembly (clang, -O0):
<testValuesOutsideRange>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x3b9aca00,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <assertEquals@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testValuesOutsideRange>:
push   %rbx
mov    $0xffffffff,%edi
call   1040 <getNumberInWords@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x3b9aca00,%edi
call   1040 <getNumberInWords@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <assertEquals@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"no result\00"
define void @testValuesOutsideRange() {
%1 = call i32 @getNumberInWords(i32 -1)
%2 = call i32 @assertEquals(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @getNumberInWords(i32 1000000000)
%4 = call i32 @assertEquals(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"no result\00"
define void @testValuesOutsideRange() {
%1 = tail call i32 @getNumberInWords(i32 -1)
%2 = tail call i32 @assertEquals(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @getNumberInWords(i32 1000000000)
%4 = tail call i32 @assertEquals(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ preempt_enable();
void radix_tree_preload_end(void) { preempt_enable(); }


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

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

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

LLVM IR (-O2):
define void @radix_tree_preload_end() {
%1 = tail call i32 (...) @preempt_enable()
ret void
}
void FreeArgs(char **res, int Nw) {
  int i;
  for (i = 0; i < Nw; i++)
    free(res[i]);
  free(res);
}


x86 assembly (clang, -O0):
<FreeArgs>:
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
jge    1151 <FreeArgs+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <FreeArgs+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeArgs>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <FreeArgs+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <FreeArgs+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @FreeArgs(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
int /*<<< orphan*/ xscreenrect();
void basXScreenRect() { pushNumber(xscreenrect()); }


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

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

LLVM IR (-O0):
define void @basXScreenRect() {
%1 = call i32 (...) @xscreenrect()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basXScreenRect() {
%1 = tail call i32 (...) @xscreenrect()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}
/* Variables and functions */
double getAverage(int *, int);
int /*<<< orphan*/ printf(char *, double);
int main() {
  int balance[5] = {1000, 2, 3, 17, 50};
  double avg;
  avg = getAverage(balance, 5);
  printf("平均值是: %f", avg);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <getAverage@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <getAverage@plt>
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.balance = [5 x i32] [i32 1000, i32 2, i32 3, i32 17, i32 50]
@.str = [17 x i8] c"\E5\B9\B3\E5\9D\87\E5\80\BC\E6\98\AF: %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca double
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = call double @getAverage(i32* %5, i32 5)
store double %6, double* %3
%7 = load double, double* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.balance = [5 x i32] [i32 1000, i32 2, i32 3, i32 17, i32 50]
@.str = [17 x i8] c"\E5\B9\B3\E5\9D\87\E5\80\BC\E6\98\AF: %f\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call double @getAverage(i32* %3, i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
long double __attribute__((no)) fcmove(long flags) {
  long double out;
  asm("\n"
      "	push	%1"
      "\n"
      "	popf"
      "\n"
      "	fldpi"
      "\n"
      "	fld1"
      "\n"
      "	"
      "fcmove"
      " %%st(1), %%st"
      "\n"
      "	ffree	%%st(1)"
      "\n"
      : "=t"(out)
      : "r"(flags));
  return out;
}


x86 assembly (clang, -O0):
<fcmove>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
push   %rax
popf
fldpi
fld1
fcmove %st(1),%st
ffree  %st(1)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcmove>:
push   %rdi
popf
fldpi
fld1
fcmove %st(1),%st
ffree  %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @fcmove(i64 %0) {
%2 = alloca i64
%3 = alloca x86_fp80
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call x86_fp80 asm "\0A\09push\09$1\0A\09popf\0A\09fldpi\0A\09fld1\0A\09fcmove %st(1), %st\0A\09ffree\09%st(1)\0A", "={st},r,~{dirflag},~{fpsr},~{flags}"(i64 %4)
store x86_fp80 %5, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @fcmove(i64 %0) {
%2 = tail call x86_fp80 asm "\0A\09push\09$1\0A\09popf\0A\09fldpi\0A\09fld1\0A\09fcmove %st(1), %st\0A\09ffree\09%st(1)\0A", "={st},r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret x86_fp80 %2
}
int foo(int i) { return i + 3; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 3
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int open(char const *, int /*<<< orphan*/);
off_t get_flen(const char *path) {
  int fd = open(path, O_RDONLY);
  if (fd == -1) {
    return 0;
  }
  off_t len = lseek(fd, 0, SEEK_END);
  close(fd);
  return len;
}


x86 assembly (clang, -O0):
<get_flen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1167 <get_flen+0x37>
movl   $0x0,-0x4(%rbp)
jmp    118b <get_flen+0x5b>
mov    -0x14(%rbp),%edi
mov    0x2e77(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_flen>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
cmp    $0xffffffff,%eax
je     1167 <get_flen+0x37>
mov    %eax,%ebx
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <close@plt>
mov    %ebp,%eax
jmp    1169 <get_flen+0x39>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
@SEEK_END = global i32 0
define i32 @get_flen(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* @O_RDONLY
%8 = call i32 @open(i8* %6, i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 0, i32* %2
br label %19
12: ; preds = %1
%13 = load i32, i32* %4
%14 = load i32, i32* @SEEK_END
%15 = call i32 @lseek(i32 %13, i32 0, i32 %14)
store i32 %15, i32* %5
%16 = load i32, i32* %4
%17 = call i32 @close(i32 %16)
%18 = load i32, i32* %5
store i32 %18, i32* %2
br label %19
19: ; preds = %12, %11
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@SEEK_END = global i32 0
define i32 @get_flen(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i32, i32* @SEEK_END
%7 = tail call i32 @lseek(i32 %3, i32 0, i32 %6)
%8 = tail call i32 @close(i32 %3)
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %7, %5 ], [ 0, %1 ]
ret i32 %10
}
int sub(const int a, int const *const b, const const const c) { return 0; }


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sub(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
ret i32 0
}

LLVM IR (-O2):
define i32 @sub(i32 %0, i32* nocapture readnone %1, i32 %2) {
ret i32 0
}
char *WcSkipWhitespace(cp)
char *cp;
{
  while (*cp && isspace(*cp))
    cp++;
  return cp;
}


x86 assembly (clang, -O0):
<WcSkipWhitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1146 <WcSkipWhitespace+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1156 <WcSkipWhitespace+0x46>
jmp    1167 <WcSkipWhitespace+0x57>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <WcSkipWhitespace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WcSkipWhitespace>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1138 <WcSkipWhitespace+0x28>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1138 <WcSkipWhitespace+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <WcSkipWhitespace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @WcSkipWhitespace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = call i32 @isspace(i32 %11)
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %8, %3
%15 = phi i1 [ false, %3 ], [ %13, %8 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %14
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @WcSkipWhitespace(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %10
%5 = phi i8 [ %12, %10 ], [ %2, %1 ]
%6 = phi i8* [ %11, %10 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @isspace(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %10, %1
%15 = phi i8* [ %0, %1 ], [ %11, %10 ], [ %6, %4 ]
ret i8* %15
}