xunge/DecIR huggingface dataset:
/* Variables and functions */
char *lowercase(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char word[] = "TO BE CONVERTED";
  printf("%s\n", lowercase(word));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <lowercase@plt>
mov    %rax,%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1040 <lowercase@plt>
lea    0xed2(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.word = [16 x i8] c"TO BE CONVERTED\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [16 x i8]* %6 to i8*
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%9 = call i8* @lowercase(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.word = [16 x i8] c"TO BE CONVERTED\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i8* @lowercase(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
void test2(int x) {
  int buf[100];
  buf[-1] = 1;
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x1a4(%rbp)
add    $0x120,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test2(i32 %0) {
%2 = alloca i32
%3 = alloca [100 x i32]
store i32 %0, i32* %2
%4 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 -1
store i32 1, i32* %4
ret void
}

LLVM IR (-O2):
define void @test2(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ space(int);
int main() {
  int a;
  printf("Enter the Space needed: ");
  scanf("%d", &a);
  printf("Here->");
  space(a);
  printf("Bye!!! \n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
call   1030 <space@plt>
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1050 <printf@plt>
lea    0xec5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
lea    0xeb7(%rip),%rdi
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
call   1030 <space@plt>
lea    0xea9(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Enter the Space needed: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"Here->\00"
@.str.3 = [9 x i8] c"Bye!!! \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @space(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Enter the Space needed: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"Here->\00"
@str = [8 x i8] c"Bye!!! \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %1
%7 = call i32 @space(i32 %6)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char toupper(char);
void StrUpr(char *str) {
  while (*str) {
    *str = toupper(*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<StrUpr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <StrUpr+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <StrUpr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @StrUpr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t rotateLeft(uint64_t n) { return ((n >> 63) & 0x1) | (n << 1); }


x86 assembly (clang, -O0):
<rotateLeft>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3f,%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rotateLeft(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 63
%5 = and i32 %4, 1
%6 = load i32, i32* %2
%7 = shl i32 %6, 1
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @rotateLeft(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_socket_client_new_unix() {
  printf("NOT IMPLEMENTED:"
         "pa_socket_client_new_unix"
         "\n");
}


x86 assembly (clang, -O0):
<pa_socket_client_new_unix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [43 x i8] c"NOT IMPLEMENTED:pa_socket_client_new_unix\0A\00"
define i32 @pa_socket_client_new_unix() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_socket_client_new_unix\00"
define i32 @pa_socket_client_new_unix() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int bpf_rand_mask(int);
uint64_t bpf_rand_u32(int shift) {
  return bpf_rand_mask((0xffffffffULL)) << shift;
}


x86 assembly (clang, -O0):
<bpf_rand_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1030 <bpf_rand_mask@plt>
mov    -0x4(%rbp),%ecx
shl    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_rand_u32>:
push   %rbx
mov    %edi,%ebx
mov    $0xffffffff,%edi
call   1030 <bpf_rand_mask@plt>
mov    %ebx,%ecx
shl    %cl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @bpf_rand_u32(i32 %0) {
%2 = tail call i32 @bpf_rand_mask(i32 -1)
%3 = shl i32 %2, %0
ret i32 %3
}
int CEIL_LOG2(int x) {
  int result = 0;
  x--;
  while (x > 0) {
    result++;
    x >>= 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<CEIL_LOG2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1138 <CEIL_LOG2+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1117 <CEIL_LOG2+0x17>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CEIL_LOG2>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     111c <CEIL_LOG2+0x1c>
add    $0xffffffff,%edi
xor    %eax,%eax
mov    %edi,%ecx
xchg   %ax,%ax
add    $0x1,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <CEIL_LOG2+0x10>
ret

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

LLVM IR (-O2):
define i32 @CEIL_LOG2(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %11
3: ; preds = %1
%4 = add nsw i32 %0, -1
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 0, %3 ]
%7 = phi i32 [ %9, %5 ], [ %4, %3 ]
%8 = add nuw nsw i32 %6, 1
%9 = lshr i32 %7, 1
%10 = icmp ult i32 %7, 2
br i1 %10, label %11, label %5
11: ; preds = %5, %1
%12 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %12
}
int range_sub_hdr_ver(const unsigned sub_hdr_ver) {
  if (sub_hdr_ver >= 2) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<range_sub_hdr_ver>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jb     111d <range_sub_hdr_ver+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <range_sub_hdr_ver+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<range_sub_hdr_ver>:
xor    %eax,%eax
cmp    $0x2,%edi
setae  %al
ret

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

LLVM IR (-O2):
define i32 @range_sub_hdr_ver(i32 %0) {
%2 = icmp ugt i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int foo() {
  if (1 == 1) {
  } else {
    int w;
    w = 1;
    assert(w == 1);
  }
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
const char *sd_get_seats(void) { return "OK"; }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
define i8* @sd_get_seats() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ read(int, void *, size_t);
ssize_t myread(int fd, void *buf, size_t count) { return read(fd, buf, count); }


x86 assembly (clang, -O0):
<myread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myread>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @myread(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
void INT_Excep_PERIA_INTA226(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIA_INTA226() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panic();
void data_abort_entry_arm7(unsigned int address) { panic(); }


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

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

LLVM IR (-O0):
define void @data_abort_entry_arm7(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @panic()
ret void
}

LLVM IR (-O2):
define void @data_abort_entry_arm7(i32 %0) {
%2 = tail call i32 (...) @panic()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_output(char const *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void gpio_unexport(int gpioNr) {
  const char *filename = "/sys/class/gpio/unexport";
  char buf[(128)];
  sprintf(buf, "%d", gpioNr);
  gpio_output(filename, buf);
}


x86 assembly (clang, -O0):
<gpio_unexport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
lea    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xecf(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <gpio_output@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_unexport>:
push   %rbx
sub    $0x80,%rsp
mov    %edi,%edx
lea    0xee8(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
call   1030 <gpio_output@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"/sys/class/gpio/unexport\00"
@.str.1 = [3 x i8] c"%d\00"
define void @gpio_unexport(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [128 x i8]
store i32 %0, i32* %2
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %3
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%10 = call i32 @gpio_output(i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"/sys/class/gpio/unexport\00"
@.str.1 = [3 x i8] c"%d\00"
define void @gpio_unexport(i32 %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%5 = call i32 @gpio_output(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Type definitions */
struct packit_args_info {
  int dummy;
};

/* Variables and functions */
int cmdline_packit_parser2(int, char **, struct packit_args_info *,
                           int /*<<< orphan*/, int, int);
int cmdline_packit_parser(int argc, char **argv,
                          struct packit_args_info *args_info) {
  return cmdline_packit_parser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<cmdline_packit_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <cmdline_packit_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdline_packit_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <cmdline_packit_parser2@plt>

LLVM IR (-O0):
%struct.packit_args_info = type { i32 }
define i32 @cmdline_packit_parser(i32 %0, i8** %1, %struct.packit_args_info* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.packit_args_info*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.packit_args_info* %2, %struct.packit_args_info** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load %struct.packit_args_info*, %struct.packit_args_info** %6
%10 = call i32 @cmdline_packit_parser2(i32 %7, i8** %8, %struct.packit_args_info* %9, i32 0, i32 1, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.packit_args_info = type { i32 }
define i32 @cmdline_packit_parser(i32 %0, i8** %1, %struct.packit_args_info* %2) {
%4 = tail call i32 @cmdline_packit_parser2(i32 %0, i8** %1, %struct.packit_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
/* Type definitions */
struct table_entry {
  int dummy;
};
struct table_col {
  int dummy;
};

/* Variables and functions */
int l_unit_raw_div(struct table_col *, struct table_entry *, int, char *);
int l_unit_perc(struct table_col *col, struct table_entry *e) {
  return l_unit_raw_div(col, e, 10000, "%.2lf");
}


x86 assembly (clang, -O0):
<l_unit_perc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x2710,%edx
lea    0xecc(%rip),%rcx
call   1030 <l_unit_raw_div@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l_unit_perc>:
lea    0xee9(%rip),%rcx
mov    $0x2710,%edx
jmp    1030 <l_unit_raw_div@plt>

LLVM IR (-O0):
%struct.table_col = type { i32 }
%struct.table_entry = type { i32 }
@.str = [6 x i8] c"%.2lf\00"
define i32 @l_unit_perc(%struct.table_col* %0, %struct.table_entry* %1) {
%3 = alloca %struct.table_col*
%4 = alloca %struct.table_entry*
store %struct.table_col* %0, %struct.table_col** %3
store %struct.table_entry* %1, %struct.table_entry** %4
%5 = load %struct.table_col*, %struct.table_col** %3
%6 = load %struct.table_entry*, %struct.table_entry** %4
%7 = call i32 @l_unit_raw_div(%struct.table_col* %5, %struct.table_entry* %6, i32 10000, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
%struct.table_col = type { i32 }
%struct.table_entry = type { i32 }
@.str = [6 x i8] c"%.2lf\00"
define i32 @l_unit_perc(%struct.table_col* %0, %struct.table_entry* %1) {
%3 = tail call i32 @l_unit_raw_div(%struct.table_col* %0, %struct.table_entry* %1, i32 10000, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Uart_SendString(char *, int);
int /*<<< orphan*/ initd_run();
int /*<<< orphan*/ initd_setup();
int /*<<< orphan*/ serv_setup();
void __main() {
  Uart_SendString("Kernel!\n", 8);
  initd_setup();
  serv_setup();
  initd_run();
}


x86 assembly (clang, -O0):
<__main>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
mov    $0x8,%esi
call   1060 <Uart_SendString@plt>
mov    $0x0,%al
call   1030 <initd_setup@plt>
mov    $0x0,%al
call   1050 <serv_setup@plt>
mov    $0x0,%al
call   1040 <initd_run@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__main>:
push   %rax
lea    0xeb8(%rip),%rdi
mov    $0x8,%esi
call   1060 <Uart_SendString@plt>
xor    %eax,%eax
call   1030 <initd_setup@plt>
xor    %eax,%eax
call   1050 <serv_setup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <initd_run@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Kernel!\0A\00"
define void @__main() {
%1 = call i32 @Uart_SendString(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = call i32 (...) @initd_setup()
%3 = call i32 (...) @serv_setup()
%4 = call i32 (...) @initd_run()
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Kernel!\0A\00"
define void @__main() {
%1 = tail call i32 @Uart_SendString(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = tail call i32 (...) @initd_setup()
%3 = tail call i32 (...) @serv_setup()
%4 = tail call i32 (...) @initd_run()
ret void
}
unsigned xrop3_176_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~S;
  stk2 = D | stk3;
  stk1 = T & stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_176_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_176_0_0>:
shl    $0x8,%edi
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
not    %edi
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_176_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %5
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
ret i32 %31
}

LLVM IR (-O2):
define i32 @xrop3_176_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
char *strdup(char const *);
char *must_strdup(const char *old) {
  char *new = strdup(old);
  if (!new) {
    printf("OUT OF MEMORY\n");
    exit(1);
  }
  return new;
}


x86 assembly (clang, -O0):
<must_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <must_strdup+0x3a>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<must_strdup>:
push   %rax
call   1050 <strdup@plt>
test   %rax,%rax
je     113d <must_strdup+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"OUT OF MEMORY\0A\00"
define i8* @must_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@str = [14 x i8] c"OUT OF MEMORY\00"
define noalias i8* @must_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t l2cap_event_incoming_connection_get_local_cid(const uint8_t *event) {
  return little_endian_read_16(event, 12);
}


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

x86 assembly (clang, -O2):
<l2cap_event_incoming_connection_get_local_cid>:
mov    $0xc,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @l2cap_event_incoming_connection_get_local_cid(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 12)
ret i32 %2
}
/* Type definitions */
struct cmd_arg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ showWanInterface();
void cmdShowInterfaceWan(int cmdType, struct cmd_arg *pCmdArg) {
  showWanInterface();
}


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

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

LLVM IR (-O0):
%struct.cmd_arg = type { i32 }
define void @cmdShowInterfaceWan(i32 %0, %struct.cmd_arg* %1) {
%3 = alloca i32
%4 = alloca %struct.cmd_arg*
store i32 %0, i32* %3
store %struct.cmd_arg* %1, %struct.cmd_arg** %4
%5 = call i32 (...) @showWanInterface()
ret void
}

LLVM IR (-O2):
%struct.cmd_arg = type { i32 }
define void @cmdShowInterfaceWan(i32 %0, %struct.cmd_arg* nocapture readnone %1) {
%3 = tail call i32 (...) @showWanInterface()
ret void
}
int test_imm_55int16_reg(short val) {
  return ((val) & (-0x55 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_55int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffab,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_55int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -85
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_55int16_reg(i16 signext %0) {
%2 = and i16 %0, -85
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void minipack_pack_nil(void *ptr, size_t *sz) {
  *sz = 1;
  *((uint8_t *)ptr) = 0xC0;
}


x86 assembly (clang, -O0):
<minipack_pack_nil>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x1,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xc0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_pack_nil>:
movq   $0x1,(%rsi)
movl   $0xc0,(%rdi)
ret

LLVM IR (-O0):
define void @minipack_pack_nil(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
store i64 1, i64* %5
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32 192, i32* %7
ret void
}

LLVM IR (-O2):
define void @minipack_pack_nil(i8* nocapture writeonly %0, i64* nocapture writeonly %1) {
store i64 1, i64* %1
%3 = bitcast i8* %0 to i32*
store i32 192, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help_min() {
  fprintf(stderr, "min parameters:\n");
  fprintf(stderr, "    get          get the current set minimum frequency (in "
                  "%%, [0;100])\n");
  fprintf(stderr, "    VALUE        set the current minimum frequency to a "
                  "value in [0;100]\n\n");
}


x86 assembly (clang, -O0):
<help_min>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xf0c(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_min>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee2(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf1d(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"min parameters:\0A\00"
@.str.1 = [73 x i8] c" get get the current set minimum frequency (in %%, [0;100])\0A\00"
@.str.2 = [75 x i8] c" VALUE set the current minimum frequency to a value in [0;100]\0A\0A\00"
define void @help_min() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"min parameters:\0A\00"
@.str.1 = [73 x i8] c" get get the current set minimum frequency (in %%, [0;100])\0A\00"
@.str.2 = [75 x i8] c" VALUE set the current minimum frequency to a value in [0;100]\0A\0A\00"
define void @help_min() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ current_view();
int /*<<< orphan*/ deletec(int /*<<< orphan*/);
void backspace_action() { deletec(current_view()); }


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

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

LLVM IR (-O0):
define void @backspace_action() {
%1 = call i32 (...) @current_view()
%2 = call i32 @deletec(i32 %1)
ret void
}

LLVM IR (-O2):
define void @backspace_action() {
%1 = tail call i32 (...) @current_view()
%2 = tail call i32 @deletec(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ d;

/* Variables and functions */
int /*<<< orphan*/ oled_SendCommand(unsigned char *, int);
void ActivateHorizontalScroll() {
  unsigned char d[] = {0x2F};
  oled_SendCommand(d, sizeof(d));
}


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

x86 assembly (clang, -O2):
<ActivateHorizontalScroll>:
push   %rax
movb   $0x2f,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <oled_SendCommand@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.ActivateHorizontalScroll.d = [1 x i8] c"/"
define void @ActivateHorizontalScroll() {
%1 = alloca [1 x i8]
%2 = bitcast [1 x i8]* %1 to i8*
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%4 = call i32 @oled_SendCommand(i8* %3, i32 1)
ret void
}

LLVM IR (-O2):
define void @ActivateHorizontalScroll() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
store i8 47, i8* %2
%3 = call i32 @oled_SendCommand(i8* %2, i32 1)
ret void
}
void os_init_network() {}


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

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

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

LLVM IR (-O2):
define void @os_init_network() {
ret void
}
int sumOfDigits(int number) {
  int sum = 0;
  while (number != 0) {
    sum += (number % 10);
    number /= 10;
  }
  return sum;
}


x86 assembly (clang, -O0):
<sumOfDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <sumOfDigits+0x3c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <sumOfDigits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumOfDigits>:
xor    %eax,%eax
test   %edi,%edi
je     113b <sumOfDigits+0x3b>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <sumOfDigits+0x10>
ret

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

LLVM IR (-O2):
define i32 @sumOfDigits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 10
%7 = add nsw i32 %4, %6
%8 = sdiv i32 %5, 10
%9 = add i32 %5, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ WriteTag(int);
void EndScene() { WriteTag(0xA8); }


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

x86 assembly (clang, -O2):
<EndScene>:
mov    $0xa8,%edi
jmp    1030 <WriteTag@plt>

LLVM IR (-O0):
define void @EndScene() {
%1 = call i32 @WriteTag(i32 168)
ret void
}

LLVM IR (-O2):
define void @EndScene() {
%1 = tail call i32 @WriteTag(i32 168)
ret void
}
int is_le() {
  int v = 0x01020304;
  unsigned char *p = (unsigned char *)&v;
  return *p == 4 && *(p + 3) == 1;
}


x86 assembly (clang, -O0):
<is_le>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1020304,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x4,%ecx
mov    %al,-0x11(%rbp)
jne    1139 <is_le+0x39>
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%eax
cmp    $0x1,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_le() {
%1 = alloca i32
%2 = alloca i8*
store i32 16909060, i32* %1
%3 = bitcast i32* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %6, 4
br i1 %7, label %8, label %14
8: ; preds = %0
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 3
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, 1
br label %14
14: ; preds = %8, %0
%15 = phi i1 [ false, %0 ], [ %13, %8 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_le() {
ret i32 1
}
const char *spec_pha_axis_units(int quant) {
  switch (quant) {
  case 0x0001:
    return ("c/\\omega_p");
    break;
  case 0x0004:
    return ("c");
  }
  return ("");
}


x86 assembly (clang, -O0):
<spec_pha_axis_units>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     112c <spec_pha_axis_units+0x2c>
jmp    111b <spec_pha_axis_units+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
je     113c <spec_pha_axis_units+0x3c>
jmp    114c <spec_pha_axis_units+0x4c>
lea    0xecd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <spec_pha_axis_units+0x57>
lea    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <spec_pha_axis_units+0x57>
lea    0xeb9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spec_pha_axis_units>:
cmp    $0x4,%edi
lea    0xf01(%rip),%rax
lea    0xefb(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x1,%edi
lea    0xee1(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"c/\\omega_p\00"
@.str.1 = [2 x i8] c"c\00"
@.str.2 = [1 x i8] zeroinitializer
define i8* @spec_pha_axis_units(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 1, label %5
i32 4, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [11 x i8] c"c/\\omega_p\00"
@.str.1 = [2 x i8] c"c\00"
@.str.2 = [1 x i8] zeroinitializer
define i8* @spec_pha_axis_units(i32 %0) {
%2 = icmp eq i32 %0, 4
%3 = select i1 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
int f3() {
  int a = -42;
  int b = 35;
  if (a = b)
    return a;
  return 1;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffd6,-0x8(%rbp)
movl   $0x23,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     112c <f3+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <f3+0x33>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f3() {
ret i32 35
}
int unlink(s)
char *s;
{ return (0); }


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

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

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

LLVM IR (-O2):
define i32 @unlink(i8* nocapture readnone %0) {
ret i32 0
}
long long r5(void *x) { return *(long long *)(x + 32763); }


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

x86 assembly (clang, -O2):
<r5>:
mov    0x7ffb(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @r5(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 32763
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @r5(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 32763
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ e_sed();
void e_sed_accu() { e_sed(); }


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

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

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

LLVM IR (-O2):
define void @e_sed_accu() {
%1 = tail call i32 (...) @e_sed()
ret void
}
/* Variables and functions */
int send(int, void const *, int, int);
int send_socket(int socket, const void *buf, int len, int flags) {
  return send(socket, buf, len, flags);
}


x86 assembly (clang, -O0):
<send_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_socket>:
jmp    1030 <send@plt>

LLVM IR (-O0):
define i32 @send_socket(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @send(i32 %9, i8* %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @send_socket(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
double cosine_taylor(double);
double sine_taylor(double);
double tangent_taylor(double radians) {
  return sine_taylor(radians) / cosine_taylor(radians);
}


x86 assembly (clang, -O0):
<tangent_taylor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <sine_taylor@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cosine_taylor@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tangent_taylor>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <sine_taylor@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <cosine_taylor@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @tangent_taylor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sine_taylor(double %3)
%5 = load double, double* %2
%6 = call double @cosine_taylor(double %5)
%7 = fdiv double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @tangent_taylor(double %0) {
%2 = tail call double @sine_taylor(double %0)
%3 = tail call double @cosine_taylor(double %0)
%4 = fdiv double %2, %3
ret double %4
}
int (*toFPtr(unsigned char *in))(int, int, int) {
  unsigned char *out = in;
  int (*fout)(int, int, int) = (int (*)(int, int, int))out;
  return fout;
}


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

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

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

LLVM IR (-O2):
define i32 (i32, i32, i32)* @toFPtr(i8* readnone %0) {
%2 = bitcast i8* %0 to i32 (i32, i32, i32)*
ret i32 (i32, i32, i32)* %2
}
/* Variables and functions */
int atoi(char *);
char *core_command_get_argument_value(int, char **, char const *);
int core_command_get_argument_value_int(int argc, char **argv,
                                        const char *argument) {
  char *value;
  int integer_value;
  integer_value = -1;
  value = core_command_get_argument_value(argc, argv, argument);
  if (value != NULL) {
    integer_value = atoi(value);
  }
  return integer_value;
}


x86 assembly (clang, -O0):
<core_command_get_argument_value_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0xffffffff,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <core_command_get_argument_value@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1165 <core_command_get_argument_value_int+0x45>
mov    -0x20(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<core_command_get_argument_value_int>:
push   %rax
call   1030 <core_command_get_argument_value@plt>
test   %rax,%rax
je     1134 <core_command_get_argument_value_int+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <atoi@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @core_command_get_argument_value_int(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
store i32 -1, i32* %8
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = load i8*, i8** %6
%12 = call i8* @core_command_get_argument_value(i32 %9, i8** %10, i8* %11)
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %18
15: ; preds = %3
%16 = load i8*, i8** %7
%17 = call i32 @atoi(i8* %16)
store i32 %17, i32* %8
br label %18
18: ; preds = %15, %3
%19 = load i32, i32* %8
ret i32 %19
}

LLVM IR (-O2):
define i32 @core_command_get_argument_value_int(i32 %0, i8** %1, i8* %2) {
%4 = tail call i8* @core_command_get_argument_value(i32 %0, i8** %1, i8* %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @atoi(i8* %4)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}