xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print(void) {
  printf("hello from mylib.c\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"hello from mylib.c\00"
define void @print() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
void foo156(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo156(i32 %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
scalar_t__ eeprom_read_word(scalar_t__ *);
bool eeconfig_is_disabled(void) {
  return (eeprom_read_word((uint16_t *)0) == (uint16_t)0xFFFF);
}


x86 assembly (clang, -O0):
<eeconfig_is_disabled>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <eeprom_read_word@plt>
cmp    $0xffff,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeconfig_is_disabled>:
push   %rax
xor    %edi,%edi
call   1030 <eeprom_read_word@plt>
xor    %ecx,%ecx
cmp    $0xffff,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @eeconfig_is_disabled() {
%1 = call i64 @eeprom_read_word(i64* null)
%2 = icmp eq i64 %1, 65535
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @eeconfig_is_disabled() {
%1 = tail call i64 @eeprom_read_word(i64* null)
%2 = icmp eq i64 %1, 65535
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int LOG_INFO;
int LOG_LOCAL0;
int /*<<< orphan*/ TidyUp();
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ strsignal(int);
int /*<<< orphan*/ syslog(int, char *, int /*<<< orphan*/);
void FatalSigHandler(int sig) {
  syslog(LOG_LOCAL0 | LOG_INFO, "caught signal: %s - exiting", strsignal(sig));
  closelog();
  TidyUp();
  _exit(0);
}


x86 assembly (clang, -O0):
<FatalSigHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e86(%rip),%rax
mov    (%rax),%eax
mov    0x2e6d(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <strsignal@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%edx
lea    0xe7c(%rip),%rsi
call   1050 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
mov    $0x0,%al
call   1070 <TidyUp@plt>
xor    %edi,%edi
call   1040 <_exit@plt>

x86 assembly (clang, -O2):
<FatalSigHandler>:
push   %rbx
mov    0x2e90(%rip),%rax
mov    0x2e79(%rip),%rcx
mov    (%rcx),%ebx
or     (%rax),%ebx
call   1060 <strsignal@plt>
lea    0xe91(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
call   1050 <syslog@plt>
xor    %eax,%eax
call   1030 <closelog@plt>
xor    %eax,%eax
call   1070 <TidyUp@plt>
xor    %edi,%edi
call   1040 <_exit@plt>

LLVM IR (-O0):
@LOG_LOCAL0 = global i32 0
@LOG_INFO = global i32 0
@.str = [28 x i8] c"caught signal: %s - exiting\00"
define void @FatalSigHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @LOG_LOCAL0
%4 = load i32, i32* @LOG_INFO
%5 = or i32 %3, %4
%6 = load i32, i32* %2
%7 = call i32 @strsignal(i32 %6)
%8 = call i32 @syslog(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 (...) @closelog()
%10 = call i32 (...) @TidyUp()
%11 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@LOG_LOCAL0 = global i32 0
@LOG_INFO = global i32 0
@.str = [28 x i8] c"caught signal: %s - exiting\00"
define void @FatalSigHandler(i32 %0) {
%2 = load i32, i32* @LOG_LOCAL0
%3 = load i32, i32* @LOG_INFO
%4 = or i32 %3, %2
%5 = tail call i32 @strsignal(i32 %0)
%6 = tail call i32 @syslog(i32 %4, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @closelog()
%8 = tail call i32 (...) @TidyUp()
%9 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
scalar_t__ unlink(char const *);
int unlink_file(const char *file) {
  if (unlink(file) != 0) {
    fprintf(stderr, "Error unlinking %s: %s\n", file, strerror(errno));
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<unlink_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
je     1193 <unlink_file+0x63>
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
lea    0xe7e(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    119a <unlink_file+0x6a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink_file>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <unlink@plt>
test   %rax,%rax
je     116f <unlink_file+0x3f>
mov    0x2e99(%rip),%rax
mov    (%rax),%ebp
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea2(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <fprintf@plt>
xor    %eax,%eax
jmp    1174 <unlink_file+0x44>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Error unlinking %s: %s\0A\00"
@errno = global i32 0
define i32 @unlink_file(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @unlink(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %3
%10 = load i32, i32* @errno
%11 = call i8* @strerror(i32 %10)
%12 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %11)
store i32 0, i32* %2
br label %14
13: ; preds = %1
store i32 1, i32* %2
br label %14
14: ; preds = %13, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Error unlinking %s: %s\0A\00"
@errno = global i32 0
define i32 @unlink_file(i8* %0) {
%2 = tail call i64 @unlink(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %7)
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %10
}
/* Type definitions */
struct h2get_h2_header {
  int dummy;
};
struct h2get_ctx {
  int dummy;
};
struct h2get_buf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ h2get_buf_printf(struct h2get_buf *, char *, char *);
void h2get_frame_render_push_promise(struct h2get_ctx *ctx,
                                     struct h2get_buf *out,
                                     struct h2get_h2_header *h, char *p,
                                     size_t plen) {
  h2get_buf_printf(out, "\n%s",
                   "h2get_frame_"
                   "push_promise"
                   "_render");
}


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

x86 assembly (clang, -O2):
<h2get_frame_render_push_promise>:
mov    %rsi,%rdi
lea    0xee6(%rip),%rsi
lea    0xee3(%rip),%rdx
jmp    1030 <h2get_buf_printf@plt>

LLVM IR (-O0):
%struct.h2get_ctx = type { i32 }
%struct.h2get_buf = type { i32 }
%struct.h2get_h2_header = type { i32 }
@.str = [4 x i8] c"\0A%s\00"
@.str.1 = [32 x i8] c"h2get_frame_push_promise_render\00"
define void @h2get_frame_render_push_promise(%struct.h2get_ctx* %0, %struct.h2get_buf* %1, %struct.h2get_h2_header* %2, i8* %3, i64 %4) {
%6 = alloca %struct.h2get_ctx*
%7 = alloca %struct.h2get_buf*
%8 = alloca %struct.h2get_h2_header*
%9 = alloca i8*
%10 = alloca i64
store %struct.h2get_ctx* %0, %struct.h2get_ctx** %6
store %struct.h2get_buf* %1, %struct.h2get_buf** %7
store %struct.h2get_h2_header* %2, %struct.h2get_h2_header** %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load %struct.h2get_buf*, %struct.h2get_buf** %7
%12 = call i32 @h2get_buf_printf(%struct.h2get_buf* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.h2get_ctx = type { i32 }
%struct.h2get_buf = type { i32 }
%struct.h2get_h2_header = type { i32 }
@.str = [4 x i8] c"\0A%s\00"
@.str.1 = [32 x i8] c"h2get_frame_push_promise_render\00"
define void @h2get_frame_render_push_promise(%struct.h2get_ctx* nocapture readnone %0, %struct.h2get_buf* %1, %struct.h2get_h2_header* nocapture readnone %2, i8* nocapture readnone %3, i64 %4) {
%6 = tail call i32 @h2get_buf_printf(%struct.h2get_buf* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ strdup(char *);
char *xml_init(char *str) { return (char *)strdup(str); }


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

x86 assembly (clang, -O2):
<xml_init>:
jmp    1030 <strdup@plt>

LLVM IR (-O0):
define i8* @xml_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strdup(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @xml_init(i8* %0) {
%2 = tail call i64 @strdup(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int rc_bindkey(char *, char *);
int cmd_bind(int argc, char **argv) {
  if (argc < 3)
    return -1;
  return rc_bindkey(argv[1], argv[2]);
}


x86 assembly (clang, -O0):
<cmd_bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1135 <cmd_bind+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <cmd_bind+0x3d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <rc_bindkey@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_bind>:
cmp    $0x3,%edi
jge    111b <cmd_bind+0xb>
mov    $0xffffffff,%eax
ret
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
jmp    1030 <rc_bindkey@plt>

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

LLVM IR (-O2):
define i32 @cmd_bind(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @rc_bindkey(i8* %6, i8* %8)
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ %9, %4 ], [ -1, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int x;
  int *endx;
  x = 0;
  printf("%d", x);
  printf(" e ");
  endx = &x;
  *endx = 1;
  printf("%d", x);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c" e \00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_drange(int, double *, int);
int main() {
  double x[] = {1.0, -2.0, -3.0, 4.0, -5.0, -6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_drange(N, x, stride);
  printf("range: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%edx
call   1050 <stdlib_strided_drange@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_drange@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e+00, double -6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [12 x i8] c"range: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_drange(i32 %6, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double -2.000000e+00, double -3.000000e+00, double 4.000000e+00, double -5.000000e+00, double -6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [12 x i8] c"range: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_drange(i32 4, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
void Command_delay(int n) {
  n = n * 1000000;
  while (n--)
    ;
}


x86 assembly (clang, -O0):
<Command_delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xf4240,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     112a <Command_delay+0x2a>
jmp    1111 <Command_delay+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @Command_delay(i32 %0) {
ret void
}
void yy_1_TableInlineHeader(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_TableInlineHeader(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
unsigned int strlen(char *);
void deleteShield(char *str) {
  for (unsigned int i = 0; i < strlen(str - 1); i++)
    str[i] = str[i + 1];
  return;
}


x86 assembly (clang, -O0):
<deleteShield>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xffffffffffffffff,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jae    116a <deleteShield+0x5a>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <deleteShield+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteShield>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
lea    -0x1(%rdi),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
je     1150 <deleteShield+0x40>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
lea    0x1(%rax),%rbx
movzbl 0x1(%r15,%rax,1),%ecx
mov    %cl,(%r15,%rax,1)
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    %rbx,%rax
cmp    %rcx,%rbx
jb     1130 <deleteShield+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @deleteShield(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -1
%3 = tail call i32 @strlen(i8* %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %1
ret void
6: ; preds = %1, %6
%7 = phi i64 [ %8, %6 ], [ 0, %1 ]
%8 = add nuw nsw i64 %7, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %10, i8* %11
%12 = tail call i32 @strlen(i8* %2)
%13 = zext i32 %12 to i64
%14 = icmp ult i64 %8, %13
br i1 %14, label %6, label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void people_migration() { printf("Computing people migrations\n"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"Computing people migrations\0A\00"
define void @people_migration() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"Computing people migrations\00"
define void @people_migration() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ center_panel();
void do_cmd_center_map(void) { center_panel(); }


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

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

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

LLVM IR (-O2):
define void @do_cmd_center_map() {
%1 = tail call i32 (...) @center_panel()
ret void
}
/* Type definitions */
struct product {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void product_ops_set_description(struct product *product, const char *desc) {
  printf("product::set_description()\n");
}


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

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

LLVM IR (-O0):
%struct.product = type { i32 }
@.str = [28 x i8] c"product::set_description()\0A\00"
define void @product_ops_set_description(%struct.product* %0, i8* %1) {
%3 = alloca %struct.product*
%4 = alloca i8*
store %struct.product* %0, %struct.product** %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.product = type { i32 }
@str = [27 x i8] c"product::set_description()\00"
define void @product_ops_set_description(%struct.product* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hw_i80_reset();
int /*<<< orphan*/ lcd_device_init();
int lcd_read_id();
void lcd_reset(void) {
  hw_i80_reset();
  while (0x02049481L != lcd_read_id())
    ;
  lcd_device_init();
}


x86 assembly (clang, -O0):
<lcd_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <hw_i80_reset@plt>
mov    $0x0,%al
call   1030 <lcd_read_id@plt>
movslq %eax,%rcx
mov    $0x2049481,%eax
cmp    %rcx,%rax
je     1158 <lcd_reset+0x28>
jmp    113b <lcd_reset+0xb>
mov    $0x0,%al
call   1050 <lcd_device_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_reset>:
push   %rax
xor    %eax,%eax
call   1040 <hw_i80_reset@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <lcd_read_id@plt>
cmp    $0x2049481,%eax
jne    1140 <lcd_reset+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1050 <lcd_device_init@plt>

LLVM IR (-O0):
define void @lcd_reset() {
%1 = call i32 (...) @hw_i80_reset()
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @lcd_read_id()
%4 = sext i32 %3 to i64
%5 = icmp ne i64 33854593, %4
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = call i32 (...) @lcd_device_init()
ret void
}

LLVM IR (-O2):
define void @lcd_reset() {
%1 = tail call i32 (...) @hw_i80_reset()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @lcd_read_id()
%4 = icmp eq i32 %3, 33854593
br i1 %4, label %5, label %2
5: ; preds = %2
%6 = tail call i32 (...) @lcd_device_init()
ret void
}
/* Type definitions */
struct gpio_bank {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _set_gpio_direction(struct gpio_bank *, int /*<<< orphan*/,
                                       int);
int /*<<< orphan*/ get_gpio_index(int);
void _reset_gpio(struct gpio_bank *bank, int gpio) {
  _set_gpio_direction(bank, get_gpio_index(gpio), 1);
}


x86 assembly (clang, -O0):
<_reset_gpio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <get_gpio_index@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1040 <_set_gpio_direction@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_reset_gpio>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <get_gpio_index@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
pop    %rbx
jmp    1040 <_set_gpio_direction@plt>

LLVM IR (-O0):
%struct.gpio_bank = type { i32 }
define void @_reset_gpio(%struct.gpio_bank* %0, i32 %1) {
%3 = alloca %struct.gpio_bank*
%4 = alloca i32
store %struct.gpio_bank* %0, %struct.gpio_bank** %3
store i32 %1, i32* %4
%5 = load %struct.gpio_bank*, %struct.gpio_bank** %3
%6 = load i32, i32* %4
%7 = call i32 @get_gpio_index(i32 %6)
%8 = call i32 @_set_gpio_direction(%struct.gpio_bank* %5, i32 %7, i32 1)
ret void
}

LLVM IR (-O2):
%struct.gpio_bank = type { i32 }
define void @_reset_gpio(%struct.gpio_bank* %0, i32 %1) {
%3 = tail call i32 @get_gpio_index(i32 %1)
%4 = tail call i32 @_set_gpio_direction(%struct.gpio_bank* %0, i32 %3, i32 1)
ret void
}
int fun260() { return 260; }


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

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

LLVM IR (-O0):
define i32 @fun260() {
ret i32 260
}

LLVM IR (-O2):
define i32 @fun260() {
ret i32 260
}
/* Variables and functions */
int *vrna_loopidx_from_ptable(short const *);
int *make_loop_index_pt(short *pt) {
  return vrna_loopidx_from_ptable((const short *)pt);
}


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

x86 assembly (clang, -O2):
<make_loop_index_pt>:
jmp    1030 <vrna_loopidx_from_ptable@plt>

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

LLVM IR (-O2):
define i32* @make_loop_index_pt(i16* %0) {
%2 = tail call i32* @vrna_loopidx_from_ptable(i16* %0)
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ runExample();
int main(void) { runExample(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @runExample()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @runExample()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ InitApp();
int32_t main(void) {
  InitApp();
  while (1) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <InitApp@plt>
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <InitApp@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @InitApp()
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @InitApp()
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_int(void *i) { printf("%d", *((int *)i)); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @print_int(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
double fade(double t) {
  double const t_cubed = t * t * t;
  return t_cubed * (t * ((t * 6) - 15) + 10);
}


x86 assembly (clang, -O0):
<fade>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  0xed4(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xed0(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xeb0(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fade>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xeec(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xee8(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  0xee4(%rip),%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fade(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = load double, double* %2
%8 = fmul double %6, %7
store double %8, double* %3
%9 = load double, double* %3
%10 = load double, double* %2
%11 = load double, double* %2
%12 = call double @llvm.fmuladd.f64(double %11, double 6.000000e+00, double -1.500000e+01)
%13 = call double @llvm.fmuladd.f64(double %10, double %12, double 1.000000e+01)
%14 = fmul double %9, %13
ret double %14
}

LLVM IR (-O2):
define double @fade(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
%4 = tail call double @llvm.fmuladd.f64(double %0, double 6.000000e+00, double -1.500000e+01)
%5 = tail call double @llvm.fmuladd.f64(double %0, double %4, double 1.000000e+01)
%6 = fmul double %3, %5
ret double %6
}
void RTZipTarCmd(void) {}


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

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

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

LLVM IR (-O2):
define void @RTZipTarCmd() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
main() {
  int a;
  for (a = 0; a <= 100; a++)
    printf("a: %2d--", a);
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     114f <main+0x3f>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"a: %2d--\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 101
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @putchar(i32 10)
ret i32 0
}
int get_max_count(int object_count) {
  if (object_count == 3)
    return 999;
  else if (object_count == 4)
    return 9999;
  else if (object_count == 5)
    return 99999;
  else if (object_count == 6)
    return 999999;
  else if (object_count == 7)
    return 9999999;
  else if (object_count == 8)
    return 99999999;
  else
    return 0;
}


x86 assembly (clang, -O0):
<get_max_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    111d <get_max_count+0x1d>
movl   $0x3e7,-0x4(%rbp)
jmp    1192 <get_max_count+0x92>
cmpl   $0x4,-0x8(%rbp)
jne    1133 <get_max_count+0x33>
movl   $0x270f,-0x4(%rbp)
jmp    1192 <get_max_count+0x92>
cmpl   $0x5,-0x8(%rbp)
jne    1149 <get_max_count+0x49>
movl   $0x1869f,-0x4(%rbp)
jmp    1192 <get_max_count+0x92>
cmpl   $0x6,-0x8(%rbp)
jne    115f <get_max_count+0x5f>
movl   $0xf423f,-0x4(%rbp)
jmp    1192 <get_max_count+0x92>
cmpl   $0x7,-0x8(%rbp)
jne    1175 <get_max_count+0x75>
movl   $0x98967f,-0x4(%rbp)
jmp    1192 <get_max_count+0x92>
cmpl   $0x8,-0x8(%rbp)
jne    118b <get_max_count+0x8b>
movl   $0x5f5e0ff,-0x4(%rbp)
jmp    1192 <get_max_count+0x92>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_max_count>:
add    $0xfffffffd,%edi
xor    %eax,%eax
cmp    $0x5,%edi
ja     1117 <get_max_count+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @get_max_count(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 3
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 999, i32* %2
br label %28
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 4
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 9999, i32* %2
br label %28
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 5
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 99999, i32* %2
br label %28
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 6
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 999999, i32* %2
br label %28
19: ; preds = %15
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, 7
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 9999999, i32* %2
br label %28
23: ; preds = %19
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 8
br i1 %25, label %26, label %27
26: ; preds = %23
store i32 99999999, i32* %2
br label %28
27: ; preds = %23
store i32 0, i32* %2
br label %28
28: ; preds = %27, %26, %22, %18, %14, %10, %6
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
@switch.table.get_max_count = [6 x i32] [i32 999, i32 9999, i32 99999, i32 999999, i32 9999999, i32 99999999]
define i32 @get_max_count(i32 %0) {
%2 = add i32 %0, -3
%3 = icmp ult i32 %2, 6
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.get_max_count, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int /*<<< orphan*/ hea_set_u64_bits(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void hea_cq_aer_eq_out_of_range_err_reset(__u64 *aer) {
  *aer = hea_set_u64_bits(*aer, 0, 10, 11);
}


x86 assembly (clang, -O0):
<hea_cq_aer_eq_out_of_range_err_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    $0xa,%edx
mov    $0xb,%ecx
call   1030 <hea_set_u64_bits@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hea_cq_aer_eq_out_of_range_err_reset>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
xor    %esi,%esi
mov    $0xa,%edx
mov    $0xb,%ecx
call   1030 <hea_set_u64_bits@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @hea_cq_aer_eq_out_of_range_err_reset(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @hea_set_u64_bits(i32 %4, i32 0, i32 10, i32 11)
%6 = load i32*, i32** %2
store i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @hea_cq_aer_eq_out_of_range_err_reset(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @hea_set_u64_bits(i32 %2, i32 0, i32 10, i32 11)
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned int, char *);
scalar_t__ write_to_path(char *, char *);
int write_gpio(unsigned int gpio, char *filename, char *val) {
  char path[80];
  snprintf(path, 80, "/sys/class/gpio/gpio%d/%s", gpio, filename);
  if (write_to_path(path, val))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<write_gpio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    $0x50,%esi
lea    0xeb6(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <write_to_path@plt>
cmp    $0x0,%rax
je     1172 <write_gpio+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1179 <write_gpio+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_gpio>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rdx,%rbx
mov    %rsi,%r8
mov    %edi,%ecx
lea    0xeca(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x50,%esi
call   1040 <snprintf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <write_to_path@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [26 x i8] c"/sys/class/gpio/gpio%d/%s\00"
define i32 @write_gpio(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [80 x i8]
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = call i32 @snprintf(i8* %9, i32 80, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %11)
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
%14 = load i8*, i8** %7
%15 = call i64 @write_to_path(i8* %13, i8* %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %3
store i32 1, i32* %4
br label %19
18: ; preds = %3
store i32 0, i32* %4
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@.str = [26 x i8] c"/sys/class/gpio/gpio%d/%s\00"
define i32 @write_gpio(i32 %0, i8* %1, i8* %2) {
%4 = alloca [80 x i8]
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 80, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%7 = call i64 @write_to_path(i8* %5, i8* %2)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
void UARTDisableIrDA(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000014))) &= ~(0x00000002);
}


x86 assembly (clang, -O0):
<UARTDisableIrDA>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%rcx
and    $0xfffffffffffffffd,%rcx
mov    %rcx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTDisableIrDA>:
andq   $0xfffffffffffffffd,0x14(%rdi)
ret

LLVM IR (-O0):
define void @UARTDisableIrDA(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 20
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -3
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @UARTDisableIrDA(i64 %0) {
%2 = add i64 %0, 20
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -3
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *i = NULL;
  int a = 3;
  i = &a;
  printf("%d\n", *i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xebd(%rip),%rdi
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    $0x3,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printSettings() {
  printf("Change Battlefield Layout (1)\n");
  printf("Change number of ships (2)\n");
  printf("Back to main menu (0)\n");
}


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

x86 assembly (clang, -O2):
<printSettings>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Change Battlefield Layout (1)\0A\00"
@.str.1 = [28 x i8] c"Change number of ships (2)\0A\00"
@.str.2 = [23 x i8] c"Back to main menu (0)\0A\00"
define void @printSettings() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"Change Battlefield Layout (1)\00"
@str.3 = [27 x i8] c"Change number of ships (2)\00"
@str.4 = [22 x i8] c"Back to main menu (0)\00"
define void @printSettings() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void test3(void *dead) {
  sleep(3000000);
  printf("test3\n");
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2dc6c0,%edi
call   1040 <sleep@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
push   %rax
mov    $0x2dc6c0,%edi
call   1040 <sleep@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [6 x i8] c"test3\00"
define void @test3(i8* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 3000000)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *malloc(size_t);
int dcAllocWX(size_t size, void **pp) {
  *pp = malloc(size);
  return 0;
}


x86 assembly (clang, -O0):
<dcAllocWX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcAllocWX>:
push   %rbx
mov    %rsi,%rbx
call   1030 <malloc@plt>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @dcAllocWX(i64 %0, i8** nocapture writeonly %1) {
%3 = tail call i8* @malloc(i64 %0)
store i8* %3, i8** %1
ret i32 0
}
/* Variables and functions */
int rand_range(int /*<<< orphan*/, int);
int rand_sign() { return 2 * rand_range(0, 1) - 1; }


x86 assembly (clang, -O0):
<rand_sign>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <rand_range@plt>
shl    $0x1,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_sign>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <rand_range@plt>
add    %eax,%eax
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rand_sign() {
%1 = call i32 @rand_range(i32 0, i32 1)
%2 = mul nsw i32 2, %1
%3 = sub nsw i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @rand_sign() {
%1 = tail call i32 @rand_range(i32 0, i32 1)
%2 = shl nsw i32 %1, 1
%3 = add nsw i32 %2, -1
ret i32 %3
}