xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void AlcFree(void *data) {
  if (data) {
    free(data);
  }
}


x86 assembly (clang, -O0):
<AlcFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <AlcFree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AlcFree>:
test   %rdi,%rdi
je     111a <AlcFree+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @AlcFree(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 = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
void x_fclose(FILE *stream) {
  if (fclose(stream) != 0) {
    perror("failed to close");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<x_fclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
cmp    $0x0,%rax
je     1169 <x_fclose+0x39>
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_fclose>:
push   %rax
call   1030 <fclose@plt>
test   %rax,%rax
jne    113d <x_fclose+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"failed to close\00"
@EXIT_FAILURE = global i32 0
define void @x_fclose(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @fclose(i32* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"failed to close\00"
@EXIT_FAILURE = global i32 0
define void @x_fclose(i32* nocapture %0) {
%2 = tail call i64 @fclose(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
void ledtrig_usb_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @ledtrig_usb_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int mysum(char *, ...);
  int res;
  res = mysum("iizdzd", 2, 2, 1, 10, 5, 5);
  printf("result = %d\n", res);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x2,%edx
mov    $0x1,%ecx
mov    $0xa,%r8d
mov    $0x5,%r9d
mov    %edx,%esi
movl   $0x5,(%rsp)
mov    $0x0,%al
call   1040 <mysum@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,(%rsp)
lea    0xed1(%rip),%rdi
mov    $0x2,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
mov    $0xa,%r8d
mov    $0x5,%r9d
xor    %eax,%eax
call   1040 <mysum@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"iizdzd\00"
@.str.1 = [13 x i8] c"result = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @mysum(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 2, i32 2, i32 1, i32 10, i32 5, i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char *getenv(char *);
int /*<<< orphan*/ perror(char *);
int rmdir(char const *);
void rmdir_xdg_runtime_dir(void) {
  const char *xrd_env = getenv("XDG_RUNTIME_DIR");
  assert(xrd_env && "No XDG_RUNTIME_DIR set");
  if (rmdir(xrd_env) == -1)
    perror("Cleaning XDG_RUNTIME_DIR");
}


x86 assembly (clang, -O0):
<rmdir_xdg_runtime_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1172 <rmdir_xdg_runtime_dir+0x32>
mov    $0x1,%al
mov    %al,-0x9(%rbp)
jmp    1172 <rmdir_xdg_runtime_dir+0x32>
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <rmdir@plt>
cmp    $0xffffffff,%eax
jne    119d <rmdir_xdg_runtime_dir+0x5d>
lea    0xe7f(%rip),%rdi
call   1060 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmdir_xdg_runtime_dir>:
push   %rbx
lea    0xec1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1040 <rmdir@plt>
cmp    $0xffffffff,%eax
je     116d <rmdir_xdg_runtime_dir+0x2d>
pop    %rbx
ret
lea    0xe8c(%rip),%rdi
pop    %rbx
jmp    1060 <perror@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"XDG_RUNTIME_DIR\00"
@.str.1 = [23 x i8] c"No XDG_RUNTIME_DIR set\00"
@.str.2 = [25 x i8] c"Cleaning XDG_RUNTIME_DIR\00"
define void @rmdir_xdg_runtime_dir() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %0
br label %6
6: ; preds = %5, %0
%7 = phi i1 [ false, %0 ], [ true, %5 ]
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %1
%11 = call i32 @rmdir(i8* %10)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %6
%14 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %6
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"XDG_RUNTIME_DIR\00"
@.str.2 = [25 x i8] c"Cleaning XDG_RUNTIME_DIR\00"
define void @rmdir_xdg_runtime_dir() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i8* %1, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @rmdir(i8* %1)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
ret void
}
/* Variables and functions */
int chdir(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getcwd(char *, int);
int /*<<< orphan*/ stderr;
char *check_arbo(char *relatif) {
  int result = chdir(relatif);
  if (result == 0) {
    return getcwd(relatif, 4096);
  } else {
    fprintf(stderr, "./lsx: %s: acces impossible\n", relatif);
    exit(0);
  }
}


x86 assembly (clang, -O0):
<check_arbo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <chdir@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1176 <check_arbo+0x36>
mov    -0x8(%rbp),%rdi
mov    $0x1000,%esi
call   1040 <getcwd@plt>
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe76(%rip),%rsi
call   1050 <fprintf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<check_arbo>:
push   %rbx
mov    %rdi,%rbx
call   1030 <chdir@plt>
test   %eax,%eax
jne    115b <check_arbo+0x1b>
mov    %rbx,%rdi
mov    $0x1000,%esi
pop    %rbx
jmp    1040 <getcwd@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xe95(%rip),%rsi
mov    %rbx,%rdx
call   1050 <fprintf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"./lsx: %s: acces impossible\0A\00"
define i8* @check_arbo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @chdir(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i8* @getcwd(i8* %9, i32 4096)
ret i8* %10
11: ; preds = %1
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %2
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"./lsx: %s: acces impossible\0A\00"
define i8* @check_arbo(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @getcwd(i8* %0, i32 4096)
ret i8* %5
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 0)
unreachable
}
int qwertysh_exit(char **args) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @qwertysh_exit(i8** nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct kfifo {
  int dummy;
};

/* Variables and functions */
unsigned int __kfifo_len(struct kfifo *);
unsigned int kfifo_len(struct kfifo *fifo) {
  unsigned long flags;
  unsigned int ret;
  ret = __kfifo_len(fifo);
  return ret;
}


x86 assembly (clang, -O0):
<kfifo_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__kfifo_len@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kfifo_len>:
jmp    1030 <__kfifo_len@plt>

LLVM IR (-O0):
%struct.kfifo = type { i32 }
define i32 @kfifo_len(%struct.kfifo* %0) {
%2 = alloca %struct.kfifo*
%3 = alloca i64
%4 = alloca i32
store %struct.kfifo* %0, %struct.kfifo** %2
%5 = load %struct.kfifo*, %struct.kfifo** %2
%6 = call i32 @__kfifo_len(%struct.kfifo* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
ret i32 %7
}

LLVM IR (-O2):
%struct.kfifo = type { i32 }
define i32 @kfifo_len(%struct.kfifo* %0) {
%2 = tail call i32 @__kfifo_len(%struct.kfifo* %0)
ret i32 %2
}
/* Variables and functions */
double M_LN2;
double log(double);
double log2(double x) { return log(x) / M_LN2; }


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
mov    0x2eb2(%rip),%rax
divsd  (%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2>:
push   %rax
call   1030 <log@plt>
mov    0x2ec3(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_LN2 = global double 0.000000e+00
define double @log2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log(double %3)
%5 = load double, double* @M_LN2
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
@M_LN2 = global double 0.000000e+00
define double @log2(double %0) {
%2 = tail call double @log(double %0)
%3 = load double, double* @M_LN2
%4 = fdiv double %2, %3
ret double %4
}
void g_list_append() {}


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

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

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

LLVM IR (-O2):
define void @g_list_append() {
ret void
}
/* Type definitions */
struct feed_tty {
  int dummy;
};

/* Variables and functions */
char feed_tty_clear(struct feed_tty *const, int);
char feed_tty_clear_top(struct feed_tty *const p_tty) {
  return feed_tty_clear(p_tty, 1);
}


x86 assembly (clang, -O0):
<feed_tty_clear_top>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <feed_tty_clear@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feed_tty_clear_top>:
mov    $0x1,%esi
jmp    1030 <feed_tty_clear@plt>

LLVM IR (-O0):
%struct.feed_tty = type { i32 }
define signext i8 @feed_tty_clear_top(%struct.feed_tty* %0) {
%2 = alloca %struct.feed_tty*
store %struct.feed_tty* %0, %struct.feed_tty** %2
%3 = load %struct.feed_tty*, %struct.feed_tty** %2
%4 = call signext i8 @feed_tty_clear(%struct.feed_tty* %3, i32 1)
ret i8 %4
}

LLVM IR (-O2):
%struct.feed_tty = type { i32 }
define signext i8 @feed_tty_clear_top(%struct.feed_tty* %0) {
%2 = tail call signext i8 @feed_tty_clear(%struct.feed_tty* %0, i32 1)
ret i8 %2
}
/* Variables and functions */
scalar_t__ strstr(char const *, char *);
int chatdat_valid_username(const char *uname) {
  if (strstr(uname, " "))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<chatdat_valid_username>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1142 <chatdat_valid_username+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1149 <chatdat_valid_username+0x39>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chatdat_valid_username>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i32 @chatdat_valid_username(i8* %0) {
%2 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ nums;

/* Variables and functions */
int /*<<< orphan*/ print(int *, int);
int /*<<< orphan*/ radix_sort(int *, int);
int main() {
  int nums[] = {2, 10, 3, 14, 15, 6, 3, 9};
  int n = sizeof(nums) / sizeof(nums[0]);
  radix_sort(nums, n);
  print(nums, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <radix_sort@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <print@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@__const.main.nums = [8 x i32] [i32 2, i32 10, i32 3, i32 14, i32 15, i32 6, i32 3, i32 9]
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @radix_sort(i32* %3, i32 8)
%5 = call i32 @print(i32* %3, i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
doublereg() { ol("DAD H"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"DAD H\00"
define i32 @doublereg() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"DAD H\00"
define i32 @doublereg() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int alarg(int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, char *argv[]) {
  int x = 1;
  int y = 2;
  int z = alarg(&x, &y);
  printf("(%d#%d)%d is larger \n", x, y, z);
  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   $0x1,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <alarg@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
movl   $0x2,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <alarg@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb5(%rip),%rdi
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [22 x i8] c"(%d#%d)%d is larger \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 2, i32* %4
%7 = call i32 @alarg(i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ buff;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(char *, int, size_t, int /*<<< orphan*/ *);
void file_copy(FILE *fin, FILE *fout) {
  char buff[256];
  size_t size;
  while ((size = fread(buff, 1, sizeof(buff), fin)) > 0)
    fwrite(buff, 1, size, fout);
}


x86 assembly (clang, -O0):
<file_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x100,%edx
call   1030 <fread@plt>
mov    %rax,-0x118(%rbp)
cmp    $0x0,%rax
jbe    117f <file_copy+0x5f>
lea    -0x110(%rbp),%rdi
mov    -0x118(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
jmp    1133 <file_copy+0x13>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_copy>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsp,%rdi
mov    $0x1,%esi
mov    $0x100,%edx
mov    %r15,%rcx
call   1030 <fread@plt>
test   %rax,%rax
je     117d <file_copy+0x5d>
mov    %rsp,%rbx
nop
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %rax,%rdx
mov    %r14,%rcx
call   1040 <fwrite@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x100,%edx
mov    %r15,%rcx
call   1030 <fread@plt>
test   %rax,%rax
jne    1150 <file_copy+0x30>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @file_copy(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [256 x i8]
%6 = alloca i64
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %7
7: ; preds = %12, %2
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%9 = load i32*, i32** %3
%10 = call i64 @fread(i8* %8, i32 1, i32 256, i32* %9)
store i64 %10, i64* %6
%11 = icmp ugt i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%14 = load i64, i64* %6
%15 = load i32*, i32** %4
%16 = call i32 @fwrite(i8* %13, i32 1, i64 %14, i32* %15)
br label %7
17: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @file_copy(i32* nocapture %0, i32* nocapture %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i64 @fread(i8* %4, i32 1, i32 256, i32* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %2, %7
%8 = phi i64 [ %10, %7 ], [ %5, %2 ]
%9 = call i32 @fwrite(i8* %4, i32 1, i64 %8, i32* %1)
%10 = call i64 @fread(i8* %4, i32 1, i32 256, i32* %0)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
ret void
}
void ff_hevc_put_hevc_bi_epel_v32_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_v32_10_avx2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MD5(unsigned char const *, size_t, unsigned char *);
int MD5_DIGEST_LENGTH;
char *saslc__crypto_hash_to_hex(unsigned char *);
char *saslc__crypto_md5_hex(const char *buf, size_t buflen) {
  unsigned char digest[MD5_DIGEST_LENGTH];
  (void)MD5((const unsigned char *)buf, buflen, digest);
  return saslc__crypto_hash_to_hex(digest);
}


x86 assembly (clang, -O0):
<saslc__crypto_md5_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x28(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <MD5@plt>
mov    -0x28(%rbp),%rdi
call   1030 <saslc__crypto_hash_to_hex@plt>
mov    -0x18(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saslc__crypto_md5_hex>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdx
call   1040 <MD5@plt>
mov    %rbx,%rdi
call   1030 <saslc__crypto_hash_to_hex@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@MD5_DIGEST_LENGTH = global i32 0
define i8* @saslc__crypto_md5_hex(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i32, i32* @MD5_DIGEST_LENGTH
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i8, i64 %8
store i64 %8, i64* %6
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i32 @MD5(i8* %11, i64 %12, i8* %10)
%14 = call i8* @saslc__crypto_hash_to_hex(i8* %10)
%15 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@MD5_DIGEST_LENGTH = global i32 0
define i8* @saslc__crypto_md5_hex(i8* %0, i64 %1) {
%3 = load i32, i32* @MD5_DIGEST_LENGTH
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @MD5(i8* %0, i64 %1, i8* %5)
%7 = call i8* @saslc__crypto_hash_to_hex(i8* %5)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
main() {
  f(1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
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(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ back(int);
int input();
scalar_t__ isdigit(int);
int getnth(void) {
  int c;
  if ((c = input()) == 'g') {
    return -1;
  } else if (isdigit(c)) {
    if (c == '0')
      return -1;
    return c - '0';
  } else {
    back(c);
    return 1;
  }
}


x86 assembly (clang, -O0):
<getnth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <input@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x67,%eax
jne    1157 <getnth+0x27>
movl   $0xffffffff,-0x4(%rbp)
jmp    119c <getnth+0x6c>
mov    -0x8(%rbp),%edi
call   1050 <isdigit@plt>
cmp    $0x0,%rax
je     118d <getnth+0x5d>
cmpl   $0x30,-0x8(%rbp)
jne    117f <getnth+0x4f>
movl   $0xffffffff,-0x4(%rbp)
jmp    119c <getnth+0x6c>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    119c <getnth+0x6c>
mov    -0x8(%rbp),%edi
call   1030 <back@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnth>:
push   %rbx
xor    %eax,%eax
call   1040 <input@plt>
mov    %eax,%ebx
mov    $0xffffffff,%eax
cmp    $0x67,%ebx
je     116c <getnth+0x3c>
mov    %ebx,%edi
call   1050 <isdigit@plt>
test   %rax,%rax
je     1160 <getnth+0x30>
lea    -0x30(%rbx),%ecx
cmp    $0x30,%ebx
mov    $0xffffffff,%eax
cmovne %ecx,%eax
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <back@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getnth() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @input()
store i32 %3, i32* %2
%4 = icmp eq i32 %3, 103
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 -1, i32* %1
br label %20
6: ; preds = %0
%7 = load i32, i32* %2
%8 = call i64 @isdigit(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 48
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 -1, i32* %1
br label %20
14: ; preds = %10
%15 = load i32, i32* %2
%16 = sub nsw i32 %15, 48
store i32 %16, i32* %1
br label %20
17: ; preds = %6
%18 = load i32, i32* %2
%19 = call i32 @back(i32 %18)
store i32 1, i32* %1
br label %20
20: ; preds = %17, %14, %13, %5
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
define i32 @getnth() {
%1 = tail call i32 (...) @input()
%2 = icmp eq i32 %1, 103
br i1 %2, label %12, label %3
3: ; preds = %0
%4 = tail call i64 @isdigit(i32 %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = icmp eq i32 %1, 48
%8 = add nsw i32 %1, -48
%9 = select i1 %7, i32 -1, i32 %8
br label %12
10: ; preds = %3
%11 = tail call i32 @back(i32 %1)
br label %12
12: ; preds = %6, %0, %10
%13 = phi i32 [ 1, %10 ], [ -1, %0 ], [ %9, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void footer(void) { fprintf(stdout, "\f"); }


x86 assembly (clang, -O0):
<footer>:
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):
<footer>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [2 x i8] c"\0C\00"
define void @footer() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [2 x i8] c"\0C\00"
define void @footer() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ ntohl(unsigned long);
unsigned long long ILibNTOHLL(unsigned long long v) {
  {
    union {
      unsigned long lv[2];
      unsigned long long llv;
    } u;
    u.llv = v;
    return ((unsigned long long)ntohl(u.lv[0]) << 32) |
           (unsigned long long)ntohl(u.lv[1]);
  }
}


x86 assembly (clang, -O0):
<ILibNTOHLL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <ntohl@plt>
shl    $0x20,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ntohl@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
or     %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ILibNTOHLL>:
push   %rbx
call   1030 <ntohl@plt>
mov    %rax,%rbx
shl    $0x20,%rbx
call   1030 <ntohl@plt>
or     %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%union.anon = type { [2 x i64] }
define i64 @ILibNTOHLL(i64 %0) {
%2 = alloca i64
%3 = alloca %union.anon
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = bitcast %union.anon* %3 to i64*
store i64 %4, i64* %5
%6 = bitcast %union.anon* %3 to [2 x i64]*
%7 = getelementptr inbounds [2 x i64], [2 x i64]* %6, i64 0, i64 0
%8 = load i64, i64* %7
%9 = call i64 @ntohl(i64 %8)
%10 = shl i64 %9, 32
%11 = bitcast %union.anon* %3 to [2 x i64]*
%12 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 1
%13 = load i64, i64* %12
%14 = call i64 @ntohl(i64 %13)
%15 = or i64 %10, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @ILibNTOHLL(i64 %0) {
%2 = tail call i64 @ntohl(i64 %0)
%3 = shl i64 %2, 32
%4 = tail call i64 @ntohl(i64 undef)
%5 = or i64 %3, %4
ret i64 %5
}
void get_temphumidity_sensordata(char *pchRcvDataFrame, int *iDataIdx,
                                 struct sensor_value *sensorsdata) {
  return;
}


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

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

LLVM IR (-O0):
%struct.sensor_value = type opaque
define void @get_temphumidity_sensordata(i8* %0, i32* %1, %struct.sensor_value* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca %struct.sensor_value*
store i8* %0, i8** %4
store i32* %1, i32** %5
store %struct.sensor_value* %2, %struct.sensor_value** %6
ret void
}

LLVM IR (-O2):
%struct.sensor_value = type opaque
define void @get_temphumidity_sensordata(i8* nocapture %0, i32* nocapture %1, %struct.sensor_value* nocapture %2) {
ret void
}
int main() { return +4; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ driver();
int main() {
  driver();
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @driver()
ret i32 1
}
int decimal__isDigitChar(char ch) {
  const char *p;
  for (p = "0123456789"; *p; ++p) {
    if (*p == ch) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<decimal__isDigitChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    0xeef(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1157 <decimal__isDigitChar+0x57>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1141 <decimal__isDigitChar+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115e <decimal__isDigitChar+0x5e>
jmp    1146 <decimal__isDigitChar+0x46>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1115 <decimal__isDigitChar+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimal__isDigitChar>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @decimal__isDigitChar(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int rand();
int rand_dice() { return 1 + (rand() % 6); }


x86 assembly (clang, -O0):
<rand_dice>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_dice>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rand_dice() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = add nsw i32 1, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @rand_dice() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = add nsw i32 %2, 1
ret i32 %3
}
void set_tbh_size(char buf[], int size) {
  buf[1] = (char)(size & 0xff);
  buf[0] = (char)((size >> 8) & 0xff);
  return;
}


x86 assembly (clang, -O0):
<set_tbh_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_tbh_size>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @set_tbh_size(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 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 0
store i8 %13, i8* %15
ret void
}

LLVM IR (-O2):
define void @set_tbh_size(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %3, i8* %4
%5 = lshr i32 %1, 8
%6 = trunc i32 %5 to i8
store i8 %6, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ die(int /*<<< orphan*/ *, int /*<<< orphan*/);
void buttonrelease(Display *dpy, XEvent *e) { die(dpy, 0); }


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

x86 assembly (clang, -O2):
<buttonrelease>:
xor    %esi,%esi
jmp    1030 <die@plt>

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

LLVM IR (-O2):
define void @buttonrelease(i32* %0, i32* nocapture readnone %1) {
%3 = tail call i32 @die(i32* %0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/ *);
int print_result(FILE *output, const char *msg) { fputs(msg, output); }


x86 assembly (clang, -O0):
<print_result>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fputs@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @print_result(i32* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @fputs(i8* %1, i32* %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ TCIFLUSH;
int slowWrite(int, char *, int);
int /*<<< orphan*/ tcflush(int, int /*<<< orphan*/);
int writeStatus(int fd) {
  char buf[14] = {'W', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x1F, 0x20};
  tcflush(fd, TCIFLUSH);
  int res = slowWrite(fd, buf, 13);
  return res == 13;
}


x86 assembly (clang, -O0):
<writeStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec6(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
call   1040 <tcflush@plt>
mov    -0x4(%rbp),%edi
lea    -0x12(%rbp),%rsi
mov    $0xd,%edx
call   1030 <slowWrite@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xd,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeStatus>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movabs $0x201f0000000000,%rax
mov    %rax,0x6(%rsp)
movq   $0x57,(%rsp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
call   1040 <tcflush@plt>
mov    %rsp,%rsi
mov    %ebx,%edi
mov    $0xd,%edx
call   1030 <slowWrite@plt>
xor    %ecx,%ecx
cmp    $0xd,%eax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.writeStatus.buf = [14 x i8] c"W\00\00\00\00\00\00\00\00\00\00\1F \00"
@TCIFLUSH = global i32 0
define i32 @writeStatus(i32 %0) {
%2 = alloca i32
%3 = alloca [14 x i8]
%4 = alloca i32
store i32 %0, i32* %2
%5 = bitcast [14 x i8]* %3 to i8*
%6 = load i32, i32* %2
%7 = load i32, i32* @TCIFLUSH
%8 = call i32 @tcflush(i32 %6, i32 %7)
%9 = load i32, i32* %2
%10 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%11 = call i32 @slowWrite(i32 %9, i8* %10, i32 13)
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 13
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@__const.writeStatus.buf = [14 x i8] c"W\00\00\00\00\00\00\00\00\00\00\1F \00"
@TCIFLUSH = global i32 0
define i32 @writeStatus(i32 %0) {
%2 = alloca [14 x i8]
%3 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @TCIFLUSH
%5 = tail call i32 @tcflush(i32 %0, i32 %4)
%6 = call i32 @slowWrite(i32 %0, i8* %3, i32 13)
%7 = icmp eq i32 %6, 13
%8 = zext i1 %7 to i32
ret i32 %8
}
int s_pop(int *items, int *_size) {
  int size = *_size;
  int item = items[size - 1];
  *_size = size - 1;
  return item;
}


x86 assembly (clang, -O0):
<s_pop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_pop>:
movslq (%rsi),%rcx
mov    -0x4(%rdi,%rcx,4),%eax
add    $0xffffffffffffffff,%rcx
mov    %ecx,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @s_pop(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
store i32 %4, i32* %1
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ HMAC_CTX;
typedef int /*<<< orphan*/ EVP_MD;

/* Variables and functions */
int /*<<< orphan*/ HMAC_CTX_init(int /*<<< orphan*/ *);
int HMAC_Init_ex(int /*<<< orphan*/ *, void const *, int,
                 int /*<<< orphan*/ const *, int /*<<< orphan*/ *);
int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md) {
  if (key && md)
    HMAC_CTX_init(ctx);
  return HMAC_Init_ex(ctx, key, len, md, NULL);
}


x86 assembly (clang, -O0):
<HMAC_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1156 <HMAC_Init+0x36>
cmpq   $0x0,-0x20(%rbp)
je     1156 <HMAC_Init+0x36>
mov    -0x8(%rbp),%rdi
call   1030 <HMAC_CTX_init@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1040 <HMAC_Init_ex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HMAC_Init>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %edx,%r14d
mov    %rsi,%rbp
mov    %rdi,%rbx
test   %rsi,%rsi
je     1145 <HMAC_Init+0x25>
test   %r15,%r15
je     1145 <HMAC_Init+0x25>
mov    %rbx,%rdi
call   1030 <HMAC_CTX_init@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14d,%edx
mov    %r15,%rcx
xor    %r8d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <HMAC_Init_ex@plt>

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

LLVM IR (-O2):
define i32 @HMAC_Init(i32* %0, i8* %1, i32 %2, i32* %3) {
%5 = icmp ne i8* %1, null
%6 = icmp ne i32* %3, null
%7 = and i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @HMAC_CTX_init(i32* %0)
br label %10
10: ; preds = %8, %4
%11 = tail call i32 @HMAC_Init_ex(i32* %0, i8* %1, i32 %2, i32* %3, i32* null)
ret i32 %11
}
int str_contains(const char *str, char c) {
  while (*str != 0) {
    if (*str == c) {
      return 1;
    }
    ++str;
  }
  return 0;
}


x86 assembly (clang, -O0):
<str_contains>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114e <str_contains+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    113d <str_contains+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1155 <str_contains+0x55>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <str_contains+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_contains>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1120 <str_contains+0x20>
add    $0x1,%rdi
nopl   0x0(%rax)
cmp    %sil,%cl
je     1121 <str_contains+0x21>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <str_contains+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @str_contains(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %8
5: ; preds = %8
%6 = load i8, i8* %12
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2, %5
%9 = phi i8 [ %6, %5 ], [ %3, %2 ]
%10 = phi i8* [ %12, %5 ], [ %0, %2 ]
%11 = icmp eq i8 %9, %1
%12 = getelementptr inbounds i8, i8* %10, i64 1
br i1 %11, label %13, label %5
13: ; preds = %8, %5, %2
%14 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %8 ]
ret i32 %14
}