xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int arg7(int a1, int a2, int a3, int a4, int a5, int a6, int a7) {
  printf("%d\n", a1 + a2 + a3 + a4 + a5 + a6 + a7);
  return a7;
}


x86 assembly (clang, -O0):
<arg7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%esi
add    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
add    -0x10(%rbp),%esi
add    -0x14(%rbp),%esi
add    -0x18(%rbp),%esi
add    0x10(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg7>:
push   %rbx
mov    0x10(%rsp),%ebx
add    %edi,%esi
add    %edx,%esi
add    %ecx,%esi
add    %r8d,%esi
add    %r9d,%esi
add    %ebx,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @arg7(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = add nsw i32 %15, %16
%18 = load i32, i32* %10
%19 = add nsw i32 %17, %18
%20 = load i32, i32* %11
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %12
%23 = add nsw i32 %21, %22
%24 = load i32, i32* %13
%25 = add nsw i32 %23, %24
%26 = load i32, i32* %14
%27 = add nsw i32 %25, %26
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %27)
%29 = load i32, i32* %14
ret i32 %29
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @arg7(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 returned %6) {
%8 = add nsw i32 %1, %0
%9 = add nsw i32 %8, %2
%10 = add nsw i32 %9, %3
%11 = add nsw i32 %10, %4
%12 = add nsw i32 %11, %5
%13 = add nsw i32 %12, %6
%14 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void display_version() {
  printf("etherdownload version2.0\nby Wu Qi Ming\nQi-Ming.Wu@lantiq.com\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [62 x i8] c"etherdownload version2.0\0Aby Wu Qi Ming\0AQi-Ming.Wu@lantiq.com\0A\00"
define void @display_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [61 x i8] c"etherdownload version2.0\0Aby Wu Qi Ming\0AQi-Ming.Wu@lantiq.com\00"
define void @display_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reallocarray(int /*<<< orphan*/ *, int, int);
int main(void) { return (!reallocarray(NULL, 2, 2)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
mov    $0x2,%edx
mov    %edx,%esi
call   1030 <reallocarray@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @reallocarray(i32* null, i32 2, i32 2)
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @reallocarray(i32* null, i32 2, i32 2)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ serial;
};
typedef TYPE_1__ XErrorEvent;

/* Variables and functions */
unsigned long get_XErrorEvent_serial(void *_p) {
  return (unsigned long)((XErrorEvent *)_p)->serial;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XErrorEvent_serial(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XErrorEvent_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void debugCbDummy(void *ref, int command, const char *data) {}


x86 assembly (clang, -O0):
<debugCbDummy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @debugCbDummy(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @debugCbDummy(i8* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
struct stat {
  unsigned int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
unsigned int filesize(char *name) {
  struct stat statbuf;
  if (stat(name, &statbuf) != 0) {
    fprintf(stderr, "Cannot open file %s\n", name);
    exit(0);
  }
  return statbuf.st_size;
}


x86 assembly (clang, -O0):
<filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
je     1173 <filesize+0x43>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filesize>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
test   %rax,%rax
jne    1151 <filesize+0x21>
mov    0x8(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [21 x i8] c"Cannot open file %s\0A\00"
define i32 @filesize(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %2
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %1
%13 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%14 = load i32, i32* %13
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [21 x i8] c"Cannot open file %s\0A\00"
define i32 @filesize(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%12 = load i32, i32* %11
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int mknodat(int dirfd, const char *pathname, mode_t mode, dev_t dev) {
  fprintf(stderr, "mknod not supported\n");
  return 1;
}


x86 assembly (clang, -O0):
<mknodat>:
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    0x2eb4(%rip),%rax
mov    (%rax),%edi
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mknodat>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"mknod not supported\0A\00"
define i32 @mknodat(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* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"mknod not supported\0A\00"
define i32 @mknodat(i32 %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ syscall2(int, int);
int main(int argc, char *argv[]) {
  int ino = atoi(argv[1]);
  printf("Requesting inode info for inode no. %d on /dev/hda\n", ino);
  syscall2(777, ino);
  exit(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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
mov    $0x309,%edi
call   1030 <syscall2@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x309,%edi
mov    %ebx,%esi
call   1030 <syscall2@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"Requesting inode info for inode no. %d on /dev/hda\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @atoi(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %6
%14 = call i32 @syscall2(i32 777, i32 %13)
%15 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [52 x i8] c"Requesting inode info for inode no. %d on /dev/hda\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @syscall2(i32 777, i32 %5)
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ swap(int *, int *);
int /*<<< orphan*/ swap_bits(int *, int *);
int test_both_zero() {
  int a = 0;
  int b = 0;
  swap(&a, &b);
  int c = 0;
  int d = 0;
  swap_bits(&a, &b);
  return a == 0 && b == 0 && c == 0 && d == 0;
}


x86 assembly (clang, -O0):
<test_both_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <swap@plt>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <swap_bits@plt>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x11(%rbp)
jne    1195 <test_both_zero+0x75>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jne    1195 <test_both_zero+0x75>
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jne    1195 <test_both_zero+0x75>
cmpl   $0x0,-0x10(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_both_zero>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0x4(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <swap@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <swap_bits@plt>
mov    0x4(%rsp),%ecx
xor    %eax,%eax
or     (%rsp),%ecx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @test_both_zero() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @swap(i32* %1, i32* %2)
%6 = call i32 @swap_bits(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 0
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 0
%11 = select i1 %8, i1 %10, i1 false
%12 = zext i1 %11 to i32
ret i32 %12
}
long long f2lz(float a) { return (long long)a; }


x86 assembly (clang, -O0):
<f2lz>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2lz>:
cvttss2si %xmm0,%rax
ret

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

LLVM IR (-O2):
define i64 @f2lz(float %0) {
%2 = fptosi float %0 to i64
ret i64 %2
}
void _Jv_JNI_InvokeFunctions(void) {}


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

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

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

LLVM IR (-O2):
define void @_Jv_JNI_InvokeFunctions() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *me) { fprintf(stderr, "Usage: %s -h FILE [NR]\n", me); }


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Usage: %s -h FILE [NR]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ longuest_substring(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strlen(char const *);
void test_case(const char *s) {
  printf("===============\n");
  printf("%s\n%lu\n", s, longuest_substring(s, strlen(s)));
}


x86 assembly (clang, -O0):
<test_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1050 <longuest_substring@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_case>:
push   %rbx
mov    %rdi,%rbx
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1060 <longuest_substring@plt>
lea    0xe97(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"===============\0A\00"
@.str.1 = [8 x i8] c"%s\0A%lu\0A\00"
define void @test_case(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @longuest_substring(i8* %5, i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 %8)
ret void
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"%s\0A%lu\0A\00"
@str = [16 x i8] c"===============\00"
define void @test_case(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @longuest_substring(i8* %0, i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ flash_eeprom_read_uint32(int /*<<< orphan*/);
uint32_t read_uint32(uint32_t offset) {
  return flash_eeprom_read_uint32(offset);
}


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

x86 assembly (clang, -O2):
<read_uint32>:
jmp    1030 <flash_eeprom_read_uint32@plt>

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

LLVM IR (-O2):
define i32 @read_uint32(i32 %0) {
%2 = tail call i32 @flash_eeprom_read_uint32(i32 %0)
ret i32 %2
}
short barriereNatif16(short entier) {
  return (short)((unsigned short)entier >> 8) | (entier << 8);
}


x86 assembly (clang, -O0):
<barriereNatif16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
cwtl
movswl -0x2(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<barriereNatif16>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define signext i16 @barriereNatif16(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 8
%6 = trunc i32 %5 to i16
%7 = sext i16 %6 to i32
%8 = load i16, i16* %2
%9 = sext i16 %8 to i32
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define signext i16 @barriereNatif16(i16 signext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
void fw3_xt_free_match_udata(struct xtables_match *m) { return; }


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

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

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

LLVM IR (-O2):
%struct.xtables_match = type opaque
define void @fw3_xt_free_match_udata(%struct.xtables_match* nocapture %0) {
ret void
}
/* Variables and functions */
int omap_rev();
int is_omap7xx(void) { return ((omap_rev() & 0xff) == (0x07)) ? 1 : 0; }


x86 assembly (clang, -O0):
<is_omap7xx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <omap_rev@plt>
mov    %eax,%edx
and    $0xff,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x7,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_omap7xx>:
push   %rax
xor    %eax,%eax
call   1030 <omap_rev@plt>
xor    %ecx,%ecx
cmp    $0x7,%al
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_omap7xx() {
%1 = call i32 (...) @omap_rev()
%2 = and i32 %1, 255
%3 = icmp eq i32 %2, 7
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 1, i32 0
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_omap7xx() {
%1 = tail call i32 (...) @omap_rev()
%2 = and i32 %1, 255
%3 = icmp eq i32 %2, 7
%4 = zext i1 %3 to i32
ret i32 %4
}
char clamp(float f) {
  int val;
  val = (int)(f * 255.5f + 0.5f);
  if (val > 255)
    val = 255;
  if (val < 0)
    val = 0;
  return (char)val;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xee2(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jle    1141 <clamp+0x41>
movl   $0xff,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1152 <clamp+0x52>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
mulss  0xef8(%rip),%xmm0
addss  0xef4(%rip),%xmm0
cvttss2si %xmm0,%eax
cmp    $0xff,%eax
mov    $0xff,%ecx
cmovl  %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovg  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @clamp(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = call float @llvm.fmuladd.f32(float %4, float 2.555000e+02, float 5.000000e-01)
%6 = fptosi float %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 255
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 255, i32* %3
br label %10
10: ; preds = %9, %1
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 0, i32* %3
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %3
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @clamp(float %0) {
%2 = tail call float @llvm.fmuladd.f32(float %0, float 2.555000e+02, float 5.000000e-01)
%3 = fptosi float %2 to i32
%4 = icmp slt i32 %3, 255
%5 = select i1 %4, i32 %3, i32 255
%6 = icmp sgt i32 %5, 0
%7 = select i1 %6, i32 %5, i32 0
%8 = trunc i32 %7 to i8
ret i8 %8
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ bits_per_rgb;
};
typedef TYPE_1__ Visual;

/* Variables and functions */
int get_Visual_bits_per_rgb(void *_p) {
  return (int)((Visual *)_p)->bits_per_rgb;
}


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

x86 assembly (clang, -O2):
<get_Visual_bits_per_rgb>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_Visual_bits_per_rgb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_Visual_bits_per_rgb(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *open_2(char *filename) {
  FILE *this = fopen(filename, "w");
  return this;
}


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define noalias i32* @open_2(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32* %2
}
int tdefault_has_exited(struct target_ops *self, int arg1, int arg2,
                        int *arg3) {
  return 0;
}


x86 assembly (clang, -O0):
<tdefault_has_exited>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.target_ops = type opaque
define i32 @tdefault_has_exited(%struct.target_ops* nocapture readnone %0, i32 %1, i32 %2, i32* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ xor_encode_uint(unsigned int *, unsigned int const *, size_t,
                                   unsigned int const *, size_t);
void xor_decode_uint(unsigned int *dec, const unsigned int *enc, size_t len,
                     const unsigned int *key, size_t keylen) {
  xor_encode_uint(dec, enc, len, key, keylen);
}


x86 assembly (clang, -O0):
<xor_decode_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <xor_encode_uint@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor_decode_uint>:
jmp    1030 <xor_encode_uint@plt>

LLVM IR (-O0):
define void @xor_decode_uint(i32* %0, i32* %1, i64 %2, i32* %3, i64 %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i32*
%10 = alloca i64
store i32* %0, i32** %6
store i32* %1, i32** %7
store i64 %2, i64* %8
store i32* %3, i32** %9
store i64 %4, i64* %10
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i64, i64* %8
%14 = load i32*, i32** %9
%15 = load i64, i64* %10
%16 = call i32 @xor_encode_uint(i32* %11, i32* %12, i64 %13, i32* %14, i64 %15)
ret void
}

LLVM IR (-O2):
define void @xor_decode_uint(i32* %0, i32* %1, i64 %2, i32* %3, i64 %4) {
%6 = tail call i32 @xor_encode_uint(i32* %0, i32* %1, i64 %2, i32* %3, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void yyerror(const char s[]) { printf("!!! %s\n", s); }


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

x86 assembly (clang, -O2):
<yyerror>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"!!! %s\0A\00"
define void @yyerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void strLowerCase(char str[]) {
  for (char *index = str; *index > 0; index++) {
    if (*index >= 'A' && *index <= 'Z') {
      *index -= 'A' - 'a';
    }
  }
}


x86 assembly (clang, -O0):
<strLowerCase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jle    1162 <strLowerCase+0x62>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     114c <strLowerCase+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     114c <strLowerCase+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
sub    $0xffffffe0,%ecx
mov    %cl,(%rax)
jmp    1151 <strLowerCase+0x51>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strLowerCase+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strLowerCase>:
mov    (%rdi),%al
test   %al,%al
jle    112a <strLowerCase+0x2a>
add    $0x1,%rdi
jmp    111b <strLowerCase+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jle    112a <strLowerCase+0x2a>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <strLowerCase+0x10>
add    $0x20,%al
mov    %al,-0x1(%rdi)
jmp    1110 <strLowerCase+0x10>
ret

LLVM IR (-O0):
define void @strLowerCase(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 = %27, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %30
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %26
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 90
br i1 %19, label %20, label %26
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = sub nsw i32 %23, -32
%25 = trunc i32 %24 to i8
store i8 %25, i8* %21
br label %26
26: ; preds = %20, %15, %10
br label %27
27: ; preds = %26
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %3
br label %5
30: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @strLowerCase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp sgt i8 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %12, %1
ret void
5: ; preds = %1, %12
%6 = phi i8 [ %14, %12 ], [ %2, %1 ]
%7 = phi i8* [ %13, %12 ], [ %0, %1 ]
%8 = add nsw i8 %6, -65
%9 = icmp ult i8 %8, 26
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = add nuw nsw i8 %6, 32
store i8 %11, i8* %7
br label %12
12: ; preds = %5, %10
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = icmp sgt i8 %14, 0
br i1 %15, label %5, label %4
}
/* Variables and functions */
scalar_t__ ltr_int_resume_tir();
int ltr_int_tracker_resume() { return ltr_int_resume_tir() ? 0 : -1; }


x86 assembly (clang, -O0):
<ltr_int_tracker_resume>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ltr_int_resume_tir@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltr_int_tracker_resume>:
push   %rax
xor    %eax,%eax
call   1030 <ltr_int_resume_tir@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ltr_int_tracker_resume() {
%1 = call i64 (...) @ltr_int_resume_tir()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 0, i32 -1
ret i32 %4
}

LLVM IR (-O2):
define i32 @ltr_int_tracker_resume() {
%1 = tail call i64 (...) @ltr_int_resume_tir()
%2 = icmp eq i64 %1, 0
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t loas_get_length(const uint8_t *p) {
  return ((p[1] & 0x01f) << 8) | p[2];
}


x86 assembly (clang, -O0):
<loas_get_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
and    $0x1f,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x8(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<loas_get_length>:
mov    0x4(%rdi),%eax
and    $0x1f,%eax
shl    $0x8,%eax
or     0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @loas_get_length(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = and i32 %5, 31
%7 = shl i32 %6, 8
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 2
%10 = load i32, i32* %9
%11 = or i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @loas_get_length(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = and i32 %4, 7936
%6 = getelementptr inbounds i32, i32* %0, i64 2
%7 = load i32, i32* %6
%8 = or i32 %5, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ echo(char *);
fuu2() {
omg:
  echo("aaa");
  goto omg;
}


x86 assembly (clang, -O0):
<fuu2>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <fuu2+0x9>
lea    0xee0(%rip),%rdi
call   1030 <echo@plt>
jmp    1119 <fuu2+0x9>

x86 assembly (clang, -O2):
<fuu2>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <echo@plt>
jmp    1120 <fuu2+0x10>

LLVM IR (-O0):
@.str = [4 x i8] c"aaa\00"
define i32 @fuu2() {
br label %1
1: ; preds = %1, %0
%2 = call i32 @echo(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %1
}

LLVM IR (-O2):
@.str = [4 x i8] c"aaa\00"
define i32 @fuu2() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @echo(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ delwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ echo();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char getchar();
void _quit(WINDOW *win) {
  while (getchar() != 'q')
    continue;
  delwin(win);
  echo();
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0x71,%eax
je     1174 <_quit+0x24>
jmp    115c <_quit+0xc>
mov    -0x8(%rbp),%rdi
call   1050 <delwin@plt>
mov    $0x0,%al
call   1030 <echo@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<_quit>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x71,%al
jne    1160 <_quit+0x10>
mov    %rbx,%rdi
call   1050 <delwin@plt>
xor    %eax,%eax
call   1030 <echo@plt>
xor    %eax,%eax
call   1060 <endwin@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define void @_quit(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
br label %3
3: ; preds = %7, %1
%4 = call signext i8 (...) @getchar()
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 113
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i32*, i32** %2
%10 = call i32 @delwin(i32* %9)
%11 = call i32 (...) @echo()
%12 = call i32 (...) @endwin()
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @_quit(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 113
br i1 %4, label %5, label %2
5: ; preds = %2
%6 = tail call i32 @delwin(i32* %0)
%7 = tail call i32 (...) @echo()
%8 = tail call i32 (...) @endwin()
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void BusyWait(uint32_t numticks) {
  (*(volatile unsigned long *)(0xE0004000 + 0x00)) = 0x01;
  (*(volatile unsigned long *)(0xE0004000 + 0x18)) =
      1 + (*(volatile unsigned long *)(0xE0004000 + 0x08)) + numticks;
  while (!((*(volatile unsigned long *)(0xE0004000 + 0x00)) & 0x01))
    ;
}


x86 assembly (clang, -O0):
<BusyWait>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xe0004000,%eax
movq   $0x1,(%rax)
mov    $0xe0004008,%eax
mov    (%rax),%rcx
add    $0x1,%rcx
movslq -0x4(%rbp),%rax
add    %rax,%rcx
mov    $0xe0004018,%eax
mov    %rcx,(%rax)
mov    $0xe0004000,%eax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1150 <BusyWait+0x50>
jmp    1155 <BusyWait+0x55>
jmp    112e <BusyWait+0x2e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BusyWait>:
mov    $0xe0004000,%eax
movq   $0x1,(%rax)
mov    0x8(%rax),%rcx
movslq %edi,%rdx
add    %rdx,%rcx
add    $0x1,%rcx
mov    %rcx,0x18(%rax)
xchg   %ax,%ax
testq  $0x1,(%rax)
je     1120 <BusyWait+0x20>
ret

LLVM IR (-O0):
define void @BusyWait(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store volatile i64 1, i64* inttoptr (i64 3758112768 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 3758112776 to i64*)
%4 = add i64 1, %3
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = add i64 %4, %6
store volatile i64 %7, i64* inttoptr (i64 3758112792 to i64*)
br label %8
8: ; preds = %13, %1
%9 = load volatile i64, i64* inttoptr (i64 3758112768 to i64*)
%10 = and i64 %9, 1
%11 = icmp ne i64 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %14
13: ; preds = %8
br label %8
14: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @BusyWait(i32 %0) {
store volatile i64 1, i64* inttoptr (i64 3758112768 to i64*)
%2 = load volatile i64, i64* inttoptr (i64 3758112776 to i64*)
%3 = sext i32 %0 to i64
%4 = add nsw i64 %3, 1
%5 = add i64 %4, %2
store volatile i64 %5, i64* inttoptr (i64 3758112792 to i64*)
br label %6
6: ; preds = %6, %1
%7 = load volatile i64, i64* inttoptr (i64 3758112768 to i64*)
%8 = and i64 %7, 1
%9 = icmp eq i64 %8, 0
br i1 %9, label %6, label %10
10: ; preds = %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCD4Bit_print(int /*<<< orphan*/);
void LCD4Bit_printIn(const char *buffer) {
  while (*buffer != '\0') {
    LCD4Bit_print(*buffer++);
  }
}


x86 assembly (clang, -O0):
<LCD4Bit_printIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <LCD4Bit_printIn+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <LCD4Bit_print@plt>
jmp    111c <LCD4Bit_printIn+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @LCD4Bit_printIn(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* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @LCD4Bit_print(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timeval {
  unsigned long long tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t ss_utime(void) {
  struct timeval t;
  gettimeofday(&t, NULL);
  return t.tv_sec * 1000000ULL + t.tv_usec;
}


x86 assembly (clang, -O0):
<ss_utime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%rax
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ss_utime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @ss_utime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = mul i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = add i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @ss_utime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int lh_char_equal(void *k1, void *k2) {
  return (strcmp((char *)k1, (char *)k2) == 0);
}


x86 assembly (clang, -O0):
<lh_char_equal>:
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 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lh_char_equal>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lh_char_equal(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 i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @lh_char_equal(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void C_bad_memory(void) {
  panic("there is not enough stack-space to run this executable");
}


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

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

LLVM IR (-O0):
@.str = [55 x i8] c"there is not enough stack-space to run this executable\00"
define void @C_bad_memory() {
%1 = call i32 @panic(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"there is not enough stack-space to run this executable\00"
define void @C_bad_memory() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strdup_len(char const *, int);
char *strrchr(char const *, char);
char *get_basename(const char *filename) {
  char *p;
  p = strrchr(filename, '/');
  if (!p)
    return NULL;
  return strdup_len(filename, p - filename);
}


x86 assembly (clang, -O0):
<get_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1156 <get_basename+0x36>
movq   $0x0,-0x8(%rbp)
jmp    1170 <get_basename+0x50>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
call   1030 <strdup_len@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     1140 <get_basename+0x20>
sub    %ebx,%eax
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <strdup_len@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @get_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i8* null, i8** %2
br label %19
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = load i8*, i8** %3
%14 = ptrtoint i8* %12 to i64
%15 = ptrtoint i8* %13 to i64
%16 = sub i64 %14, %15
%17 = trunc i64 %16 to i32
%18 = call i8* @strdup_len(i8* %11, i32 %17)
store i8* %18, i8** %2
br label %19
19: ; preds = %10, %9
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @get_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = ptrtoint i8* %2 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = tail call i8* @strdup_len(i8* %0, i32 %8)
br label %10
10: ; preds = %1, %4
%11 = phi i8* [ %9, %4 ], [ null, %1 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_ch(char *ch) {
  printf("\x1b[1m"
         "\x1b[30m"
         "%s"
         "\x1b[0m",
         ch);
}


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

x86 assembly (clang, -O2):
<print_ch>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"\1B[1m\1B[30m%s\1B[0m\00"
define void @print_ch(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}