xunge/DecIR huggingface dataset:
const char *GetDefaultLDrawSearch(void) {
  return "<MODELDIR>"
         "|<HIDE><DEFPRIM><LDRAWDIR>\\P"
         "|<DEFPART><LDRAWDIR>\\PARTS"
         "|<LDRAWDIR>\\MODELS"
         "|<UNOFFIC><HIDE><DEFPRIM><LDRAWDIR>\\Unofficial\\P"
         "|<UNOFFIC><DEFPART><LDRAWDIR>\\Unofficial\\PARTS";
}


x86 assembly (clang, -O0):
<GetDefaultLDrawSearch>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetDefaultLDrawSearch>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [177 x i8] c"<MODELDIR>|<HIDE><DEFPRIM><LDRAWDIR>\\P|<DEFPART><LDRAWDIR>\\PARTS|<LDRAWDIR>\\MODELS|<UNOFFIC><HIDE><DEFPRIM><LDRAWDIR>\\Unofficial\\P|<UNOFFIC><DEFPART><LDRAWDIR>\\Unofficial\\PARTS\00"
define i8* @GetDefaultLDrawSearch() {
ret i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [177 x i8] c"<MODELDIR>|<HIDE><DEFPRIM><LDRAWDIR>\\P|<DEFPART><LDRAWDIR>\\PARTS|<LDRAWDIR>\\MODELS|<UNOFFIC><HIDE><DEFPRIM><LDRAWDIR>\\Unofficial\\P|<UNOFFIC><DEFPART><LDRAWDIR>\\Unofficial\\PARTS\00"
define i8* @GetDefaultLDrawSearch() {
ret i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str, i64 0, i64 0)
}
void format_skeleton_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @format_skeleton_exit() {
ret void
}
void WatchdogStallDisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000418))) &= ~(0x00000100);
}


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

x86 assembly (clang, -O2):
<WatchdogStallDisable>:
andq   $0xfffffffffffffeff,0x418(%rdi)
ff fe ff ff
ret

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

LLVM IR (-O2):
define void @WatchdogStallDisable(i64 %0) {
%2 = add i64 %0, 1048
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -257
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
int add(int, int);
int main() {
  int sum = add(23, 42);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x17,%edi
mov    $0x2a,%esi
call   1030 <add@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @add(i32 23, i32 42)
store i32 %3, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @add(i32 23, i32 42)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
void GEN_srand(unsigned int seed) { srand(seed); }


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

x86 assembly (clang, -O2):
<GEN_srand>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @GEN_srand(i32 %0) {
%2 = tail call i32 @srand(i32 %0)
ret void
}
/* Type definitions */
struct base {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ base_destructor(struct base *);
int /*<<< orphan*/ free(struct base *);
void base_delete(struct base *obj) {
  base_destructor(obj);
  free(obj);
}


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

x86 assembly (clang, -O2):
<base_delete>:
push   %rbx
mov    %rdi,%rbx
call   1040 <base_destructor@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.base = type { i32 }
define void @base_delete(%struct.base* %0) {
%2 = alloca %struct.base*
store %struct.base* %0, %struct.base** %2
%3 = load %struct.base*, %struct.base** %2
%4 = call i32 @base_destructor(%struct.base* %3)
%5 = load %struct.base*, %struct.base** %2
%6 = call i32 @free(%struct.base* %5)
ret void
}

LLVM IR (-O2):
%struct.base = type { i32 }
define void @base_delete(%struct.base* %0) {
%2 = tail call i32 @base_destructor(%struct.base* %0)
%3 = tail call i32 @free(%struct.base* %0)
ret void
}
/* Variables and functions */
int check2dsurface(int *, double *, int *, int *, int, int /*<<< orphan*/,
                   int /*<<< orphan*/);
int check_surface_topology_(int *pnV, double *vertex, int *pnF, int *face) {
  return check2dsurface(pnV, vertex, pnF, face, 1, 0, 0);
}


x86 assembly (clang, -O0):
<check_surface_topology_>:
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    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1,%r8d
xor    %r9d,%r9d
movl   $0x0,(%rsp)
call   1030 <check2dsurface@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_surface_topology_>:
push   %rax
movl   $0x0,(%rsp)
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1030 <check2dsurface@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @check_surface_topology_(i32* %0, double* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca double*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store double* %1, double** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load double*, double** %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = call i32 @check2dsurface(i32* %9, double* %10, i32* %11, i32* %12, i32 1, i32 0, i32 0)
ret i32 %13
}

LLVM IR (-O2):
define i32 @check_surface_topology_(i32* %0, double* %1, i32* %2, i32* %3) {
%5 = tail call i32 @check2dsurface(i32* %0, double* %1, i32* %2, i32* %3, i32 1, i32 0, i32 0)
ret i32 %5
}
/* Type definitions */
struct group {
  int dummy;
};
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int getgr_r(int /*<<< orphan*/, int /*<<< orphan*/, struct group *, char *,
            size_t, struct group **);
int getgrgid_r(gid_t gid, struct group *gr, char *buf, size_t size,
               struct group **res) {
  return getgr_r(0, gid, gr, buf, size, res);
}


x86 assembly (clang, -O0):
<getgrgid_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
xor    %edi,%edi
call   1030 <getgr_r@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getgrgid_r>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <getgr_r@plt>

LLVM IR (-O0):
%struct.group = type { i32 }
define i32 @getgrgid_r(i32 %0, %struct.group* %1, i8* %2, i64 %3, %struct.group** %4) {
%6 = alloca i32
%7 = alloca %struct.group*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca %struct.group**
store i32 %0, i32* %6
store %struct.group* %1, %struct.group** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store %struct.group** %4, %struct.group*** %10
%11 = load i32, i32* %6
%12 = load %struct.group*, %struct.group** %7
%13 = load i8*, i8** %8
%14 = load i64, i64* %9
%15 = load %struct.group**, %struct.group*** %10
%16 = call i32 @getgr_r(i32 0, i32 %11, %struct.group* %12, i8* %13, i64 %14, %struct.group** %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.group = type { i32 }
define i32 @getgrgid_r(i32 %0, %struct.group* %1, i8* %2, i64 %3, %struct.group** %4) {
%6 = tail call i32 @getgr_r(i32 0, i32 %0, %struct.group* %1, i8* %2, i64 %3, %struct.group** %4)
ret i32 %6
}
unsigned clinsert_count(struct clinsert **inserts) {
  int count;
  for (count = 0; inserts[count] && count < 64; count++)
    ;
  return count;
}


x86 assembly (clang, -O0):
<clinsert_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
xor    %eax,%eax
cmpq   $0x0,(%rcx,%rdx,8)
mov    %al,-0xd(%rbp)
je     1131 <clinsert_count+0x31>
cmpl   $0x40,-0xc(%rbp)
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1141 <clinsert_count+0x41>
jmp    1154 <clinsert_count+0x54>
jmp    1146 <clinsert_count+0x46>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <clinsert_count+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clinsert_count>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpq   $0x0,(%rdi,%rcx,8)
je     1124 <clinsert_count+0x24>
cmp    $0x40,%rcx
mov    %rax,%rcx
jb     1110 <clinsert_count+0x10>
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.clinsert = type opaque
define i32 @clinsert_count(%struct.clinsert** %0) {
%2 = alloca %struct.clinsert**
%3 = alloca i32
store %struct.clinsert** %0, %struct.clinsert*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %17, %1
%5 = load %struct.clinsert**, %struct.clinsert*** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.clinsert*, %struct.clinsert** %5, i64 %7
%9 = load %struct.clinsert*, %struct.clinsert** %8
%10 = icmp ne %struct.clinsert* %9, null
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 64
br label %14
14: ; preds = %11, %4
%15 = phi i1 [ false, %4 ], [ %13, %11 ]
br i1 %15, label %16, label %20
16: ; preds = %14
br label %17
17: ; preds = %16
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %4
20: ; preds = %14
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
%struct.clinsert = type opaque
define i32 @clinsert_count(%struct.clinsert** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %9, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds %struct.clinsert*, %struct.clinsert** %0, i64 %3
%5 = load %struct.clinsert*, %struct.clinsert** %4
%6 = icmp ne %struct.clinsert* %5, null
%7 = icmp ult i64 %3, 64
%8 = select i1 %6, i1 %7, i1 false
%9 = add nuw nsw i64 %3, 1
br i1 %8, label %2, label %10
10: ; preds = %2
%11 = trunc i64 %3 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ f(void *, int);
int main(void) {
  f((void *)0xdeadbeef, 0x12345678);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xdeadbeef,%edi
mov    $0x12345678,%esi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i8* inttoptr (i64 3735928559 to i8*), i32 305419896)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i8* inttoptr (i64 3735928559 to i8*), i32 305419896)
ret i32 0
}
void ASN1_IA5STRING_new(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_IA5STRING_new() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
char str_not_equal(const char *s1, const char *s2) {
  if (s1) {
    if (!s2)
      return 1;
    if (strcmp(s1, s2) != 0)
      return 1;
    else
      return 0;
  } else if (s2)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<str_not_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1168 <str_not_equal+0x58>
cmpq   $0x0,-0x18(%rbp)
jne    113f <str_not_equal+0x2f>
movb   $0x1,-0x1(%rbp)
jmp    1180 <str_not_equal+0x70>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     115f <str_not_equal+0x4f>
movb   $0x1,-0x1(%rbp)
jmp    1180 <str_not_equal+0x70>
movb   $0x0,-0x1(%rbp)
jmp    1180 <str_not_equal+0x70>
cmpq   $0x0,-0x18(%rbp)
je     117c <str_not_equal+0x6c>
movb   $0x1,-0x1(%rbp)
jmp    1180 <str_not_equal+0x70>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_not_equal>:
test   %rdi,%rdi
je     112b <str_not_equal+0x1b>
test   %rsi,%rsi
je     1132 <str_not_equal+0x22>
push   %rax
call   1030 <strcmp@plt>
test   %rax,%rax
setne  %al
add    $0x8,%rsp
ret
test   %rsi,%rsi
setne  %al
ret
mov    $0x1,%al
ret

LLVM IR (-O0):
define signext i8 @str_not_equal(i8* %0, i8* %1) {
%3 = alloca i8
%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 %19
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %8
store i8 1, i8* %3
br label %24
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = call i64 @strcmp(i8* %13, i8* %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12
store i8 1, i8* %3
br label %24
18: ; preds = %12
store i8 0, i8* %3
br label %24
19: ; preds = %2
%20 = load i8*, i8** %5
%21 = icmp ne i8* %20, null
br i1 %21, label %22, label %23
22: ; preds = %19
store i8 1, i8* %3
br label %24
23: ; preds = %19
store i8 0, i8* %3
br label %24
24: ; preds = %23, %22, %18, %17, %11
%25 = load i8, i8* %3
ret i8 %25
}

LLVM IR (-O2):
define signext i8 @str_not_equal(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = icmp eq i8* %1, null
br i1 %5, label %11, label %6
6: ; preds = %4
%7 = tail call i64 @strcmp(i8* %0, i8* %1)
%8 = icmp ne i64 %7, 0
br label %11
9: ; preds = %2
%10 = icmp ne i8* %1, null
br label %11
11: ; preds = %9, %6, %4
%12 = phi i1 [ true, %4 ], [ %8, %6 ], [ %10, %9 ]
%13 = zext i1 %12 to i8
ret i8 %13
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
struct list *alloc_list();
struct list *init_list_by_default(struct list *);
struct list *new_list_by_default(void) {
  struct list *list;
  list = alloc_list();
  if (NULL != list)
    list = init_list_by_default(list);
  return (list);
}


x86 assembly (clang, -O0):
<new_list_by_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <alloc_list@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     114c <new_list_by_default+0x2c>
mov    -0x8(%rbp),%rdi
call   1030 <init_list_by_default@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_list_by_default>:
push   %rax
xor    %eax,%eax
call   1040 <alloc_list@plt>
test   %rax,%rax
je     1136 <new_list_by_default+0x16>
mov    %rax,%rdi
pop    %rax
jmp    1030 <init_list_by_default@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.list = type { i32 }
define %struct.list* @new_list_by_default() {
%1 = alloca %struct.list*
%2 = call %struct.list* (...) @alloc_list()
store %struct.list* %2, %struct.list** %1
%3 = load %struct.list*, %struct.list** %1
%4 = icmp ne %struct.list* null, %3
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load %struct.list*, %struct.list** %1
%7 = call %struct.list* @init_list_by_default(%struct.list* %6)
store %struct.list* %7, %struct.list** %1
br label %8
8: ; preds = %5, %0
%9 = load %struct.list*, %struct.list** %1
ret %struct.list* %9
}

LLVM IR (-O2):
%struct.list = type { i32 }
define %struct.list* @new_list_by_default() {
%1 = tail call %struct.list* (...) @alloc_list()
%2 = icmp eq %struct.list* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call %struct.list* @init_list_by_default(%struct.list* %1)
br label %5
5: ; preds = %3, %0
%6 = phi %struct.list* [ %4, %3 ], [ null, %0 ]
ret %struct.list* %6
}
/* Variables and functions */
scalar_t__ dt_leap_year(int);
int dt_days_in_year(int y) { return dt_leap_year(y) ? 366 : 365; }


x86 assembly (clang, -O0):
<dt_days_in_year>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <dt_leap_year@plt>
mov    %rax,%rdx
mov    $0x16d,%eax
mov    $0x16e,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt_days_in_year>:
push   %rax
call   1030 <dt_leap_year@plt>
cmp    $0x1,%rax
mov    $0x16e,%eax
sbb    $0x0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dt_days_in_year(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @dt_leap_year(i32 %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 366, i32 365
ret i32 %7
}

LLVM IR (-O2):
define i32 @dt_days_in_year(i32 %0) {
%2 = tail call i64 @dt_leap_year(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 365, i32 366
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ outb_local(unsigned char, int);
void(outb)(unsigned char value, int port) {
  {
    outb_local(value, port);
    return;
  }
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
movzbl %al,%edi
call   1030 <outb_local@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
jmp    1030 <outb_local@plt>

LLVM IR (-O0):
define void @outb(i8 zeroext %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 @outb_local(i8 zeroext %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @outb(i8 zeroext %0, i32 %1) {
%3 = tail call i32 @outb_local(i8 zeroext %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inform_user(char *);
void print_usage(void) {
  inform_user("Usage: aggregator [options]\n"
              "  Options:\n"
              "  -n <num>    Number of clients/servers to aggregate\n"
              "  -p <port>   Port number to listen to\n"
              "  -m <num>    Number of measurements to receive (Default: 60)\n"
              "  -h          Display this text\n\n"
              "For bug reporting and suggestions, mail peter@torpman.se\n");
}


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

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

LLVM IR (-O0):
@.str = [284 x i8] c"Usage: aggregator [options]\0A Options:\0A -n <num> Number of clients/servers to aggregate\0A -p <port> Port number to listen to\0A -m <num> Number of measurements to receive (Default: 60)\0A -h Display this text\0A\0AFor bug reporting and suggestions, mail peter@torpman.se\0A\00"
define void @print_usage() {
%1 = call i32 @inform_user(i8* getelementptr inbounds ([284 x i8], [284 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [284 x i8] c"Usage: aggregator [options]\0A Options:\0A -n <num> Number of clients/servers to aggregate\0A -p <port> Port number to listen to\0A -m <num> Number of measurements to receive (Default: 60)\0A -h Display this text\0A\0AFor bug reporting and suggestions, mail peter@torpman.se\0A\00"
define void @print_usage() {
%1 = tail call i32 @inform_user(i8* getelementptr inbounds ([284 x i8], [284 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int file_exists(const char *filename) {
  struct stat st;
  return (stat(filename, &st) == 0);
}


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

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

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int argis(const char *arg, const char *is) {
  while (1) {
    if (*arg == '\0')
      return 1;
    if (*is == '\0')
      return 0;
    if (*arg != *is)
      return 0;
    arg++;
    is++;
  }
}


x86 assembly (clang, -O0):
<argis>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1128 <argis+0x28>
movl   $0x1,-0x4(%rbp)
jmp    1183 <argis+0x83>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1144 <argis+0x44>
movl   $0x0,-0x4(%rbp)
jmp    1183 <argis+0x83>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1166 <argis+0x66>
movl   $0x0,-0x4(%rbp)
jmp    1183 <argis+0x83>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <argis+0xc>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<argis>:
mov    (%rdi),%r8b
mov    $0x1,%eax
test   %r8b,%r8b
je     112c <argis+0x2c>
xor    %edx,%edx
nop
movzbl (%rsi,%rdx,1),%ecx
test   %cl,%cl
je     112d <argis+0x2d>
cmp    %cl,%r8b
jne    112d <argis+0x2d>
movzbl 0x1(%rdi,%rdx,1),%r8d
add    $0x1,%rdx
test   %r8b,%r8b
jne    1110 <argis+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @argis(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2, %13
%6 = phi i8 [ %16, %13 ], [ %3, %2 ]
%7 = phi i8* [ %15, %13 ], [ %1, %2 ]
%8 = phi i8* [ %14, %13 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp ne i8 %9, 0
%11 = icmp eq i8 %6, %9
%12 = select i1 %10, i1 %11, i1 false
br i1 %12, label %13, label %18
13: ; preds = %5
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = getelementptr inbounds i8, i8* %7, i64 1
%16 = load i8, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %5
18: ; preds = %13, %5, %2
%19 = phi i32 [ 1, %2 ], [ 0, %5 ], [ 1, %13 ]
ret i32 %19
}
int test11(unsigned n) {
  int x;
  for (unsigned i = 0; i <= n; ++i) {
    x = 1;
  }
  return x;
}


x86 assembly (clang, -O0):
<test11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
ja     112f <test11+0x2f>
movl   $0x1,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <test11+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test11(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ send_sms(char *, char *);
int main() {
  send_sms("0128994212", "This is a test SMS. Apparently, it works.");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"0128994212\00"
@.str.1 = [42 x i8] c"This is a test SMS. Apparently, it works.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @send_sms(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"0128994212\00"
@.str.1 = [42 x i8] c"This is a test SMS. Apparently, it works.\00"
define i32 @main() {
%1 = tail call i32 @send_sms(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ err(int, int);
void fail(void) { err(5, 1); }


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0x1,%esi
call   1030 <err@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fail>:
mov    $0x5,%edi
mov    $0x1,%esi
jmp    1030 <err@plt>

LLVM IR (-O0):
define void @fail() {
%1 = call i32 @err(i32 5, i32 1)
ret void
}

LLVM IR (-O2):
define void @fail() {
%1 = tail call i32 @err(i32 5, i32 1)
ret void
}
/* Variables and functions */
char *getenv(char *);
const char *tmpdir(void) {
  char *p;
  if ((p = getenv("TMPDIR")))
    return p;
  return "/tmp";
}


x86 assembly (clang, -O0):
<tmpdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     113f <tmpdir+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114a <tmpdir+0x3a>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmpdir>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xee0(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"TMPDIR\00"
@.str.1 = [5 x i8] c"/tmp\00"
define i8* @tmpdir() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ update_card_list();
void refresh_shares(void) { update_card_list(); }


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

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

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

LLVM IR (-O2):
define void @refresh_shares() {
%1 = tail call i32 (...) @update_card_list()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int *twoSum(int *, int, int);
int main() {
  int test[5] = {1, 2, 3, 4, 5};
  int *ans = twoSum(test, 5, 3);
  printf("ans:[%d, %d]", ans[0], ans[1]);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
mov    $0x3,%edx
call   1040 <twoSum@plt>
mov    (%rax),%esi
mov    0x4(%rax),%edx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.test = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [13 x i8] c"ans:[%d, %d]\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32* @twoSum(i32* %3, i32 5, i32 3)
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
char *prog_name(char *s) {
  char *p = s + strlen(s);
  while (p >= s && *p != '/')
    p--;
  return (p + 1);
}


x86 assembly (clang, -O0):
<prog_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    -0x8(%rbp),%rcx
mov    %al,-0x19(%rbp)
jb     1160 <prog_name+0x50>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1170 <prog_name+0x60>
jmp    1181 <prog_name+0x71>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    113d <prog_name+0x2d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prog_name>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rcx
lea    (%rbx,%rcx,1),%rax
test   %ecx,%ecx
js     113e <prog_name+0x2e>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x2f,(%rax)
je     113e <prog_name+0x2e>
add    $0xffffffffffffffff,%rax
cmp    %rbx,%rax
jae    1130 <prog_name+0x20>
add    $0x1,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @prog_name(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = icmp slt i32 %2, 0
br i1 %5, label %13, label %6
6: ; preds = %1, %10
%7 = phi i8* [ %11, %10 ], [ %4, %1 ]
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 47
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = getelementptr inbounds i8, i8* %7, i64 -1
%12 = icmp ult i8* %11, %0
br i1 %12, label %13, label %6
13: ; preds = %6, %10, %1
%14 = phi i8* [ %4, %1 ], [ %11, %10 ], [ %7, %6 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
ret i8* %15
}
int put(struct hash_table ***table) {}


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

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

LLVM IR (-O0):
%struct.hash_table = type opaque
define i32 @put(%struct.hash_table*** %0) {
%2 = alloca i32
%3 = alloca %struct.hash_table***
store %struct.hash_table*** %0, %struct.hash_table**** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.hash_table = type opaque
define i32 @put(%struct.hash_table*** nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void quit(int err) { exit(err); }


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

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

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

LLVM IR (-O2):
define void @quit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
void swap_ints(int *a, int *b) {
  int t = *a;
  *a = *b;
  *b = t;
}


x86 assembly (clang, -O0):
<swap_ints>:
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_ints>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @swap_ints(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_ints(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
}
/* Variables and functions */
int /*<<< orphan*/ extra();
int main(int argc, char **argv) {
  extra();
  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)
mov    $0x0,%al
call   1030 <extra@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @extra()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @extra()
ret i32 0
}
/* Variables and functions */
char *__xmalloc_(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *newstring(char *str) {
  char *tmp = __xmalloc_(strlen(str) + 1);
  strcpy(tmp, str);
  return tmp;
}


x86 assembly (clang, -O0):
<newstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <__xmalloc_@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newstring>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <__xmalloc_@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @newstring(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @__xmalloc_(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @newstring(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @__xmalloc_(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
void *vui_malloc(size_t size) {
  void *ptr = malloc(size);
  if (ptr == NULL) {
    abort();
  }
  return ptr;
}


x86 assembly (clang, -O0):
<vui_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <vui_malloc+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vui_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     112d <vui_malloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define noalias i8* @vui_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int initialize_dobldobl_sampler(int dim) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(632, &dim, b, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<initialize_dobldobl_sampler>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x278,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @initialize_dobldobl_sampler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 632, i32* %2, i32* undef, double* undef)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ si46xx_fm_tune_freq(int, int /*<<< orphan*/);
int /*<<< orphan*/ si46xx_init_fm();
int /*<<< orphan*/ si46xx_set_property(int, int);
void init_fm(void) {
  si46xx_init_fm();
  si46xx_set_property(0x0800, 0x0003);
  si46xx_set_property(0x3500, 0x0000);
  si46xx_set_property(0x1712, 0x0000);
  si46xx_set_property(0x0202, 0x1000);
  si46xx_set_property(0x3C02, 0x0001);
  si46xx_set_property(0x3900, 0x01);
  si46xx_fm_tune_freq(105500, 0);
}


x86 assembly (clang, -O0):
<init_fm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <si46xx_init_fm@plt>
mov    $0x800,%edi
mov    $0x3,%esi
call   1030 <si46xx_set_property@plt>
mov    $0x3500,%edi
xor    %esi,%esi
call   1030 <si46xx_set_property@plt>
mov    $0x1712,%edi
xor    %esi,%esi
call   1030 <si46xx_set_property@plt>
mov    $0x202,%edi
mov    $0x1000,%esi
call   1030 <si46xx_set_property@plt>
mov    $0x3c02,%edi
mov    $0x1,%esi
call   1030 <si46xx_set_property@plt>
mov    $0x3900,%edi
mov    $0x1,%esi
call   1030 <si46xx_set_property@plt>
mov    $0x19c1c,%edi
xor    %esi,%esi
call   1050 <si46xx_fm_tune_freq@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_fm>:
push   %rax
xor    %eax,%eax
call   1040 <si46xx_init_fm@plt>
mov    $0x800,%edi
mov    $0x3,%esi
call   1030 <si46xx_set_property@plt>
mov    $0x3500,%edi
xor    %esi,%esi
call   1030 <si46xx_set_property@plt>
mov    $0x1712,%edi
xor    %esi,%esi
call   1030 <si46xx_set_property@plt>
mov    $0x202,%edi
mov    $0x1000,%esi
call   1030 <si46xx_set_property@plt>
mov    $0x3c02,%edi
mov    $0x1,%esi
call   1030 <si46xx_set_property@plt>
mov    $0x3900,%edi
mov    $0x1,%esi
call   1030 <si46xx_set_property@plt>
mov    $0x19c1c,%edi
xor    %esi,%esi
pop    %rax
jmp    1050 <si46xx_fm_tune_freq@plt>

LLVM IR (-O0):
define void @init_fm() {
%1 = call i32 (...) @si46xx_init_fm()
%2 = call i32 @si46xx_set_property(i32 2048, i32 3)
%3 = call i32 @si46xx_set_property(i32 13568, i32 0)
%4 = call i32 @si46xx_set_property(i32 5906, i32 0)
%5 = call i32 @si46xx_set_property(i32 514, i32 4096)
%6 = call i32 @si46xx_set_property(i32 15362, i32 1)
%7 = call i32 @si46xx_set_property(i32 14592, i32 1)
%8 = call i32 @si46xx_fm_tune_freq(i32 105500, i32 0)
ret void
}

LLVM IR (-O2):
define void @init_fm() {
%1 = tail call i32 (...) @si46xx_init_fm()
%2 = tail call i32 @si46xx_set_property(i32 2048, i32 3)
%3 = tail call i32 @si46xx_set_property(i32 13568, i32 0)
%4 = tail call i32 @si46xx_set_property(i32 5906, i32 0)
%5 = tail call i32 @si46xx_set_property(i32 514, i32 4096)
%6 = tail call i32 @si46xx_set_property(i32 15362, i32 1)
%7 = tail call i32 @si46xx_set_property(i32 14592, i32 1)
%8 = tail call i32 @si46xx_fm_tune_freq(i32 105500, i32 0)
ret void
}
int g(long long a) { return a >> 34; }


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

x86 assembly (clang, -O2):
<g>:
mov    %rdi,%rax
sar    $0x22,%rax
ret

LLVM IR (-O0):
define i32 @g(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 34
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @g(i64 %0) {
%2 = ashr i64 %0, 34
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G29_f(char *s) {
  debug("G29_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G29_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G29_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"G29_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G29_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"G29_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G29_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ advance();
int /*<<< orphan*/ legal_lookahead(int, int, int /*<<< orphan*/);
scalar_t__ match(int);
int /*<<< orphan*/ term();
void expression() {
  if (!legal_lookahead(6, 4, 0))
    return;
  term();
  while (match(2)) {
    advance();
    term();
  }
}


x86 assembly (clang, -O0):
<expression>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <legal_lookahead@plt>
cmp    $0x0,%eax
jne    1163 <expression+0x23>
jmp    1191 <expression+0x51>
mov    $0x0,%al
call   1040 <term@plt>
mov    $0x2,%edi
call   1060 <match@plt>
cmp    $0x0,%rax
je     1191 <expression+0x51>
mov    $0x0,%al
call   1050 <advance@plt>
mov    $0x0,%al
call   1040 <term@plt>
jmp    116a <expression+0x2a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<expression>:
push   %rax
mov    $0x6,%edi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <legal_lookahead@plt>
test   %eax,%eax
je     117f <expression+0x3f>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <term@plt>
mov    $0x2,%edi
call   1060 <match@plt>
test   %rax,%rax
je     117f <expression+0x3f>
xor    %eax,%eax
call   1050 <advance@plt>
jmp    1160 <expression+0x20>
pop    %rax
ret

LLVM IR (-O0):
define void @expression() {
%1 = call i32 @legal_lookahead(i32 6, i32 4, i32 0)
%2 = icmp ne i32 %1, 0
br i1 %2, label %4, label %3
3: ; preds = %0
br label %12
4: ; preds = %0
%5 = call i32 (...) @term()
br label %6
6: ; preds = %9, %4
%7 = call i64 @match(i32 2)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = call i32 (...) @advance()
%11 = call i32 (...) @term()
br label %6
12: ; preds = %3, %6
ret void
}

LLVM IR (-O2):
define void @expression() {
%1 = tail call i32 @legal_lookahead(i32 6, i32 4, i32 0)
%2 = icmp eq i32 %1, 0
br i1 %2, label %12, label %3
3: ; preds = %0
%4 = tail call i32 (...) @term()
%5 = tail call i64 @match(i32 2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %3, %7
%8 = tail call i32 (...) @advance()
%9 = tail call i32 (...) @term()
%10 = tail call i64 @match(i32 2)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %3, %0
ret void
}