xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, x;
  for (i = 10; i <= 100; i++) {
    x = i * i;
    printf("%d\n", x);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1157 <main+0x47>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0xa,%ebp
lea    0xee1(%rip),%rbx
nop
mov    %ebp,%esi
imul   %ebp,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    $0x65,%ebp
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 10, %0 ], [ %5, %1 ]
%3 = mul nuw nsw i32 %2, %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 101
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ brc(int, char);
void tbc(int pn) { brc(pn, 'g'); }


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

x86 assembly (clang, -O2):
<tbc>:
mov    $0x67,%esi
jmp    1030 <brc@plt>

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

LLVM IR (-O2):
define void @tbc(i32 %0) {
%2 = tail call i32 @brc(i32 %0, i8 signext 103)
ret void
}
/* Type definitions */
struct perf_event_attr {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_perf_event_open;
int syscall(int /*<<< orphan*/, struct perf_event_attr *, int /*<<< orphan*/,
            int, int, unsigned long);
int pf_event_open(struct perf_event_attr *attr, pid_t pid, int cpu,
                  int group_fd, unsigned long flags) {
  return (syscall(__NR_perf_event_open, attr, pid, cpu, group_fd, flags));
}


x86 assembly (clang, -O0):
<pf_event_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pf_event_open>:
mov    %r8,%r9
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
%struct.perf_event_attr = type { i32 }
@__NR_perf_event_open = global i32 0
define i32 @pf_event_open(%struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4) {
%6 = load i32, i32* @__NR_perf_event_open
%7 = tail call i32 @syscall(i32 %6, %struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef char int8_t;

/* Variables and functions */
char tolower(int /*<<< orphan*/);
void strlwr(char *temp) {
  int8_t *s = temp;
  while (*s) {
    *s = tolower((uint8_t)*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<strlwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strlwr+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strlwr+0x14>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @strlwr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call signext i8 @tolower(i32 %7)
store i8 %8, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void destroy_URL_buffer(char **buf, unsigned elements) {
  unsigned i;
  for (i = 0; i < elements; i++)
    free(buf[i]);
  free(buf);
}


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

x86 assembly (clang, -O2):
<destroy_URL_buffer>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
je     1142 <destroy_URL_buffer+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 <destroy_URL_buffer+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @destroy_URL_buffer(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 ult i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i8**, i8*** %3
%12 = load i32, i32* %5
%13 = zext 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 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 @destroy_URL_buffer(i8** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
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*/ printf(char *, char);
void printcln(char c) { printf("%c\n", c); }


x86 assembly (clang, -O0):
<printcln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printcln>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define void @printcln(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
/* Variables and functions */
scalar_t__ is_user_module_valid();
int /*<<< orphan*/ module_user_loop();
void loop() {
  if (is_user_module_valid()) {
    module_user_loop();
  }
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <is_user_module_valid@plt>
cmp    $0x0,%rax
je     113c <loop+0x1c>
mov    $0x0,%al
call   1040 <module_user_loop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop>:
push   %rax
xor    %eax,%eax
call   1030 <is_user_module_valid@plt>
test   %rax,%rax
je     1135 <loop+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <module_user_loop@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @loop() {
%1 = call i64 (...) @is_user_module_valid()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @module_user_loop()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @loop() {
%1 = tail call i64 (...) @is_user_module_valid()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @module_user_loop()
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookcomplex16array_(char *x, unsigned int *n) { lookNarray(x, (*n * 16)); }


x86 assembly (clang, -O0):
<lookcomplex16array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x4,%esi
call   1030 <lookNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookcomplex16array_>:
mov    (%rsi),%esi
shl    $0x4,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookcomplex16array_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = mul i32 %7, 16
%9 = call i32 @lookNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @lookcomplex16array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 4
%5 = tail call i32 @lookNarray(i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MQTTClient_sleep(int);
void mqtt_sleep(int milliseconds) { MQTTClient_sleep(milliseconds); }


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

x86 assembly (clang, -O2):
<mqtt_sleep>:
jmp    1030 <MQTTClient_sleep@plt>

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

LLVM IR (-O2):
define void @mqtt_sleep(i32 %0) {
%2 = tail call i32 @MQTTClient_sleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(int, int, int, int);
int main() {
  test(0x10000000, 0x10000000, 0x12345678, 0);
  test(0x10000000, 0x20000000, 0x12345678, 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x10000000,%esi
mov    $0x12345678,%edx
xor    %ecx,%ecx
mov    %esi,%edi
call   1030 <test@plt>
mov    $0x10000000,%edi
mov    $0x20000000,%esi
mov    $0x12345678,%edx
mov    $0x1,%ecx
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x10000000,%edi
mov    $0x10000000,%esi
mov    $0x12345678,%edx
xor    %ecx,%ecx
call   1030 <test@plt>
mov    $0x10000000,%edi
mov    $0x20000000,%esi
mov    $0x12345678,%edx
mov    $0x1,%ecx
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test(i32 268435456, i32 268435456, i32 305419896, i32 0)
%3 = call i32 @test(i32 268435456, i32 536870912, i32 305419896, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 268435456, i32 268435456, i32 305419896, i32 0)
%2 = tail call i32 @test(i32 268435456, i32 536870912, i32 305419896, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
float sub(float f, float s) {
  float t;
  t = f - s;
  if (t > 9999999 || t < -9999999) {
    printf("ERROR 5");
    printf("\n");
    exit(0);
  } else {
    return t;
  }
}


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xeb2(%rip),%xmm1
ucomiss %xmm1,%xmm0
ja     1169 <sub+0x49>
movss  0xea5(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1188 <sub+0x68>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
push   %rax
subss  %xmm1,%xmm0
ucomiss 0xec4(%rip),%xmm0
ja     114d <sub+0x1d>
movss  0xebe(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     114d <sub+0x1d>
pop    %rax
ret
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"ERROR 5\00"
@.str.1 = [2 x i8] c"\0A\00"
define float @sub(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fsub float %6, %7
store float %8, float* %5
%9 = load float, float* %5
%10 = fcmp ogt float %9, 0x416312CFE0000000
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load float, float* %5
%13 = fcmp olt float %12, 0xC16312CFE0000000
br i1 %13, label %14, label %18
14: ; preds = %11, %2
%15 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @exit(i32 0)
unreachable
18: ; preds = %11
%19 = load float, float* %5
ret float %19
}

LLVM IR (-O2):
@.str = [8 x i8] c"ERROR 5\00"
define float @sub(float %0, float %1) {
%3 = fsub float %0, %1
%4 = fcmp ogt float %3, 0x416312CFE0000000
%5 = fcmp olt float %3, 0xC16312CFE0000000
%6 = or i1 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @putchar(i32 10)
%10 = tail call i32 @exit(i32 0)
unreachable
11: ; preds = %2
ret float %3
}
void is_digit(int i) {
  switch (i) {
  case 0 ... 9:
    printf("%d is a digit\n", i);
    break;
  default:
    printf("%d is not a digit\n", i);
  }
}


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x9,%eax
ja     1142 <is_digit+0x32>
jmp    112c <is_digit+0x1c>
mov    -0x4(%rbp),%esi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1153 <is_digit+0x43>
mov    -0x4(%rbp),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
mov    %edi,%esi
cmp    $0xa,%edi
lea    0xee4(%rip),%rax
lea    0xeec(%rip),%rdi
cmovb  %rax,%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%d is a digit\0A\00"
@.str.1 = [19 x i8] c"%d is not a digit\0A\00"
define void @is_digit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %7 [
i32 0, label %4
i32 1, label %4
i32 2, label %4
i32 3, label %4
i32 4, label %4
i32 5, label %4
i32 6, label %4
i32 7, label %4
i32 8, label %4
i32 9, label %4
]
4: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %4
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%d is a digit\0A\00"
@.str.1 = [19 x i8] c"%d is not a digit\0A\00"
define void @is_digit(i32 %0) {
%2 = icmp ult i32 %0, 10
%3 = select i1 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %3, i32 %0)
ret void
}
void glCompileShader(unsigned int shader) {}


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

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

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

LLVM IR (-O2):
define void @glCompileShader(i32 %0) {
ret void
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_get_wch(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_get_wch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_get_wch+0x2a>
jmp    1170 <cmd_get_wch+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_get_wch>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_get_wch+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_get_wch(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void tumbleweed_checksum2characters(uint32_t crc, uint8_t *crc1p,
                                    uint8_t *crc2p, uint8_t *crc3p) {
  *crc1p = (uint8_t)((crc >> (8 * 2)) & 0xff);
  *crc2p = (uint8_t)((crc >> (8 * 1)) & 0xff);
  *crc3p = (uint8_t)((crc >> (8 * 0)) & 0xff);
}


x86 assembly (clang, -O0):
<tumbleweed_checksum2characters>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tumbleweed_checksum2characters>:
push   %rbx
mov    %edi,%eax
movzbl %ah,%ebx
movzbl %al,%edi
shr    $0x10,%eax
movzbl %al,%eax
mov    %rax,(%rsi)
mov    %rbx,(%rdx)
mov    %rdi,(%rcx)
pop    %rbx
ret

LLVM IR (-O0):
define void @tumbleweed_checksum2characters(i32 %0, i64* %1, i64* %2, i64* %3) {
%5 = alloca i32
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i64*
store i32 %0, i32* %5
store i64* %1, i64** %6
store i64* %2, i64** %7
store i64* %3, i64** %8
%9 = load i32, i32* %5
%10 = ashr i32 %9, 16
%11 = and i32 %10, 255
%12 = sext i32 %11 to i64
%13 = load i64*, i64** %6
store i64 %12, i64* %13
%14 = load i32, i32* %5
%15 = ashr i32 %14, 8
%16 = and i32 %15, 255
%17 = sext i32 %16 to i64
%18 = load i64*, i64** %7
store i64 %17, i64* %18
%19 = load i32, i32* %5
%20 = ashr i32 %19, 0
%21 = and i32 %20, 255
%22 = sext i32 %21 to i64
%23 = load i64*, i64** %8
store i64 %22, i64* %23
ret void
}

LLVM IR (-O2):
define void @tumbleweed_checksum2characters(i32 %0, i64* nocapture writeonly %1, i64* nocapture writeonly %2, i64* nocapture writeonly %3) {
%5 = lshr i32 %0, 16
%6 = and i32 %5, 255
%7 = zext i32 %6 to i64
store i64 %7, i64* %1
%8 = lshr i32 %0, 8
%9 = and i32 %8, 255
%10 = zext i32 %9 to i64
store i64 %10, i64* %2
%11 = and i32 %0, 255
%12 = zext i32 %11 to i64
store i64 %12, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ PKCS8_PRIV_KEY_INFO;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ PKCS8_PRIV_KEY_INFO_it;
void PKCS8_PRIV_KEY_INFO_free(PKCS8_PRIV_KEY_INFO *a) {
  ASN1_item_free((ASN1_VALUE *)a, &PKCS8_PRIV_KEY_INFO_it);
}


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

x86 assembly (clang, -O2):
<PKCS8_PRIV_KEY_INFO_free>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@PKCS8_PRIV_KEY_INFO_it = global i32 0
define void @PKCS8_PRIV_KEY_INFO_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @PKCS8_PRIV_KEY_INFO_it)
ret void
}

LLVM IR (-O2):
@PKCS8_PRIV_KEY_INFO_it = global i32 0
define void @PKCS8_PRIV_KEY_INFO_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @PKCS8_PRIV_KEY_INFO_it)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mtspr(int, unsigned int);
void cpu_perf_setall(unsigned int value) { mtspr(((7 << (11)) + (31)), value); }


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

x86 assembly (clang, -O2):
<cpu_perf_setall>:
mov    %edi,%esi
mov    $0x381f,%edi
jmp    1030 <mtspr@plt>

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

LLVM IR (-O2):
define void @cpu_perf_setall(i32 %0) {
%2 = tail call i32 @mtspr(i32 14367, i32 %0)
ret void
}
int isEven(int number) {
  int answer;
  if (number % 2)
    answer = 0;
  else
    answer = 1;
  return answer;
}


x86 assembly (clang, -O0):
<isEven>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1127 <isEven+0x27>
movl   $0x0,-0x8(%rbp)
jmp    112e <isEven+0x2e>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEven>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isEven(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %3
br label %9
8: ; preds = %1
store i32 1, i32* %3
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @isEven(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ DoneQuit();
void DoQuit() { DoneQuit(); }


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

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

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

LLVM IR (-O2):
define void @DoQuit() {
%1 = tail call i32 (...) @DoneQuit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  volatile double x;
  int cmp;
  x = 0.0;
  cmp = (x == 0.0);
  printf("%d\n", cmp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
xorpd  %xmm0,%xmm0
cmpeqsd (%rsp),%xmm0
movq   %xmm0,%rsi
and    $0x1,%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca i32
store volatile double 0.000000e+00, double* %1
%3 = load volatile double, double* %1
%4 = fcmp oeq double %3, 0.000000e+00
%5 = zext i1 %4 to i32
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store volatile double 0.000000e+00, double* %1
%3 = load volatile double, double* %1
%4 = fcmp oeq double %3, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
char const *rserpoolErrorGetDescription(unsigned int const);
const char *
poolHandlespaceManagementGetErrorDescription(const unsigned int errorCode) {
  return (rserpoolErrorGetDescription(errorCode));
}


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

x86 assembly (clang, -O2):
<poolHandlespaceManagementGetErrorDescription>:
jmp    1030 <rserpoolErrorGetDescription@plt>

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

LLVM IR (-O2):
define i8* @poolHandlespaceManagementGetErrorDescription(i32 %0) {
%2 = tail call i8* @rserpoolErrorGetDescription(i32 %0)
ret i8* %2
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECSMBV(const char *the_title) { return any_decrqss(the_title, " u"); }


x86 assembly (clang, -O0):
<rpt_DECSMBV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <any_decrqss@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c" u\00"
define i32 @rpt_DECSMBV(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ s3c2410_nand_deselect_chip();
int /*<<< orphan*/ s3c2440_nand_deselect_chip();
void nand_deselect_chip(void) {
  if (((*(volatile unsigned int *)0x560000B0) == 0x32410000) ||
      ((*(volatile unsigned int *)0x560000B0) == 0x32410002)) {
    s3c2410_nand_deselect_chip();
  } else {
    s3c2440_nand_deselect_chip();
  }
}


x86 assembly (clang, -O0):
<nand_deselect_chip>:
push   %rbp
mov    %rsp,%rbp
mov    $0x560000b0,%eax
mov    (%rax),%eax
cmp    $0x32410000,%eax
je     1148 <nand_deselect_chip+0x28>
mov    $0x560000b0,%eax
mov    (%rax),%eax
cmp    $0x32410002,%eax
jne    1154 <nand_deselect_chip+0x34>
mov    $0x0,%al
call   1040 <s3c2410_nand_deselect_chip@plt>
jmp    115b <nand_deselect_chip+0x3b>
mov    $0x0,%al
call   1030 <s3c2440_nand_deselect_chip@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_deselect_chip>:
mov    0x560000b0,%eax
cmp    $0x32410000,%eax
je     113c <nand_deselect_chip+0x1c>
mov    0x560000b0,%eax
cmp    $0x32410002,%eax
jne    1143 <nand_deselect_chip+0x23>
xor    %eax,%eax
jmp    1040 <s3c2410_nand_deselect_chip@plt>
xor    %eax,%eax
jmp    1030 <s3c2440_nand_deselect_chip@plt>

LLVM IR (-O0):
define void @nand_deselect_chip() {
%1 = load volatile i32, i32* inttoptr (i64 1442840752 to i32*)
%2 = icmp eq i32 %1, 843120640
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load volatile i32, i32* inttoptr (i64 1442840752 to i32*)
%5 = icmp eq i32 %4, 843120642
br i1 %5, label %6, label %8
6: ; preds = %3, %0
%7 = call i32 (...) @s3c2410_nand_deselect_chip()
br label %10
8: ; preds = %3
%9 = call i32 (...) @s3c2440_nand_deselect_chip()
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
define void @nand_deselect_chip() {
%1 = load volatile i32, i32* inttoptr (i64 1442840752 to i32*)
%2 = icmp eq i32 %1, 843120640
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load volatile i32, i32* inttoptr (i64 1442840752 to i32*)
%5 = icmp eq i32 %4, 843120642
br i1 %5, label %6, label %8
6: ; preds = %3, %0
%7 = tail call i32 (...) @s3c2410_nand_deselect_chip()
br label %10
8: ; preds = %3
%9 = tail call i32 (...) @s3c2440_nand_deselect_chip()
br label %10
10: ; preds = %8, %6
ret void
}
long labs(long l) { return l > 0 ? l : -l; }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1120 <labs+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<labs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i64, i64* %2
br label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = sub nsw i64 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i64 [ %6, %5 ], [ %9, %7 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
long dbgprintf(const char *format, ...) {
  long done = 0;
  return done;
}


x86 assembly (clang, -O0):
<dbgprintf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @dbgprintf(i8* nocapture readnone %0, ...) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ parsingStringAttr(char *, char *);
void zcb_onString(char *name, char *value) {
  ;
  parsingStringAttr(name, value);
}


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

x86 assembly (clang, -O2):
<zcb_onString>:
jmp    1030 <parsingStringAttr@plt>

LLVM IR (-O0):
define void @zcb_onString(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @parsingStringAttr(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @zcb_onString(i8* %0, i8* %1) {
%3 = tail call i32 @parsingStringAttr(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int hiddenFunction();
int bobMcBob() { return hiddenFunction(); }


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

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

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

LLVM IR (-O2):
define i32 @bobMcBob() {
%1 = tail call i32 (...) @hiddenFunction()
ret i32 %1
}
int input_with_range_checking() {
  int (*orig_input)() = (int (*)())0x080487B9;
  int ret = orig_input();
  if (ret < 0 || ret >= 100)
    return 0;
  return ret;
}


x86 assembly (clang, -O0):
<input_with_range_checking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x80487b9,%eax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   *-0x10(%rbp)
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     112d <input_with_range_checking+0x2d>
cmpl   $0x64,-0x14(%rbp)
jl     1139 <input_with_range_checking+0x39>
movl   $0x0,-0x4(%rbp)
jmp    113f <input_with_range_checking+0x3f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_with_range_checking>:
push   %rbx
xor    %ebx,%ebx
mov    $0x80487b9,%ecx
xor    %eax,%eax
call   *%rcx
cmp    $0x64,%eax
cmovae %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @input_with_range_checking() {
%1 = alloca i32
%2 = alloca i32 (...)*
%3 = alloca i32
store i32 (...)* inttoptr (i64 134514617 to i32 (...)*), i32 (...)** %2
%4 = load i32 (...)*, i32 (...)** %2
%5 = call i32 (...) %4()
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %0
%9 = load i32, i32* %3
%10 = icmp sge i32 %9, 100
br i1 %10, label %11, label %12
11: ; preds = %8, %0
store i32 0, i32* %1
br label %14
12: ; preds = %8
%13 = load i32, i32* %3
store i32 %13, i32* %1
br label %14
14: ; preds = %12, %11
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @input_with_range_checking() {
%1 = tail call i32 (...) inttoptr (i64 134514617 to i32 (...)*)()
%2 = icmp ugt i32 %1, 99
%3 = select i1 %2, i32 0, i32 %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 5;
  printf("%i\n", x);
  int y = x + 1;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 5, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
int signof(int i) {
  if (i < 0)
    return -1;
  if (i == 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<signof>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <signof+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    113a <signof+0x3a>
cmpl   $0x0,-0x8(%rbp)
jne    1133 <signof+0x33>
movl   $0x0,-0x4(%rbp)
jmp    113a <signof+0x3a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signof>:
xor    %ecx,%ecx
test   %edi,%edi
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @signof(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = icmp sgt i32 %0, -1
%5 = select i1 %4, i32 %3, i32 -1
ret i32 %5
}
int guild_skill_get_sp(int id, int lv) { return 0; }


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

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

LLVM IR (-O0):
define i32 @guild_skill_get_sp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @guild_skill_get_sp(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
bool startswith(const char *s, const char *prefix) {
  return strncmp(s, prefix, strlen(prefix)) == 0;
}


x86 assembly (clang, -O0):
<startswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startswith>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @startswith(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t pru_get_reg(uint8_t pru_num, uint8_t reg_num) {
  if (reg_num >= (16) || pru_num > 1)
    return 0;
  uint32_t *base_addr =
      (uint32_t *)((0x01C30000) + (((512) / 2) - ((4) * (16))) +
                   (0x2000 * pru_num));
  return *(base_addr + reg_num);
}


x86 assembly (clang, -O0):
<pru_get_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    111e <pru_get_reg+0x1e>
cmpl   $0x1,-0x8(%rbp)
jle    112a <pru_get_reg+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1149 <pru_get_reg+0x49>
mov    -0x8(%rbp),%eax
shl    $0xd,%eax
add    $0x1c300c0,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pru_get_reg>:
xor    %eax,%eax
cmp    $0x1,%edi
jg     111d <pru_get_reg+0x1d>
cmp    $0xf,%esi
jg     111d <pru_get_reg+0x1d>
movslq %edi,%rax
shl    $0xd,%rax
movslq %esi,%rcx
mov    0x1c300c0(%rax,%rcx,4),%eax
ret

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

LLVM IR (-O2):
define i32 @pru_get_reg(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 15
%4 = icmp sgt i32 %0, 1
%5 = or i1 %4, %3
br i1 %5, label %14, label %6
6: ; preds = %2
%7 = shl nsw i32 %0, 13
%8 = add nsw i32 %7, 29556928
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = sext i32 %1 to i64
%12 = getelementptr inbounds i32, i32* %10, i64 %11
%13 = load i32, i32* %12
br label %14
14: ; preds = %2, %6
%15 = phi i32 [ %13, %6 ], [ 0, %2 ]
ret i32 %15
}
double atof(const char *nptr __attribute__((unused))) { return 0.0; }


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

x86 assembly (clang, -O2):
<atof>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @atof(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @atof(i8* nocapture readnone %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void fini_1(void) { write(STDOUT_FILENO, "DSO fini array 1\n", 17); }


x86 assembly (clang, -O0):
<fini_1>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x11,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fini_1>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0x11,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [18 x i8] c"DSO fini array 1\0A\00"
define void @fini_1() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = call i32 @write(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 17)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [18 x i8] c"DSO fini array 1\0A\00"
define void @fini_1() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 17)
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  long long quot;
  long long rem;
};
typedef TYPE_1__ lldiv_t;

/* Variables and functions */
lldiv_t lldiv(long long int numer, long long int denom) {
  lldiv_t res;
  res.quot = numer / denom;
  res.rem = numer % denom;
  return res;
}


x86 assembly (clang, -O0):
<lldiv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rdx,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<lldiv>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <lldiv+0x15>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
define { i64, i64 } @lldiv(i64 %0, i64 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = sdiv i64 %6, %7
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i64 %8, i64* %9
%10 = load i64, i64* %4
%11 = load i64, i64* %5
%12 = srem i64 %10, %11
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
store i64 %12, i64* %13
%14 = bitcast %struct.TYPE_3__* %3 to { i64, i64 }*
%15 = load { i64, i64 }, { i64, i64 }* %14
ret { i64, i64 } %15
}

LLVM IR (-O2):
define { i64, i64 } @lldiv(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
%4 = srem i64 %0, %1
%5 = insertvalue { i64, i64 } poison, i64 %3, 0
%6 = insertvalue { i64, i64 } %5, i64 %4, 1
ret { i64, i64 } %6
}