xunge/DecIR huggingface dataset:
/* Type definitions */
struct simple_track {
  int dummy;
};
struct editable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ do_editable_add(struct editable *, struct simple_track *,
                                   int);
void editable_add(struct editable *e, struct simple_track *track) {
  do_editable_add(e, track, +1);
}


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

x86 assembly (clang, -O2):
<editable_add>:
mov    $0x1,%edx
jmp    1030 <do_editable_add@plt>

LLVM IR (-O0):
%struct.editable = type { i32 }
%struct.simple_track = type { i32 }
define void @editable_add(%struct.editable* %0, %struct.simple_track* %1) {
%3 = alloca %struct.editable*
%4 = alloca %struct.simple_track*
store %struct.editable* %0, %struct.editable** %3
store %struct.simple_track* %1, %struct.simple_track** %4
%5 = load %struct.editable*, %struct.editable** %3
%6 = load %struct.simple_track*, %struct.simple_track** %4
%7 = call i32 @do_editable_add(%struct.editable* %5, %struct.simple_track* %6, i32 1)
ret void
}

LLVM IR (-O2):
%struct.editable = type { i32 }
%struct.simple_track = type { i32 }
define void @editable_add(%struct.editable* %0, %struct.simple_track* %1) {
%3 = tail call i32 @do_editable_add(%struct.editable* %0, %struct.simple_track* %1, i32 1)
ret void
}
void *g_malloc(int size, int zero) {
  char *rv;
  rv = (char *)malloc(size);
  if (zero) {
    if (rv != 0) {
      memset(rv, 0, size);
    }
  }
  return rv;
}


x86 assembly (clang, -O0):
<g_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1164 <g_malloc+0x44>
cmpq   $0x0,-0x10(%rbp)
je     115f <g_malloc+0x3f>
mov    -0x10(%rbp),%rdi
movslq -0x4(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
jmp    1164 <g_malloc+0x44>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_malloc>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
movslq %edi,%r14
mov    %r14,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %ebp,%ebp
je     114a <g_malloc+0x2a>
test   %rbx,%rbx
je     114a <g_malloc+0x2a>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias i8* @g_malloc(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp ne i32 %1, 0
%6 = icmp ne i8* %4, null
%7 = and i1 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
tail call void @llvm.memset.p0i8.i64(i8* align 1 %4, i8 0, i64 %3, i1 false)
br label %9
9: ; preds = %8, %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ ExtSelect(char *, char *, int /*<<< orphan*/);
void ExttTemplateTypeSelect(void) {
  ExtSelect("tTemplateType",
            "tTemplateType.uTemplateType,tTemplateType.cLabel,tTemplateType."
            "uOwner,tTemplateType.uCreatedBy,tTemplateType.uCreatedDate,"
            "tTemplateType.uModBy,tTemplateType.uModDate",
            0);
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"tTemplateType\00"
@.str.1 = [166 x i8] c"tTemplateType.uTemplateType,tTemplateType.cLabel,tTemplateType.uOwner,tTemplateType.uCreatedBy,tTemplateType.uCreatedDate,tTemplateType.uModBy,tTemplateType.uModDate\00"
define void @ExttTemplateTypeSelect() {
%1 = call i32 @ExtSelect(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"tTemplateType\00"
@.str.1 = [166 x i8] c"tTemplateType.uTemplateType,tTemplateType.cLabel,tTemplateType.uOwner,tTemplateType.uCreatedBy,tTemplateType.uCreatedDate,tTemplateType.uModBy,tTemplateType.uModDate\00"
define void @ExttTemplateTypeSelect() {
%1 = tail call i32 @ExtSelect(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void error() {
  char *s = "runtime error\n";
  printf("%s", s);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
lea    0xee7(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"runtime error\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @error() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
void api_tcp_listener_on_closed(struct api_tcp_listener_t *listener) {}


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

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

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

LLVM IR (-O2):
%struct.api_tcp_listener_t = type opaque
define void @api_tcp_listener_on_closed(%struct.api_tcp_listener_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
double f();
main() {
  if (f() != 3.0)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <f@plt>
movsd  0xeb2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1163 <main+0x33>
jp     1163 <main+0x33>
jmp    116a <main+0x3a>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f@plt>
ucomisd 0xec0(%rip),%xmm0
jne    1144 <main+0x14>
jnp    114b <main+0x1b>
xor    %eax,%eax
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double (...) @f()
%3 = fcmp une double %2, 3.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double (...) @f()
%2 = fcmp une double %1, 3.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ bictcp_unregister();
void module_unregister_fake(void) {
  if (0)
    bictcp_unregister();
}


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

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

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

LLVM IR (-O2):
define void @module_unregister_fake() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pq_quit_state_set(int);
void quit(int signum) { pq_quit_state_set(1); }


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

x86 assembly (clang, -O2):
<quit>:
mov    $0x1,%edi
jmp    1030 <pq_quit_state_set@plt>

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

LLVM IR (-O2):
define void @quit(i32 %0) {
%2 = tail call i32 @pq_quit_state_set(i32 1)
ret void
}
double f(double x) { return (4.0 / (1.0 + x * x)); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xee9(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xed5(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mulsd  %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
movsd  0xef4(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double %3, double %4, double 1.000000e+00)
%6 = fdiv double 4.000000e+00, %5
ret double %6
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 1.000000e+00)
%3 = fdiv double 4.000000e+00, %2
ret double %3
}
void tpo_process_compass(void) {}


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

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

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

LLVM IR (-O2):
define void @tpo_process_compass() {
ret void
}
void foo574() {}


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

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

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

LLVM IR (-O2):
define void @foo574() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
char *strstr(char *, char *);
void strstr_start() {
  char *string = "TestString";
  Assert_real((strstr(string, "Test") == string),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/string/strstr.c",
              15, ("String should be found at start"));
}


x86 assembly (clang, -O0):
<strstr_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1040 <strstr@plt>
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xeba(%rip),%rsi
mov    $0xf,%edx
lea    0xf51(%rip),%rcx
call   1030 <Assert_real@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstr_start>:
lea    0xee9(%rip),%rsi
lea    0xf85(%rip),%rcx
mov    $0x1,%edi
mov    $0xf,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"TestString\00"
@.str.1 = [5 x i8] c"Test\00"
@.str.2 = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/string/strstr.c\00"
@.str.3 = [32 x i8] c"String should be found at start\00"
define void @strstr_start() {
%1 = alloca i8*
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i8* @strstr(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = icmp eq i8* %3, %4
%6 = zext i1 %5 to i32
%7 = call i32 @Assert_real(i32 %6, i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.2, i64 0, i64 0), i32 15, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.2 = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/string/strstr.c\00"
@.str.3 = [32 x i8] c"String should be found at start\00"
define void @strstr_start() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.2, i64 0, i64 0), i32 15, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
ret void
}
char hexit(k)
int k;
{
  if (k <= 9)
    return ('0' + k);
  else
    return ('A' + k - 10);
}


x86 assembly (clang, -O0):
<hexit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jg     111f <hexit+0x1f>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    112b <hexit+0x2b>
mov    -0x8(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexit>:
cmp    $0xa,%edi
mov    $0x30,%ecx
mov    $0x37,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @hexit(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 9
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 48, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %2
br label %15
10: ; preds = %1
%11 = load i32, i32* %3
%12 = add nsw i32 65, %11
%13 = sub nsw i32 %12, 10
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %10, %6
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @hexit(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 55
%5 = add i8 %4, %3
ret i8 %5
}
/* Variables and functions */
int lexscan(char *, char **);
int getline(char *buff, char **args) { return lexscan(buff, args); }


x86 assembly (clang, -O0):
<getline>:
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 <lexscan@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getline>:
jmp    1030 <lexscan@plt>

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

LLVM IR (-O2):
define i32 @getline(i8* %0, i8** %1) {
%3 = tail call i32 @lexscan(i8* %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
void outl(long, long);
void plstore(long port, long value) { return outl(value, port); }


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

x86 assembly (clang, -O2):
<plstore>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <outl@plt>

LLVM IR (-O0):
define void @plstore(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
ret void
}

LLVM IR (-O2):
define void @plstore(i64 %0, i64 %1) {
tail call void @outl(i64 %1, i64 %0)
ret void
}
int add_one(int number) { return number + 1; }


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

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

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

LLVM IR (-O2):
define i32 @add_one(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int strlen(char *);
int length(char *string) { return strlen(string); }


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

x86 assembly (clang, -O2):
<length>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @length(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main(void) {
  int ch;
  while ((ch = getchar()) != EOF) {
    if (ch >= 'A' && ch <= 'Z')
      ch += 'a' - 'A';
    putchar(ch);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1172 <main+0x52>
cmpl   $0x41,-0x8(%rbp)
jl     1165 <main+0x45>
cmpl   $0x5a,-0x8(%rbp)
jg     1165 <main+0x45>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     115c <main+0x3c>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x41(%rax),%ecx
lea    0x20(%rax),%edi
cmp    $0x1a,%ecx
cmovae %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %16, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %19
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp sge i32 %8, 65
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp sle i32 %11, 90
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 32
store i32 %15, i32* %2
br label %16
16: ; preds = %13, %10, %7
%17 = load i32, i32* %2
%18 = call i32 @putchar(i32 %17)
br label %3
19: ; preds = %3
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %14, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %11, %4 ], [ %1, %0 ]
%6 = add i32 %5, -65
%7 = icmp ult i32 %6, 26
%8 = add nsw i32 %5, 32
%9 = select i1 %7, i32 %8, i32 %5
%10 = tail call i32 @putchar(i32 %9)
%11 = tail call i32 (...) @getchar()
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %4
14: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ h();
int /*<<< orphan*/ lock();
int rand();
int g() {
  if (rand() % 2 == 0) {
    h();
  } else {
    lock();
    f();
  }
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    116c <g+0x2c>
mov    $0x0,%al
call   1040 <h@plt>
jmp    117a <g+0x3a>
mov    $0x0,%al
call   1030 <lock@plt>
mov    $0x0,%al
call   1050 <f@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rax
xor    %eax,%eax
call   1060 <rand@plt>
test   $0x1,%al
jne    1155 <g+0x15>
xor    %eax,%eax
call   1040 <h@plt>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <lock@plt>
xor    %eax,%eax
call   1050 <f@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @g() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @h()
br label %10
7: ; preds = %0
%8 = call i32 (...) @lock()
%9 = call i32 (...) @f()
br label %10
10: ; preds = %7, %5
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @g() {
%1 = tail call i32 (...) @rand()
%2 = and i32 %1, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @h()
br label %9
6: ; preds = %0
%7 = tail call i32 (...) @lock()
%8 = tail call i32 (...) @f()
br label %9
9: ; preds = %6, %4
ret i32 undef
}
void g_error_free() {}


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

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

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

LLVM IR (-O2):
define void @g_error_free() {
ret void
}
int myfloor(float x) {
  if (x < 0)
    return x - 1;
  else
    return x;
}


x86 assembly (clang, -O0):
<myfloor>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1133 <myfloor+0x33>
movss  -0x8(%rbp),%xmm0
movss  0xedd(%rip),%xmm1
subss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    113b <myfloor+0x3b>
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myfloor>:
movss  0xef8(%rip),%xmm1
addss  %xmm0,%xmm1
xorps  %xmm2,%xmm2
movaps %xmm0,%xmm3
cmpltss %xmm2,%xmm3
andps  %xmm3,%xmm1
andnps %xmm0,%xmm3
orps   %xmm1,%xmm3
cvttss2si %xmm3,%eax
ret

LLVM IR (-O0):
define i32 @myfloor(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load float, float* %3
%8 = fsub float %7, 1.000000e+00
%9 = fptosi float %8 to i32
store i32 %9, i32* %2
br label %13
10: ; preds = %1
%11 = load float, float* %3
%12 = fptosi float %11 to i32
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @myfloor(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fadd float %0, -1.000000e+00
%4 = select i1 %2, float %3, float %0
%5 = fptosi float %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ wawa;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int stream_cost[2][6] = {{7, 9, 3, 4, 8, 4}, {8, 5, 6, 4, 5, 7}};
  int change_cost[6 - 1][2] = {
      {0, 2},
      {2, 0},
  };
  struct node {
    int a;
    short b;
    char c;
  };
  union test {
    struct node hehe;
    char d;
  };
  union test wawa;
  printf("sizeof :%zu\n", sizeof(wawa));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x30,%edx
call   1050 <memcpy@plt>
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movl   $0x2,-0x6c(%rbp)
movl   $0x2,-0x68(%rbp)
lea    0xeb4(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%union.test = type { %struct.node }
%struct.node = type { i32, i16, i8 }
@__const.main.stream_cost = [2 x [6 x i32]] [[6 x i32] [i32 7, i32 9, i32 3, i32 4, i32 8, i32 4], [6 x i32] [i32 8, i32 5, i32 6, i32 4, i32 5, i32 7]]
@.str = [13 x i8] c"sizeof :%zu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x [6 x i32]]
%3 = alloca [5 x [2 x i32]]
%4 = alloca %union.test
store i32 0, i32* %1
%5 = bitcast [2 x [6 x i32]]* %2 to i8*
%6 = bitcast [5 x [2 x i32]]* %3 to i8*
%7 = bitcast i8* %6 to [5 x [2 x i32]]*
%8 = getelementptr inbounds [5 x [2 x i32]], [5 x [2 x i32]]* %7, i32 0, i32 0
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i32 0, i32 1
store i32 2, i32* %9
%10 = getelementptr inbounds [5 x [2 x i32]], [5 x [2 x i32]]* %7, i32 0, i32 1
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i32 0, i32 0
store i32 2, i32* %11
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32, i16, i8 }
@.str = [13 x i8] c"sizeof :%zu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
void qname_close(char *sep) {
  if (sep)
    *sep = ':';
}


x86 assembly (clang, -O0):
<qname_close>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     111a <qname_close+0x1a>
mov    -0x8(%rbp),%rax
movb   $0x3a,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<qname_close>:
test   %rdi,%rdi
je     1108 <qname_close+0x8>
movb   $0x3a,(%rdi)
ret

LLVM IR (-O0):
define void @qname_close(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 %7
5: ; preds = %1
%6 = load i8*, i8** %2
store i8 58, i8* %6
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @qname_close(i8* writeonly %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
store i8 58, i8* %0
br label %4
4: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void FreeVecti(int *vectptr) { free(vectptr); }


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

x86 assembly (clang, -O2):
<FreeVecti>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @FreeVecti(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
void set_HasBMS(unsigned char *pds) { pds[7] |= 0x40; }


x86 assembly (clang, -O0):
<set_HasBMS>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x7(%rax),%ecx
or     $0x40,%ecx
mov    %cl,0x7(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_HasBMS>:
orb    $0x40,0x7(%rdi)
ret

LLVM IR (-O0):
define void @set_HasBMS(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 7
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = or i32 %6, 64
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
ret void
}

LLVM IR (-O2):
define void @set_HasBMS(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 7
%3 = load i8, i8* %2
%4 = or i8 %3, 64
store i8 %4, i8* %2
ret void
}
int test_imm_50uint8_mem(unsigned char *val) {
  return ((*val) & (0x50 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_50uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x50,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_50uint8_mem>:
testb  $0x50,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_50uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 80
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int copy_multprec_target_solutions_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(285, a, b, c);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @copy_multprec_target_solutions_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 285, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int nothing_interesting() { printf("Level Cleared\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Level Cleared\00"
define i32 @nothing_interesting() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ test_arith();
int /*<<< orphan*/ test_memory();
int /*<<< orphan*/ test_memory2();
int main(void) {
  if (1)
    test_arith();
  if (1)
    test_memory();
  test_memory2();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_arith@plt>
mov    $0x0,%al
call   1030 <test_memory@plt>
mov    $0x0,%al
call   1050 <test_memory2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_arith@plt>
xor    %eax,%eax
call   1030 <test_memory@plt>
xor    %eax,%eax
call   1050 <test_memory2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_arith()
%3 = call i32 (...) @test_memory()
%4 = call i32 (...) @test_memory2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_arith()
%2 = tail call i32 (...) @test_memory()
%3 = tail call i32 (...) @test_memory2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print(int *, int);
int /*<<< orphan*/ sort(int *, int);
int main() {
  int data[5] = {2, 3, 1, 8, 5};
  int length = 5;
  print(data, length);
  sort(data, length);
  print(data, length);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <print@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <sort@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <print@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.data = [5 x i32] [i32 2, i32 3, i32 1, i32 8, i32 5]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
store i32 5, i32* %3
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @print(i32* %5, i32 %6)
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @sort(i32* %8, i32 %9)
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%12 = load i32, i32* %3
%13 = call i32 @print(i32* %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.data = [5 x i32] [i32 2, i32 3, i32 1, i32 8, i32 5]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @print(i32* %3, i32 5)
%5 = call i32 @sort(i32* %3, i32 5)
%6 = call i32 @print(i32* %3, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int fall(const char *error) {
  fprintf(stderr, "%s\n", error);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fall>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @fall(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @fall(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
unsigned int dictGenHashFunction(void const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
unsigned int hash_str(const void *str) {
  return dictGenHashFunction(str, strlen((const char *)str));
}


x86 assembly (clang, -O0):
<hash_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <dictGenHashFunction@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_str>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <dictGenHashFunction@plt>

LLVM IR (-O0):
define i32 @hash_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @dictGenHashFunction(i8* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @hash_str(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @dictGenHashFunction(i8* %0, i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ htole64(int /*<<< orphan*/);
void WriteLE64(unsigned char *ptr, uint64_t x) {
  *((uint64_t *)ptr) = htole64(x);
}


x86 assembly (clang, -O0):
<WriteLE64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htole64@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteLE64>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htole64@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @WriteLE64(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @htole64(i32 %1)
%4 = bitcast i8* %0 to i32*
store i32 %3, i32* %4
ret void
}
long long gu_time_getres() { return 1000LL; }


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

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

LLVM IR (-O0):
define i64 @gu_time_getres() {
ret i64 1000
}

LLVM IR (-O2):
define i64 @gu_time_getres() {
ret i64 1000
}
int main(int argc, char **argv) { return argc - 2; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = add nsw i32 %0, -2
ret i32 %3
}
double fatPixel(double c, double center, double fat) {
  return center + ((c - center) * fat);
}


x86 assembly (clang, -O0):
<fatPixel>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatPixel>:
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fatPixel(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fsub double %8, %9
%11 = load double, double* %6
%12 = call double @llvm.fmuladd.f64(double %10, double %11, double %7)
ret double %12
}

LLVM IR (-O2):
define double @fatPixel(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = tail call double @llvm.fmuladd.f64(double %4, double %2, double %1)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void HandleParameter(void *cookie, const char *szString) {
  printf("parameterHandler: '%s'\n", szString);
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"parameterHandler: '%s'\0A\00"
define void @HandleParameter(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"parameterHandler: '%s'\0A\00"
define void @HandleParameter(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short);
int main(int argc, char **argv) {
  short val;
  char *p_val;
  p_val = (char *)&val;
  p_val[1] = 0x12;
  p_val[0] = 0x34;
  printf("%x\n", val);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x12(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x12,0x1(%rax)
mov    -0x20(%rbp),%rax
movb   $0x34,(%rax)
lea    0xebc(%rip),%rdi
movswl -0x12(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i16
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast i16* %6 to i8*
store i8* %8, i8** %7
%9 = load i8*, i8** %7
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8 18, i8* %10
%11 = load i8*, i8** %7
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 52, i8* %12
%13 = load i16, i16* %6
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 signext %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 signext 4660)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void shellcodeAnalyzer() { printf("Not yet implemented.\n"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Not yet implemented.\0A\00"
define void @shellcodeAnalyzer() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"Not yet implemented.\00"
define void @shellcodeAnalyzer() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int convert0To5(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int num = 10120;
  printf("%d", convert0To5(num));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @convert0To5(i32 10120)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EP94M0_Reg_Set_Bit(int, int);
void EP94M0_Power_Down() { EP94M0_Reg_Set_Bit(0x40, 0x04); }


x86 assembly (clang, -O0):
<EP94M0_Power_Down>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%edi
mov    $0x4,%esi
call   1030 <EP94M0_Reg_Set_Bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EP94M0_Power_Down>:
mov    $0x40,%edi
mov    $0x4,%esi
jmp    1030 <EP94M0_Reg_Set_Bit@plt>

LLVM IR (-O0):
define void @EP94M0_Power_Down() {
%1 = call i32 @EP94M0_Reg_Set_Bit(i32 64, i32 4)
ret void
}

LLVM IR (-O2):
define void @EP94M0_Power_Down() {
%1 = tail call i32 @EP94M0_Reg_Set_Bit(i32 64, i32 4)
ret void
}
/* Type definitions */
struct in_addr {
  int dummy;
};
struct dns_rr_ptr {
  int dummy;
};
struct dns_ctx {
  int dummy;
};

/* Variables and functions */
scalar_t__ dns_resolve(struct dns_ctx *, int /*<<< orphan*/);
int /*<<< orphan*/ dns_submit_a4ptr(struct dns_ctx *, struct in_addr const *,
                                    int /*<<< orphan*/ *, int /*<<< orphan*/ *);
struct dns_rr_ptr *dns_resolve_a4ptr(struct dns_ctx *ctx,
                                     const struct in_addr *addr) {
  return (struct dns_rr_ptr *)dns_resolve(
      ctx, dns_submit_a4ptr(ctx, addr, NULL, NULL));
}


x86 assembly (clang, -O0):
<dns_resolve_a4ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1040 <dns_submit_a4ptr@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <dns_resolve@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_resolve_a4ptr>:
push   %rbx
mov    %rdi,%rbx
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <dns_submit_a4ptr@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <dns_resolve@plt>

LLVM IR (-O0):
%struct.dns_rr_ptr = type { i32 }
%struct.dns_ctx = type { i32 }
%struct.in_addr = type { i32 }
define %struct.dns_rr_ptr* @dns_resolve_a4ptr(%struct.dns_ctx* %0, %struct.in_addr* %1) {
%3 = alloca %struct.dns_ctx*
%4 = alloca %struct.in_addr*
store %struct.dns_ctx* %0, %struct.dns_ctx** %3
store %struct.in_addr* %1, %struct.in_addr** %4
%5 = load %struct.dns_ctx*, %struct.dns_ctx** %3
%6 = load %struct.dns_ctx*, %struct.dns_ctx** %3
%7 = load %struct.in_addr*, %struct.in_addr** %4
%8 = call i32 @dns_submit_a4ptr(%struct.dns_ctx* %6, %struct.in_addr* %7, i32* null, i32* null)
%9 = call i64 @dns_resolve(%struct.dns_ctx* %5, i32 %8)
%10 = inttoptr i64 %9 to %struct.dns_rr_ptr*
ret %struct.dns_rr_ptr* %10
}

LLVM IR (-O2):
%struct.dns_rr_ptr = type { i32 }
%struct.dns_ctx = type { i32 }
%struct.in_addr = type { i32 }
define %struct.dns_rr_ptr* @dns_resolve_a4ptr(%struct.dns_ctx* %0, %struct.in_addr* %1) {
%3 = tail call i32 @dns_submit_a4ptr(%struct.dns_ctx* %0, %struct.in_addr* %1, i32* null, i32* null)
%4 = tail call i64 @dns_resolve(%struct.dns_ctx* %0, i32 %3)
%5 = inttoptr i64 %4 to %struct.dns_rr_ptr*
ret %struct.dns_rr_ptr* %5
}
char alpha(char a) {
  if (a > 'z')
    return a - 26;
  return a;
}


x86 assembly (clang, -O0):
<alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jle    1126 <alpha+0x26>
movsbl -0x2(%rbp),%eax
sub    $0x1a,%eax
mov    %al,-0x1(%rbp)
jmp    112c <alpha+0x2c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alpha>:
lea    -0x1a(%rdi),%eax
cmp    $0x7b,%dil
movzbl %al,%eax
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @alpha(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sgt i32 %5, 122
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 26
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
br label %14
12: ; preds = %1
%13 = load i8, i8* %3
store i8 %13, i8* %2
br label %14
14: ; preds = %12, %7
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @alpha(i8 signext %0) {
%2 = icmp sgt i8 %0, 122
%3 = add i8 %0, -26
%4 = select i1 %2, i8 %3, i8 %0
ret i8 %4
}