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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
unsigned int i386_get_real_func_len(void *f_start, unsigned int f_len,
                                    char *name) {
  if (((uint8_t *)f_start)[f_len - 1] != 0xc3) {
    fprintf(stderr, "`%s' does not have a ret at the end!\n", name);
    exit(1);
  }
  return f_len - 1;
}


x86 assembly (clang, -O0):
<i386_get_real_func_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
cmpl   $0xc3,(%rax,%rcx,4)
je     116f <i386_get_real_func_len+0x4f>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xea0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i386_get_real_func_len>:
push   %rax
add    $0xffffffff,%esi
cmpl   $0xc3,(%rdi,%rsi,4)
jne    1131 <i386_get_real_func_len+0x11>
mov    %esi,%eax
pop    %rcx
ret
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"`%s' does not have a ret at the end!\0A\00"
define i32 @i386_get_real_func_len(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
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %5
%10 = sub i32 %9, 1
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %8, i64 %11
%13 = load i32, i32* %12
%14 = icmp ne i32 %13, 195
br i1 %14, label %15, label %20
15: ; preds = %3
%16 = load i32, i32* @stderr
%17 = load i8*, i8** %6
%18 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %3
%21 = load i32, i32* %5
%22 = sub i32 %21, 1
ret i32 %22
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"`%s' does not have a ret at the end!\0A\00"
define i32 @i386_get_real_func_len(i8* nocapture %0, i32 %1, i8* %2) {
%4 = bitcast i8* %0 to i32*
%5 = add i32 %1, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %4, i64 %6
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 195
br i1 %9, label %14, label %10
10: ; preds = %3
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %2)
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %3
ret i32 %5
}
int isprefix(char *s, char *prefix) {
  while (*prefix) {
    if (*s != *prefix) {
      return 0;
    }
    ++prefix;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isprefix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114c <isprefix+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     113b <isprefix+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1153 <isprefix+0x53>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <isprefix+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprefix>:
mov    (%rsi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     112f <isprefix+0x2f>
mov    (%rdi),%dl
add    $0x1,%rsi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %cl,%dl
jne    1130 <isprefix+0x30>
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <isprefix+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isprefix(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2
%6 = load i8, i8* %0
br label %10
7: ; preds = %10
%8 = load i8, i8* %14
%9 = icmp eq i8 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %5, %7
%11 = phi i8 [ %3, %5 ], [ %8, %7 ]
%12 = phi i8* [ %1, %5 ], [ %14, %7 ]
%13 = icmp eq i8 %6, %11
%14 = getelementptr inbounds i8, i8* %12, i64 1
br i1 %13, label %7, label %15
15: ; preds = %10, %7, %2
%16 = phi i32 [ 1, %2 ], [ 1, %7 ], [ 0, %10 ]
ret i32 %16
}
/* Variables and functions */
scalar_t__ get_thread_heap();
int rpmalloc_is_thread_initialized(void) {
  return (get_thread_heap() != 0) ? 1 : 0;
}


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

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

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

LLVM IR (-O2):
define i32 @rpmalloc_is_thread_initialized() {
%1 = tail call i64 (...) @get_thread_heap()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int main() {
  int p;
  int x, y;
  {
    if (p)
      x = -1073741825;
    else
      x = 1073741822;
  };
  while (x >= 0) {
    x = x - 1;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1121 <main+0x21>
movl   $0xbfffffff,-0xc(%rbp)
jmp    1128 <main+0x28>
movl   $0x3ffffffe,-0xc(%rbp)
jmp    112d <main+0x2d>
cmpl   $0x0,-0xc(%rbp)
jl     1145 <main+0x45>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x2d>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 -1
}
/* Type definitions */
struct root_struct {
  int dummy;
};

/* Variables and functions */
int f(struct root_struct *root) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.root_struct = type { i32 }
define i32 @f(%struct.root_struct* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct polygon {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_object(int, short *);
void free_polygon(struct polygon *pgn) { free_object(35, (short *)pgn); }


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

x86 assembly (clang, -O2):
<free_polygon>:
mov    %rdi,%rsi
mov    $0x23,%edi
jmp    1030 <free_object@plt>

LLVM IR (-O0):
%struct.polygon = type { i32 }
define void @free_polygon(%struct.polygon* %0) {
%2 = alloca %struct.polygon*
store %struct.polygon* %0, %struct.polygon** %2
%3 = load %struct.polygon*, %struct.polygon** %2
%4 = bitcast %struct.polygon* %3 to i16*
%5 = call i32 @free_object(i32 35, i16* %4)
ret void
}

LLVM IR (-O2):
%struct.polygon = type { i32 }
define void @free_polygon(%struct.polygon* %0) {
%2 = bitcast %struct.polygon* %0 to i16*
%3 = tail call i32 @free_object(i32 35, i16* %2)
ret void
}
long long int foo(long long int x) {
  long long int a = x < 2;
  int b = a >= 0;
  return a + ((x == 0) ? a : b);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x2,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
cltq
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114b <foo+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1153 <foo+0x53>
movslq -0x14(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %ecx,%ecx
cmp    $0x2,%rdi
setl   %cl
test   %rdi,%rdi
mov    $0x1,%eax
cmove  %rcx,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @foo(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = icmp slt i64 %5, 2
%7 = zext i1 %6 to i32
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = icmp sge i64 %9, 0
%11 = zext i1 %10 to i32
store i32 %11, i32* %4
%12 = load i64, i64* %3
%13 = load i64, i64* %2
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %1
%16 = load i64, i64* %3
br label %20
17: ; preds = %1
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
br label %20
20: ; preds = %17, %15
%21 = phi i64 [ %16, %15 ], [ %19, %17 ]
%22 = add nsw i64 %12, %21
ret i64 %22
}

LLVM IR (-O2):
define i64 @foo(i64 %0) {
%2 = icmp slt i64 %0, 2
%3 = zext i1 %2 to i64
%4 = icmp eq i64 %0, 0
%5 = select i1 %4, i64 %3, i64 1
%6 = add nuw nsw i64 %5, %3
ret i64 %6
}
/* Variables and functions */
void *obs_service_get_ref(void *);
void *obs_service_addref_safe_(void *ref) { return obs_service_get_ref(ref); }


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

x86 assembly (clang, -O2):
<obs_service_addref_safe_>:
jmp    1030 <obs_service_get_ref@plt>

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

LLVM IR (-O2):
define i8* @obs_service_addref_safe_(i8* %0) {
%2 = tail call i8* @obs_service_get_ref(i8* %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct chirp_client {
  int dummy;
};
typedef int /*<<< orphan*/ safepath;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ simple_command(struct chirp_client *, int /*<<< orphan*/,
                                  char *, char *);
int /*<<< orphan*/ url_encode(char const *, char *, int);
int64_t chirp_client_openacl(struct chirp_client *c, const char *path,
                             time_t stoptime) {
  char safepath[1024];
  url_encode(path, safepath, sizeof(safepath));
  return simple_command(c, stoptime, "getacl %s\n", safepath);
}


x86 assembly (clang, -O0):
<chirp_client_openacl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x420(%rbp),%rsi
mov    $0x400,%edx
call   1040 <url_encode@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x420(%rbp),%rcx
lea    0xea0(%rip),%rdx
call   1030 <simple_command@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chirp_client_openacl>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %edx,%ebp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %rsi,%rdi
mov    %r14,%rsi
mov    $0x400,%edx
call   1040 <url_encode@plt>
lea    0xeb6(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rcx
call   1030 <simple_command@plt>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.chirp_client = type { i32 }
@.str = [11 x i8] c"getacl %s\0A\00"
define i32 @chirp_client_openacl(%struct.chirp_client* %0, i8* %1, i32 %2) {
%4 = alloca %struct.chirp_client*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [1024 x i8]
store %struct.chirp_client* %0, %struct.chirp_client** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%10 = call i32 @url_encode(i8* %8, i8* %9, i32 1024)
%11 = load %struct.chirp_client*, %struct.chirp_client** %4
%12 = load i32, i32* %6
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%14 = call i32 @simple_command(%struct.chirp_client* %11, i32 %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.chirp_client = type { i32 }
@.str = [11 x i8] c"getacl %s\0A\00"
define i32 @chirp_client_openacl(%struct.chirp_client* %0, i8* %1, i32 %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 @url_encode(i8* %1, i8* %5, i32 1024)
%7 = call i32 @simple_command(%struct.chirp_client* %0, i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 %7
}
__attribute__((always_)) void msi_remove_pci_irq_vectors(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @msi_remove_pci_irq_vectors(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("hello Wade"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"hello Wade\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"hello Wade\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
void gtk_color_selection_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_color_selection_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, unsigned int *);
unsigned char convert_to_hex_value(char *input) {
  unsigned val;
  sscanf(input, "%x", &val);
  return (unsigned char)val;
}


x86 assembly (clang, -O0):
<convert_to_hex_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sscanf@plt>
mov    -0xc(%rbp),%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_to_hex_value>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%al
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define zeroext i8 @convert_to_hex_value(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = trunc i32 %5 to i8
ret i8 %6
}
/* Variables and functions */
int write(int, unsigned char *, int);
int dxl_hal_tx(int socket, unsigned char *pPacket, int numPacket) {
  return write(socket, pPacket, numPacket);
}


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

x86 assembly (clang, -O2):
<dxl_hal_tx>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @dxl_hal_tx(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int produz() {
  int n;
  printf("Indique um numero inteiro (0 encerra): ");
  scanf("%d", &n);
  return n;
}


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

x86 assembly (clang, -O2):
<produz>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Indique um numero inteiro (0 encerra): \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @produz() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [40 x i8] c"Indique um numero inteiro (0 encerra): \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @produz() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 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 = load i32, i32* %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void output_splash() {
  printf("L15P\n");
  printf("An interpretive LISP environment.\n");
  printf("Written by Sean Kelleher.\n");
  printf("ctrl+C to Exit\n");
}


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

x86 assembly (clang, -O2):
<output_splash>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xf05(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"L15P\0A\00"
@.str.1 = [35 x i8] c"An interpretive LISP environment.\0A\00"
@.str.2 = [27 x i8] c"Written by Sean Kelleher.\0A\00"
@.str.3 = [16 x i8] c"ctrl+C to Exit\0A\00"
define void @output_splash() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"L15P\00"
@str.4 = [34 x i8] c"An interpretive LISP environment.\00"
@str.5 = [26 x i8] c"Written by Sean Kelleher.\00"
@str.6 = [15 x i8] c"ctrl+C to Exit\00"
define void @output_splash() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free5(void *);
void free4(void *ptr) { free5(ptr); }


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

x86 assembly (clang, -O2):
<free4>:
jmp    1030 <free5@plt>

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

LLVM IR (-O2):
define void @free4(i8* %0) {
%2 = tail call i32 @free5(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error(const char *str) { fprintf(stderr, "Error: %s\n", str); }


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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int hash_code_char(void *a) {
  char *aa;
  aa = (char *)a;
  return *aa;
}


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

x86 assembly (clang, -O2):
<hash_code_char>:
movsbl (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @hash_code_char(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
ret i32 %3
}
int set_crmode() {}


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

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

LLVM IR (-O0):
define i32 @set_crmode() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @set_crmode() {
ret i32 undef
}
unsigned long long _ZNK9__gnu_cxx13new_allocatorIPiE8max_sizeEv(
    struct l_class_OC_DummyStream *llvm_cbe_this) {
  unsigned long long llvm_cbe_retval;
  unsigned char *llvm_cbe__rethrow;
  struct l_class_OC_DummyStream *llvm_cbe_this_2e_addr;
  struct l_class_OC_DummyStream *llvm_cbe_this1;
  unsigned long long llvm_cbe_tmp__50;
  *(&llvm_cbe_this_2e_addr) = llvm_cbe_this;
  llvm_cbe_this1 = *(&llvm_cbe_this_2e_addr);
  *(&llvm_cbe_retval) = 2305843009213693951ull;
  llvm_cbe_tmp__50 = *(&llvm_cbe_retval);
  return llvm_cbe_tmp__50;
}


x86 assembly (clang, -O0):
<_ZNK9__gnu_cxx13new_allocatorIPiE8max_sizeEv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movabs $0x1fffffffffffffff,%rax
ff ff 1f
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ZNK9__gnu_cxx13new_allocatorIPiE8max_sizeEv>:
movabs $0x1fffffffffffffff,%rax
ff ff 1f
ret

LLVM IR (-O0):
%struct.l_class_OC_DummyStream = type opaque
define i64 @_ZNK9__gnu_cxx13new_allocatorIPiE8max_sizeEv(%struct.l_class_OC_DummyStream* %0) {
%2 = alloca %struct.l_class_OC_DummyStream*
%3 = alloca i64
%4 = alloca i8*
%5 = alloca %struct.l_class_OC_DummyStream*
%6 = alloca %struct.l_class_OC_DummyStream*
%7 = alloca i64
store %struct.l_class_OC_DummyStream* %0, %struct.l_class_OC_DummyStream** %2
%8 = load %struct.l_class_OC_DummyStream*, %struct.l_class_OC_DummyStream** %2
store %struct.l_class_OC_DummyStream* %8, %struct.l_class_OC_DummyStream** %5
%9 = load %struct.l_class_OC_DummyStream*, %struct.l_class_OC_DummyStream** %5
store %struct.l_class_OC_DummyStream* %9, %struct.l_class_OC_DummyStream** %6
store i64 2305843009213693951, i64* %3
%10 = load i64, i64* %3
store i64 %10, i64* %7
%11 = load i64, i64* %7
ret i64 %11
}

LLVM IR (-O2):
%struct.l_class_OC_DummyStream = type opaque
define i64 @_ZNK9__gnu_cxx13new_allocatorIPiE8max_sizeEv(%struct.l_class_OC_DummyStream* nocapture readnone %0) {
ret i64 2305843009213693951
}
int mystrlen(char *s) {
  int i = 0;
  while (s[i] != '\0') {
    i++;
  }
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @mystrlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
void spawn_console(void) {}


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

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

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

LLVM IR (-O2):
define void @spawn_console() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
scalar_t__ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int skip_coord(FILE *fh) { return (fseek(fh, 12, SEEK_CUR) == 0); }


x86 assembly (clang, -O0):
<skip_coord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%edx
mov    $0xc,%esi
call   1030 <fseek@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_coord>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edx
mov    $0xc,%esi
call   1030 <fseek@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SEEK_CUR = global i32 0
define i32 @skip_coord(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @SEEK_CUR
%5 = call i64 @fseek(i32* %3, i32 12, i32 %4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
define i32 @skip_coord(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_CUR
%3 = tail call i64 @fseek(i32* %0, i32 12, i32 %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ vector_nd_alloc(void **, int, int *, int);
void vector_2d_alloc(void **ptr, int element_size, int d1, int d2) {
  int dims[2];
  dims[0] = d1;
  dims[1] = d2;
  vector_nd_alloc(ptr, element_size, dims, 2);
}


x86 assembly (clang, -O0):
<vector_2d_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x1c(%rbp),%rdx
mov    $0x2,%ecx
call   1030 <vector_nd_alloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_2d_alloc>:
push   %rax
mov    %edx,(%rsp)
mov    %ecx,0x4(%rsp)
mov    %rsp,%rdx
mov    $0x2,%ecx
call   1030 <vector_nd_alloc@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @vector_2d_alloc(i8** %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [2 x i32]
store i8** %0, i8*** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %7
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 %10, i32* %11
%12 = load i32, i32* %8
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
store i32 %12, i32* %13
%14 = load i8**, i8*** %5
%15 = load i32, i32* %6
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%17 = call i32 @vector_nd_alloc(i8** %14, i32 %15, i32* %16, i32 2)
ret void
}

LLVM IR (-O2):
define void @vector_2d_alloc(i8** %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [2 x i32]
%6 = bitcast [2 x i32]* %5 to i8*
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %2, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %3, i32* %8
%9 = call i32 @vector_nd_alloc(i8** %0, i32 %1, i32* %7, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_display();
int /*<<< orphan*/ move_cursor_to(int /*<<< orphan*/, int /*<<< orphan*/);
void text_unprepare() {
  clear_display();
  move_cursor_to(0, 0);
}


x86 assembly (clang, -O0):
<text_unprepare>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <clear_display@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <move_cursor_to@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<text_unprepare>:
push   %rax
xor    %eax,%eax
call   1040 <clear_display@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <move_cursor_to@plt>

LLVM IR (-O0):
define void @text_unprepare() {
%1 = call i32 (...) @clear_display()
%2 = call i32 @move_cursor_to(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @text_unprepare() {
%1 = tail call i32 (...) @clear_display()
%2 = tail call i32 @move_cursor_to(i32 0, i32 0)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int eval_is_true(const char *value) {
  return (value && value[0] && (strcmp(value, "0") != 0)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<eval_is_true>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     115b <eval_is_true+0x4b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     115b <eval_is_true+0x4b>
mov    -0x8(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_is_true>:
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
je     1134 <eval_is_true+0x24>
cmpb   $0x0,(%rdi)
je     1134 <eval_is_true+0x24>
lea    0xedc(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
define i32 @eval_is_true(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %15
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %5
%12 = load i8*, i8** %2
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = icmp ne i64 %13, 0
br label %15
15: ; preds = %11, %5, %1
%16 = phi i1 [ false, %5 ], [ false, %1 ], [ %14, %11 ]
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 1, i32 0
ret i32 %18
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
define i32 @eval_is_true(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %1
%11 = phi i32 [ 0, %3 ], [ 0, %1 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int strncmp(char *, char *, int);
void strncmp_diff_length_0() {
  char *x = "12345";
  char *y = "234";
  if (strncmp(x, y, 5) != -1)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strncmp_diff_length_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xedc(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0xffffffff,%eax
je     1149 <strncmp_diff_length_0+0x39>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmp_diff_length_0>:
lea    0xee9(%rip),%rdi
lea    0xee8(%rip),%rsi
mov    $0x5,%edx
jmp    1030 <strncmp@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"12345\00"
@.str.1 = [4 x i8] c"234\00"
define void @strncmp_diff_length_0() {
%1 = tail call i32 @strncmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret void
}
void yyy(void) {}


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

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

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

LLVM IR (-O2):
define void @yyy() {
ret void
}
/* Variables and functions */
int CHAR_BIT;
unsigned int fast_abs(unsigned int v) {
  int const mask = -((unsigned)v >> sizeof(int) * CHAR_BIT - 1);
  return (v + mask) ^ mask;
}


x86 assembly (clang, -O0):
<fast_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ecf(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
sub    $0x1,%rcx
shr    %cl,%eax
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
xor    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_abs>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%cl
shl    $0x2,%cl
add    $0xff,%cl
mov    %edi,%eax
shr    %cl,%eax
sub    %eax,%edi
neg    %eax
xor    %edi,%eax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @fast_abs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @CHAR_BIT
%6 = sext i32 %5 to i64
%7 = mul i64 4, %6
%8 = sub i64 %7, 1
%9 = trunc i64 %8 to i32
%10 = lshr i32 %4, %9
%11 = sub i32 0, %10
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = add i32 %12, %13
%15 = load i32, i32* %3
%16 = xor i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @fast_abs(i32 %0) {
%2 = load i32, i32* @CHAR_BIT
%3 = shl i32 %2, 2
%4 = add i32 %3, -1
%5 = lshr i32 %0, %4
%6 = sub i32 0, %5
%7 = sub i32 %0, %5
%8 = xor i32 %7, %6
ret i32 %8
}
/* Type definitions */
struct msghdr {
  int dummy;
};

/* Variables and functions */
int sendmsg(int, struct msghdr const *, int);
int plat_sendmsg(int s, const struct msghdr *msg, int flags) {
  return (sendmsg(s, msg, flags));
}


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

x86 assembly (clang, -O2):
<plat_sendmsg>:
jmp    1030 <sendmsg@plt>

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

LLVM IR (-O2):
%struct.msghdr = type { i32 }
define i32 @plat_sendmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = tail call i32 @sendmsg(i32 %0, %struct.msghdr* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int getMilliseconds();
unsigned timer_gettick() { return getMilliseconds(); }


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

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

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

LLVM IR (-O2):
define i32 @timer_gettick() {
%1 = tail call i32 (...) @getMilliseconds()
ret i32 %1
}
void update_tzname_etc(struct state const *sp, struct ttinfo const *ttisp) {}


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

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

LLVM IR (-O0):
%struct.state = type opaque
%struct.ttinfo = type opaque
define void @update_tzname_etc(%struct.state* %0, %struct.ttinfo* %1) {
%3 = alloca %struct.state*
%4 = alloca %struct.ttinfo*
store %struct.state* %0, %struct.state** %3
store %struct.ttinfo* %1, %struct.ttinfo** %4
ret void
}

LLVM IR (-O2):
%struct.state = type opaque
%struct.ttinfo = type opaque
define void @update_tzname_etc(%struct.state* nocapture %0, %struct.ttinfo* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
justquit() { exit(0); }


x86 assembly (clang, -O0):
<justquit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<justquit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @justquit() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @justquit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
unsigned int _mutex_kind(unsigned int mid) {
  unsigned int cmd;
  unsigned int sta;
  cmd = (((0x13000000)) | ((4 & ((1 << 3) - 1)) << (8 + (6 + 2))) |
         ((0 & ((1 << 8) - 1)) << (6 + 2)) | ((mid & ((1 << 6) - 1)) << 2));
  sta = (*(volatile unsigned int *)(cmd));
  return (((sta) >> 0) & 0x00000003);
}


x86 assembly (clang, -O0):
<_mutex_kind>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f,%eax
shl    $0x2,%eax
or     $0x13040000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x0,%eax
and    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mutex_kind>:
shl    $0x2,%edi
movzbl %dil,%eax
mov    0x13040000(%rax),%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @_mutex_kind(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 63
%7 = shl i32 %6, 2
%8 = or i32 319029248, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = lshr i32 %13, 0
%15 = and i32 %14, 3
ret i32 %15
}

LLVM IR (-O2):
define i32 @_mutex_kind(i32 %0) {
%2 = shl i32 %0, 2
%3 = and i32 %2, 252
%4 = or i32 %3, 319029248
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 3
ret i32 %8
}
void safe_halt(void) { asm volatile("sti; hlt"); }


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

x86 assembly (clang, -O2):
<safe_halt>:
sti
hlt
ret

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

LLVM IR (-O2):
define void @safe_halt() {
tail call void asm sideeffect "sti; hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint32_t read_32b(const uint8_t *buf) {
  uint32_t value = ((uint32_t)buf[0]) << 24 | ((uint32_t)buf[1]) << 16 |
                   ((uint16_t)buf[2]) << 8 | buf[3];
  return value;
}


x86 assembly (clang, -O0):
<read_32b>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_32b>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @read_32b(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = shl i32 %6, 24
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = shl i32 %10, 16
%12 = or i32 %7, %11
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load i32, i32* %14
%16 = shl i32 %15, 8
%17 = or i32 %12, %16
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 3
%20 = load i32, i32* %19
%21 = or i32 %17, %20
store i32 %21, i32* %3
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @read_32b(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ TOH(int, char, char, char);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Number of plates: ");
  scanf("%d", &n);
  TOH(n, 'A', 'B', 'C');
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1040 <TOH@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Number of plates: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 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 = load i32, i32* %2
%6 = call i32 @TOH(i32 %5, i8 signext 65, i8 signext 66, i8 signext 67)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Number of plates: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 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 = load i32, i32* %1
%6 = call i32 @TOH(i32 %5, i8 signext 65, i8 signext 66, i8 signext 67)
ret i32 0
}
void vd_flatten(double p0x, double p0y, double p1x, double p1y, double p2x,
                double p2y, double p3x, double p3y) {}


x86 assembly (clang, -O0):
<vd_flatten>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @vd_flatten(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7) {
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
store double %0, double* %9
store double %1, double* %10
store double %2, double* %11
store double %3, double* %12
store double %4, double* %13
store double %5, double* %14
store double %6, double* %15
store double %7, double* %16
ret void
}

LLVM IR (-O2):
define void @vd_flatten(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7) {
ret void
}
__attribute__((always_)) void init_desc_masks(struct irq_desc *desc) {}


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

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

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

LLVM IR (-O2):
%struct.irq_desc = type opaque
define void @init_desc_masks(%struct.irq_desc* nocapture %0) {
ret void
}