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

/* Variables and functions */
int /*<<< orphan*/ SN_close_env(struct SN_env *);
extern void finnish_ISO_8859_1_close_env(struct SN_env *z) { SN_close_env(z); }


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

x86 assembly (clang, -O2):
<finnish_ISO_8859_1_close_env>:
jmp    1030 <SN_close_env@plt>

LLVM IR (-O0):
%struct.SN_env = type { i32 }
define void @finnish_ISO_8859_1_close_env(%struct.SN_env* %0) {
%2 = alloca %struct.SN_env*
store %struct.SN_env* %0, %struct.SN_env** %2
%3 = load %struct.SN_env*, %struct.SN_env** %2
%4 = call i32 @SN_close_env(%struct.SN_env* %3)
ret void
}

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define void @finnish_ISO_8859_1_close_env(%struct.SN_env* %0) {
%2 = tail call i32 @SN_close_env(%struct.SN_env* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
int /*<<< orphan*/ VtolSelfTuningStatsHandle();
void VtolSelfTuningStatsUpdated() {
  UAVObjUpdated(VtolSelfTuningStatsHandle());
}


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

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

LLVM IR (-O0):
define void @VtolSelfTuningStatsUpdated() {
%1 = call i32 (...) @VtolSelfTuningStatsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @VtolSelfTuningStatsUpdated() {
%1 = tail call i32 (...) @VtolSelfTuningStatsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
void swap(int *p, int *q) {
  int t = *p;
  *p = *q;
  *q = t;
}


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

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

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
const struct node *scope_node_const(const struct scope *sc) {
  return scope_node(__builtin_choose_expr(
      __builtin_types_compatible_p(__typeof__(sc), const struct node *),
      (struct node *)(sc),
      __builtin_choose_expr(
          __builtin_types_compatible_p(__typeof__(sc), const struct module *),
          (struct module *)(sc),
          __builtin_choose_expr(
              __builtin_types_compatible_p(__typeof__(sc), const struct typ *),
              (struct typ *)(sc),
              __builtin_choose_expr(
                  __builtin_types_compatible_p(__typeof__(sc),
                                               const struct toplevel *),
                  (struct toplevel *)(sc),
                  __builtin_choose_expr(
                      __builtin_types_compatible_p(__typeof__(sc),
                                                   const struct scope *),
                      (struct scope *)(sc),
                      __builtin_choose_expr(
                          __builtin_types_compatible_p(__typeof__(sc),
                                                       const struct typset *),
                          (struct typset *)(sc),
                          __builtin_choose_expr(
                              __builtin_types_compatible_p(
                                  __typeof__(sc), const struct constraint *),
                              (struct constraint *)(sc),
                              __builtin_choose_expr(
                                  __builtin_types_compatible_p(
                                      __typeof__(sc),
                                      const struct vecancestor *),
                                  (struct vecancestor *)(sc), (sc))))))))));
}


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

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

LLVM IR (-O0):
%struct.node = type opaque
%struct.scope = type opaque
define %struct.node* @scope_node_const(%struct.scope* %0) {
%2 = alloca %struct.scope*
store %struct.scope* %0, %struct.scope** %2
%3 = load %struct.scope*, %struct.scope** %2
%4 = call i32 (%struct.scope*, ...) bitcast (i32 (...)* @scope_node to i32 (%struct.scope*, ...)*)(%struct.scope* %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to %struct.node*
ret %struct.node* %6
}

LLVM IR (-O2):
%struct.node = type opaque
%struct.scope = type opaque
define %struct.node* @scope_node_const(%struct.scope* %0) {
%2 = tail call i32 (%struct.scope*, ...) bitcast (i32 (...)* @scope_node to i32 (%struct.scope*, ...)*)(%struct.scope* %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to %struct.node*
ret %struct.node* %4
}
/* Variables and functions */
char get_chr_crsr(int);
char get_chr_mjr_crsr(void) { return get_chr_crsr(1); }


x86 assembly (clang, -O0):
<get_chr_mjr_crsr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <get_chr_crsr@plt>
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @get_chr_mjr_crsr() {
%1 = call signext i8 @get_chr_crsr(i32 1)
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @get_chr_mjr_crsr() {
%1 = tail call signext i8 @get_chr_crsr(i32 1)
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "Usage: %s format [arg ...]\n", getprogname());
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xeb8(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xec8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: %s format [arg ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: %s format [arg ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void close_logs() { closelog(); }


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

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

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

LLVM IR (-O2):
define void @close_logs() {
%1 = tail call i32 (...) @closelog()
ret void
}
void ar5312_irq_init(void) {}


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

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

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

LLVM IR (-O2):
define void @ar5312_irq_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello world!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world!\00"
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 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
short foo() {
  short i = (short)(1 << 15);
  return i;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movw   $0x8000,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    $0x8000,%ax
ret

LLVM IR (-O0):
define signext i16 @foo() {
%1 = alloca i16
store i16 -32768, i16* %1
%2 = load i16, i16* %1
ret i16 %2
}

LLVM IR (-O2):
define signext i16 @foo() {
ret i16 -32768
}
void CPUID(unsigned int input, unsigned int *output) {
  __asm__ __volatile__("cpuid"
                       : "=a"(output[0]), "=b"(output[1]), "=c"(output[2]),
                         "=d"(output[3])
                       : "a"(input));
}


x86 assembly (clang, -O0):
<CPUID>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%r8
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %eax,%r9d
mov    -0x28(%rbp),%rax
mov    %ecx,%esi
mov    -0x20(%rbp),%rcx
mov    %r9d,(%r8)
mov    %ebx,0x4(%rdi)
mov    %esi,0x8(%rcx)
mov    %edx,0xc(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<CPUID>:
push   %rbx
mov    %edi,%eax
cpuid
mov    %eax,(%rsi)
mov    %ebx,0x4(%rsi)
mov    %ecx,0x8(%rsi)
mov    %edx,0xc(%rsi)
pop    %rbx
ret

LLVM IR (-O0):
define void @CPUID(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 3
%13 = load i32, i32* %3
%14 = call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %13)
%15 = extractvalue { i32, i32, i32, i32 } %14, 0
%16 = extractvalue { i32, i32, i32, i32 } %14, 1
%17 = extractvalue { i32, i32, i32, i32 } %14, 2
%18 = extractvalue { i32, i32, i32, i32 } %14, 3
store i32 %15, i32* %6
store i32 %16, i32* %8
store i32 %17, i32* %10
store i32 %18, i32* %12
ret void
}

LLVM IR (-O2):
define void @CPUID(i32 %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 1
%4 = getelementptr inbounds i32, i32* %1, i64 2
%5 = getelementptr inbounds i32, i32* %1, i64 3
%6 = tail call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%7 = extractvalue { i32, i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32, i32 } %6, 2
%10 = extractvalue { i32, i32, i32, i32 } %6, 3
store i32 %7, i32* %1
store i32 %8, i32* %3
store i32 %9, i32* %4
store i32 %10, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assign_value(char *, int, int);
void assign_var(char *s, int value) { assign_value(s, value, 1); }


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

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

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

LLVM IR (-O2):
define void @assign_var(i8* %0, i32 %1) {
%3 = tail call i32 @assign_value(i8* %0, i32 %1, i32 1)
ret void
}
unsigned int call_walk(unsigned int descriptor, unsigned int pdescriptor,
                       char *path, unsigned int length) {
  return 0;
}


x86 assembly (clang, -O0):
<call_walk>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @call_walk(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @call_walk(i32 %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
char *malloc(int);
char *fs_fnread(FILE *file, int len) {
  char *buffer = malloc(sizeof(char) * len);
  fread(buffer, 1, len, file);
  buffer[len - 1] = '\0';
  return buffer;
}


x86 assembly (clang, -O0):
<fs_fnread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_fnread>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %r14,%rcx
call   1030 <fread@plt>
movslq %ebp,%rax
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @fs_fnread(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* %4
%7 = sext i32 %6 to i64
%8 = mul i64 1, %7
%9 = trunc i64 %8 to i32
%10 = call i8* @malloc(i32 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i32, i32* %4
%13 = load i32*, i32** %3
%14 = call i32 @fread(i8* %11, i32 1, i32 %12, i32* %13)
%15 = load i8*, i8** %5
%16 = load i32, i32* %4
%17 = sub nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %15, i64 %18
store i8 0, i8* %19
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
define noalias i8* @fs_fnread(i32* nocapture %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %1)
%4 = tail call i32 @fread(i8* %3, i32 1, i32 %1, i32* %0)
%5 = add nsw i32 %1, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
store i8 0, i8* %7
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ StubBug(char *);
void *shmat(int shmid, const void *shmaddr, int shmflg) {
  StubBug("STUB:"
          "shmat");
  return 0;
}


x86 assembly (clang, -O0):
<shmat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <StubBug@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmat>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <StubBug@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"STUB:shmat\00"
define i8* @shmat(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 @StubBug(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [11 x i8] c"STUB:shmat\00"
define noalias i8* @shmat(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @StubBug(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ newdef(char, short, float);
int main(void) {
  union {
    int i;
    char a;
    short b;
  } u;
  u.i = 33;
  char aa = 33;
  short bb = 11;
  float cc = 12;
  union {
    float c;
    double d;
  } ud;
  ud.d = 12;
  newdef(u.a, u.b, ud.c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x21,-0x8(%rbp)
movb   $0x21,-0x9(%rbp)
movw   $0xb,-0xc(%rbp)
movss  0xed7(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%cl
mov    -0x8(%rbp),%ax
movss  -0x18(%rbp),%xmm0
movsbl %cl,%edi
movswl %ax,%esi
call   1030 <newdef@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xorps  %xmm0,%xmm0
mov    $0x21,%edi
mov    $0x21,%esi
call   1030 <newdef@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%union.anon = type { i32 }
%union.anon.0 = type { double }
define i32 @main() {
%1 = alloca %union.anon
%2 = alloca i8
%3 = alloca i16
%4 = alloca float
%5 = alloca %union.anon.0
%6 = bitcast %union.anon* %1 to i32*
store i32 33, i32* %6
store i8 33, i8* %2
store i16 11, i16* %3
store float 1.200000e+01, float* %4
%7 = bitcast %union.anon.0* %5 to double*
store double 1.200000e+01, double* %7
%8 = bitcast %union.anon* %1 to i8*
%9 = load i8, i8* %8
%10 = bitcast %union.anon* %1 to i16*
%11 = load i16, i16* %10
%12 = bitcast %union.anon.0* %5 to float*
%13 = load float, float* %12
%14 = call i32 @newdef(i8 signext %9, i16 signext %11, float %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @newdef(i8 signext 33, i16 signext 33, float 0.000000e+00)
ret i32 0
}
/* Variables and functions */
int msrp_add_line(char *, char *, char *);
int msrp_add_frompath_line(char *buffer, char *frompath) {
  if (!buffer || !frompath)
    return -1;
  return msrp_add_line(buffer, "From-Path: %s", frompath);
}


x86 assembly (clang, -O0):
<msrp_add_frompath_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <msrp_add_frompath_line+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <msrp_add_frompath_line+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <msrp_add_frompath_line+0x49>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xeaf(%rip),%rsi
call   1030 <msrp_add_line@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msrp_add_frompath_line>:
test   %rdi,%rdi
je     1129 <msrp_add_frompath_line+0x19>
mov    %rsi,%rdx
test   %rsi,%rsi
je     1129 <msrp_add_frompath_line+0x19>
lea    0xedc(%rip),%rsi
jmp    1030 <msrp_add_line@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"From-Path: %s\00"
define i32 @msrp_add_frompath_line(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @msrp_add_line(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ record_linux_param_description(char *, char *, char *);
void module_param_desc_initial_ssthresh(void) {
  record_linux_param_description("tcp_cubic.c", "initial_ssthresh",
                                 "initial value of slow start threshold");
}


x86 assembly (clang, -O0):
<module_param_desc_initial_ssthresh>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeea(%rip),%rsi
lea    0xef4(%rip),%rdx
call   1030 <record_linux_param_description@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_param_desc_initial_ssthresh>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xef8(%rip),%rdx
jmp    1030 <record_linux_param_description@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"tcp_cubic.c\00"
@.str.1 = [17 x i8] c"initial_ssthresh\00"
@.str.2 = [38 x i8] c"initial value of slow start threshold\00"
define void @module_param_desc_initial_ssthresh() {
%1 = call i32 @record_linux_param_description(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"tcp_cubic.c\00"
@.str.1 = [17 x i8] c"initial_ssthresh\00"
@.str.2 = [38 x i8] c"initial value of slow start threshold\00"
define void @module_param_desc_initial_ssthresh() {
%1 = tail call i32 @record_linux_param_description(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clrtoeol();
int /*<<< orphan*/ move(int /*<<< orphan*/, int /*<<< orphan*/);
void clearNotifyLine() {
  move(0, 0);
  clrtoeol();
}


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

x86 assembly (clang, -O2):
<clearNotifyLine>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1040 <move@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <clrtoeol@plt>

LLVM IR (-O0):
define void @clearNotifyLine() {
%1 = call i32 @move(i32 0, i32 0)
%2 = call i32 (...) @clrtoeol()
ret void
}

LLVM IR (-O2):
define void @clearNotifyLine() {
%1 = tail call i32 @move(i32 0, i32 0)
%2 = tail call i32 (...) @clrtoeol()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strerror(int);
int /*<<< orphan*/ warn(char *, char *, int /*<<< orphan*/);
void pwarn(char *function, int err) {
  if (err != 0)
    warn("Couldn't %s: %s\n", function, strerror(err));
}


x86 assembly (clang, -O0):
<pwarn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     115b <pwarn+0x3b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xeaa(%rip),%rdi
call   1030 <warn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwarn>:
test   %esi,%esi
je     1141 <pwarn+0x21>
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <strerror@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <warn@plt>
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Couldn't %s: %s\0A\00"
define void @pwarn(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @strerror(i32 %9)
%11 = call i32 @warn(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %10)
br label %12
12: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Couldn't %s: %s\0A\00"
define void @pwarn(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @strerror(i32 %1)
%6 = tail call i32 @warn(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %5)
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  void test(int *int_pointer);
  int i = 50, *p = &i;
  printf("Before the call to test i = %i\n", i);
  test(p);
  printf("After the call to test i = %i\n", i);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x32,0x4(%rsp)
lea    0xed0(%rip),%rdi
mov    $0x32,%esi
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
call   1040 <test@plt>
mov    0x4(%rsp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Before the call to test i = %i\0A\00"
@.str.1 = [31 x i8] c"After the call to test i = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 50, i32* %2
store i32* %2, i32** %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32*, i32** %3
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Before the call to test i = %i\0A\00"
@.str.1 = [31 x i8] c"After the call to test i = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 50, i32* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 50)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
char *julian_to_yyyy_mm_dd(double);
char *julian_to_yyyymmdd(double julian) { return julian_to_yyyy_mm_dd(julian); }


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

x86 assembly (clang, -O2):
<julian_to_yyyymmdd>:
jmp    1030 <julian_to_yyyy_mm_dd@plt>

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

LLVM IR (-O2):
define i8* @julian_to_yyyymmdd(double %0) {
%2 = tail call i8* @julian_to_yyyy_mm_dd(double %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help(void) {
  fprintf(stderr, "Usage: i2cdump [-f] [-y] [-r first-last] I2CBUS ADDRESS "
                  "[MODE [BANK [BANKREG]]]\n"
                  "  I2CBUS is an integer or an I2C bus name\n"
                  "  ADDRESS is an integer (0x03 - 0x77)\n"
                  "  MODE is one of:\n"
                  "    b (byte, default)\n"
                  "    w (word)\n"
                  "    W (word on even register addresses)\n"
                  "    s (SMBus block)\n"
                  "    i (I2C block)\n"
                  "    c (consecutive byte)\n"
                  "    Append p for SMBus PEC\n");
}


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

x86 assembly (clang, -O2):
<help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [344 x i8] c"Usage: i2cdump [-f] [-y] [-r first-last] I2CBUS ADDRESS [MODE [BANK [BANKREG]]]\0A I2CBUS is an integer or an I2C bus name\0A ADDRESS is an integer (0x03 - 0x77)\0A MODE is one of:\0A b (byte, default)\0A w (word)\0A W (word on even register addresses)\0A s (SMBus block)\0A i (I2C block)\0A c (consecutive byte)\0A Append p for SMBus PEC\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([344 x i8], [344 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [344 x i8] c"Usage: i2cdump [-f] [-y] [-r first-last] I2CBUS ADDRESS [MODE [BANK [BANKREG]]]\0A I2CBUS is an integer or an I2C bus name\0A ADDRESS is an integer (0x03 - 0x77)\0A MODE is one of:\0A b (byte, default)\0A w (word)\0A W (word on even register addresses)\0A s (SMBus block)\0A i (I2C block)\0A c (consecutive byte)\0A Append p for SMBus PEC\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([344 x i8], [344 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char const *, struct stat *);
int vh_file_exists(const char *file) {
  struct stat st;
  return !stat(file, &st);
}


x86 assembly (clang, -O0):
<vh_file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @vh_file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @vh_file_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int fn3(int a, int b) {
  int tem1 = a | b;
  int tem2 = b ^ a;
  return tem1 ^ tem2;
}


x86 assembly (clang, -O0):
<fn3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn3>:
mov    %edi,%eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @fn3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = or i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = xor i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = xor i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn3(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dmg_reset() { printf("Not implemented yet\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"Not implemented yet\00"
define void @dmg_reset() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *);
int main(int argc, const char *argv[]) {
  int i;
  for (i = 0; i < argc; i++) {
    printf("arg %d :  %s\n", i, argv[i]);
  }
  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)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c"arg %d : %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* %6
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"arg %d : %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
void onDayChanged() {}


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

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

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

LLVM IR (-O2):
define void @onDayChanged() {
ret void
}
/* Variables and functions */
int G_CharacterIndex(char *);
scalar_t__ strlen(char *);
void G_BotParseCharacterParms(char *characterFile, int *characterInt) {
  if (strlen(characterFile)) {
    int characterIndex = G_CharacterIndex(characterFile);
    if (characterIndex) {
      *characterInt = characterIndex;
    } else {
      *characterInt = -1;
    }
  } else {
    *characterInt = -1;
  }
}


x86 assembly (clang, -O0):
<G_BotParseCharacterParms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
je     1176 <G_BotParseCharacterParms+0x56>
mov    -0x8(%rbp),%rdi
call   1040 <G_CharacterIndex@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1167 <G_BotParseCharacterParms+0x47>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1171 <G_BotParseCharacterParms+0x51>
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
jmp    1180 <G_BotParseCharacterParms+0x60>
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G_BotParseCharacterParms>:
push   %rbx
mov    %rsi,%rbx
cmpb   $0x0,(%rdi)
je     1127 <G_BotParseCharacterParms+0x17>
call   1030 <G_CharacterIndex@plt>
cmp    $0x1,%eax
sbb    %ecx,%ecx
or     %eax,%ecx
jmp    112c <G_BotParseCharacterParms+0x1c>
mov    $0xffffffff,%ecx
mov    %ecx,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @G_BotParseCharacterParms(i8* %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @G_CharacterIndex(i8* %0)
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 -1, i32 %6
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ %8, %5 ], [ -1, %2 ]
store i32 %10, i32* %1
ret void
}
int f13(int x, int y) {
  if (y >= -1)
    return x % -y;
  return 34;
}


x86 assembly (clang, -O0):
<f13>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jl     1127 <f13+0x27>
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    112e <f13+0x2e>
movl   $0x22,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f13>:
mov    $0x22,%eax
cmp    $0xffffffff,%esi
jl     1113 <f13+0x13>
neg    %esi
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @f13(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, -2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = sub nsw i32 0, %1
%6 = srem i32 %0, %5
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ 34, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int freeTTyStat(void *sg) {
  if (sg) {
    free(sg);
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<freeTTyStat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113c <freeTTyStat+0x2c>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    1143 <freeTTyStat+0x33>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeTTyStat>:
test   %rdi,%rdi
je     1122 <freeTTyStat+0x12>
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @freeTTyStat(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 0, %3 ], [ -1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ tokenRelease();
void sigQuit(int signum) {
  printf("SIGQUIT, quitting...\n");
  tokenRelease();
  exit(0);
}


x86 assembly (clang, -O0):
<sigQuit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <tokenRelease@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sigQuit>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <tokenRelease@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"SIGQUIT, quitting...\0A\00"
define void @sigQuit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @tokenRelease()
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"SIGQUIT, quitting...\00"
define void @sigQuit(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @tokenRelease()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct prog_desc {
  int dummy;
};
typedef int pid_t;

/* Variables and functions */
int fork();
int /*<<< orphan*/ start_child(struct prog_desc const *);
int prog_start(const struct prog_desc *prog, pid_t *child_pid) {
  pid_t pid = fork();
  if (pid == -1)
    return 1;
  if (pid == 0)
    start_child(prog);
  *child_pid = pid;
  return 0;
}


x86 assembly (clang, -O0):
<prog_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    1150 <prog_start+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1173 <prog_start+0x53>
cmpl   $0x0,-0x1c(%rbp)
jne    1163 <prog_start+0x43>
mov    -0x10(%rbp),%rdi
call   1030 <start_child@plt>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prog_start>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <fork@plt>
cmp    $0xffffffff,%eax
je     114a <prog_start+0x2a>
mov    %eax,%ebp
test   %eax,%eax
jne    1144 <prog_start+0x24>
mov    %r14,%rdi
call   1030 <start_child@plt>
mov    %ebp,(%rbx)
xor    %eax,%eax
jmp    114f <prog_start+0x2f>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.prog_desc = type { i32 }
define i32 @prog_start(%struct.prog_desc* %0, i32* %1) {
%3 = alloca i32
%4 = alloca %struct.prog_desc*
%5 = alloca i32*
%6 = alloca i32
store %struct.prog_desc* %0, %struct.prog_desc** %4
store i32* %1, i32** %5
%7 = call i32 (...) @fork()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %20
11: ; preds = %2
%12 = load i32, i32* %6
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load %struct.prog_desc*, %struct.prog_desc** %4
%16 = call i32 @start_child(%struct.prog_desc* %15)
br label %17
17: ; preds = %14, %11
%18 = load i32, i32* %6
%19 = load i32*, i32** %5
store i32 %18, i32* %19
store i32 0, i32* %3
br label %20
20: ; preds = %17, %10
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
%struct.prog_desc = type { i32 }
define i32 @prog_start(%struct.prog_desc* %0, i32* nocapture writeonly %1) {
%3 = tail call i32 (...) @fork()
switch i32 %3, label %6 [
i32 -1, label %7
i32 0, label %4
]
4: ; preds = %2
%5 = tail call i32 @start_child(%struct.prog_desc* %0)
br label %6
6: ; preds = %2, %4
store i32 %3, i32* %1
br label %7
7: ; preds = %2, %6
%8 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %8
}
void dcmInit(int *matrix) {
  int i;
  for (i = 0; i < 9; i++) {
    matrix[i] = 0;
  }
  matrix[0] = 62;
  matrix[4] = 62;
  matrix[8] = 62;
}


x86 assembly (clang, -O0):
<dcmInit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    1136 <dcmInit+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <dcmInit+0xf>
mov    -0x8(%rbp),%rax
movl   $0x3e,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x3e,0x10(%rax)
mov    -0x8(%rbp),%rax
movl   $0x3e,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcmInit>:
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rdi)
movups %xmm0,0x4(%rdi)
movl   $0x3e,(%rdi)
movl   $0x3e,0x10(%rdi)
movl   $0x3e,0x20(%rdi)
ret

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

LLVM IR (-O2):
define void @dcmInit(i32* nocapture writeonly %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = bitcast i32* %2 to i8*
store i32 62, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 4
store i32 62, i32* %4
%5 = getelementptr inbounds i32, i32* %0, i64 8
store i32 62, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ B();
int A() { B(); }


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

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

LLVM IR (-O0):
define i32 @A() {
%1 = alloca i32
%2 = call i32 (...) @B()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @A() {
%1 = tail call i32 (...) @B()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ request_motor_speed(int /*<<< orphan*/, int /*<<< orphan*/);
void all_stop() { request_motor_speed(0, 0); }


x86 assembly (clang, -O0):
<all_stop>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <request_motor_speed@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_stop>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <request_motor_speed@plt>

LLVM IR (-O0):
define void @all_stop() {
%1 = call i32 @request_motor_speed(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @all_stop() {
%1 = tail call i32 @request_motor_speed(i32 0, i32 0)
ret void
}