xunge/DecIR huggingface dataset:
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_clear_quaddobl_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(567, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<syscon_clear_quaddobl_Laurent_system>:
mov    $0x237,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @syscon_clear_quaddobl_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 567, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void queueClose(int queue) { printf("Close Queue %d\n", queue); }


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"Close Queue %d\0A\00"
define void @queueClose(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, char const *, char const *);
void mk_filename(char *filename, size_t len, const char *path,
                 const char *name) {
  snprintf(filename, len, "%s/%s", path, name);
}


x86 assembly (clang, -O0):
<mk_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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),%rcx
mov    -0x20(%rbp),%r8
lea    0xec1(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_filename>:
mov    %rcx,%r8
mov    %rdx,%rcx
lea    0xee3(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%s\00"
define void @mk_filename(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @snprintf(i8* %9, i64 %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
define void @mk_filename(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
ret void
}
void exc_lvl_early_init(void) {}


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

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

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

LLVM IR (-O2):
define void @exc_lvl_early_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a_fetch_add(int volatile *, int);
void a_inc(volatile int *x) { a_fetch_add(x, 1); }


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

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

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

LLVM IR (-O2):
define void @a_inc(i32* %0) {
%2 = tail call i32 @a_fetch_add(i32* %0, i32 1)
ret void
}
void g_timer_destroy() {}


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

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

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

LLVM IR (-O2):
define void @g_timer_destroy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trap_SendServerCommand(int, int /*<<< orphan*/);
int /*<<< orphan*/ va(char *, int, int);
void NS_SendPlayersStatusToAllPlayers(int clientNum, int status) {
  trap_SendServerCommand(-1, va("mstatus %i %i", clientNum, status));
}


x86 assembly (clang, -O0):
<NS_SendPlayersStatusToAllPlayers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1040 <va@plt>
mov    %eax,%esi
mov    $0xffffffff,%edi
call   1030 <trap_SendServerCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NS_SendPlayersStatusToAllPlayers>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
lea    0xed4(%rip),%rdi
call   1040 <va@plt>
mov    $0xffffffff,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <trap_SendServerCommand@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"mstatus %i %i\00"
define void @NS_SendPlayersStatusToAllPlayers(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 = load i32, i32* %4
%7 = call i32 @va(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 @trap_SendServerCommand(i32 -1, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"mstatus %i %i\00"
define void @NS_SendPlayersStatusToAllPlayers(i32 %0, i32 %1) {
%3 = tail call i32 @va(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = tail call i32 @trap_SendServerCommand(i32 -1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, int, char *);
void imc_fits_mkint(char *line, char *key, int val, char *com) {
  sprintf(line, "%-8.8s= %20d / %-47.47s", key, val, com);
}


x86 assembly (clang, -O0):
<imc_fits_mkint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
lea    0xec3(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imc_fits_mkint>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
lea    0xee1(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"%-8.8s= %20d / %-47.47s\00"
define void @imc_fits_mkint(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"%-8.8s= %20d / %-47.47s\00"
define void @imc_fits_mkint(i8* nocapture writeonly %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %3)
ret void
}
unsigned namehash(const char *str) {
  unsigned hash = 5381;
  while (*str)
    hash = ((hash << 5) + hash) + *str++;
  return hash;
}


x86 assembly (clang, -O0):
<namehash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <namehash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <namehash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<namehash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <namehash+0x28>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <namehash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @namehash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 33
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int write_quaddobl_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(242, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<write_quaddobl_target_system>:
mov    $0xf2,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @write_quaddobl_target_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 242, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void ble_evt_dfu_boot(const struct ble_msg_dfu_boot_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_dfu_boot_evt_t = type opaque
define void @ble_evt_dfu_boot(%struct.ble_msg_dfu_boot_evt_t* nocapture %0) {
ret void
}
int some_func() { return 123; }


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

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

LLVM IR (-O0):
define i32 @some_func() {
ret i32 123
}

LLVM IR (-O2):
define i32 @some_func() {
ret i32 123
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rozszyfrowanie(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int liczba;
  printf("Podaj liczbe do odszyfrowania\n");
  scanf("%d", &liczba);
  rozszyfrowanie(liczba);
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <rozszyfrowanie@plt>
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xebb(%rip),%rdi
call   1040 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <rozszyfrowanie@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [30 x i8] c"Podaj liczbe do odszyfrowania\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @rozszyfrowanie(i32 %5)
%7 = call i32 @putchar(i32 10)
ret i32 0
}
void ieee80211_sta_debugfs_add(struct sta_info *sta) {}


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

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

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

LLVM IR (-O2):
%struct.sta_info = type opaque
define void @ieee80211_sta_debugfs_add(%struct.sta_info* nocapture %0) {
ret void
}
unsigned int ones(n)
int n;
{
  unsigned int len_ones;
  int i;
  i = 0;
  len_ones = 0;
  while (i < n) {
    len_ones = (len_ones << 1) | 1;
    i++;
  }
  return len_ones;
}


x86 assembly (clang, -O0):
<ones>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113b <ones+0x3b>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
or     $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <ones+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ones>:
test   %edi,%edi
jle    1115 <ones+0x15>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    1118 <ones+0x18>
xor    %eax,%eax
jmp    112d <ones+0x2d>
xor    %eax,%eax
ret
and    $0xfffffff8,%edi
xor    %eax,%eax
nopl   (%rax)
shl    $0x8,%eax
or     $0xff,%eax
add    $0xfffffff8,%edi
jne    1120 <ones+0x20>
test   %ecx,%ecx
je     114a <ones+0x4a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    %eax,%eax
add    $0x1,%eax
add    $0xffffffff,%ecx
jne    1140 <ones+0x40>
ret

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

LLVM IR (-O2):
define i32 @ones(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %27
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %16, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i32 [ 0, %7 ], [ %13, %9 ]
%11 = phi i32 [ 0, %7 ], [ %14, %9 ]
%12 = shl i32 %10, 8
%13 = or i32 %12, 255
%14 = add i32 %11, 8
%15 = icmp eq i32 %14, %8
br i1 %15, label %16, label %9
16: ; preds = %9, %3
%17 = phi i32 [ undef, %3 ], [ %13, %9 ]
%18 = phi i32 [ 0, %3 ], [ %13, %9 ]
%19 = icmp eq i32 %5, 0
br i1 %19, label %27, label %20
20: ; preds = %16, %20
%21 = phi i32 [ %24, %20 ], [ %18, %16 ]
%22 = phi i32 [ %25, %20 ], [ 0, %16 ]
%23 = shl i32 %21, 1
%24 = or i32 %23, 1
%25 = add i32 %22, 1
%26 = icmp eq i32 %25, %5
br i1 %26, label %27, label %20
27: ; preds = %16, %20, %1
%28 = phi i32 [ 0, %1 ], [ %17, %16 ], [ %24, %20 ]
ret i32 %28
}
/* Type definitions */
struct my_struct {
  int dummy;
};

/* Variables and functions */
struct my_struct *return_my_struct_ptr();
struct my_struct *use_return_my_struct_ptr() {
  return return_my_struct_ptr();
}


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

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

LLVM IR (-O0):
%struct.my_struct = type { i32 }
define %struct.my_struct* @use_return_my_struct_ptr() {
%1 = call %struct.my_struct* (...) @return_my_struct_ptr()
ret %struct.my_struct* %1
}

LLVM IR (-O2):
%struct.my_struct = type { i32 }
define %struct.my_struct* @use_return_my_struct_ptr() {
%1 = tail call %struct.my_struct* (...) @return_my_struct_ptr()
ret %struct.my_struct* %1
}
/* Variables and functions */
int close(int);
int syscall_close(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<syscall_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @syscall_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void fprint_rlc(FILE *stream) {
  fprintf(stream, "RLC   A                         ");
}


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

x86 assembly (clang, -O2):
<fprint_rlc>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x20,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"RLC A \00"
define void @fprint_rlc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"RLC A \00"
define void @fprint_rlc(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 32, i64 1, i32* %0)
ret void
}
/* Variables and functions */
size_t *get_malloc_address_location(void *const mem) {
  return ((size_t *)mem) - 1;
}


x86 assembly (clang, -O0):
<get_malloc_address_location>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff8,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_malloc_address_location>:
lea    -0x8(%rdi),%rax
ret

LLVM IR (-O0):
define i64* @get_malloc_address_location(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i64*
%5 = getelementptr inbounds i64, i64* %4, i64 -1
ret i64* %5
}

LLVM IR (-O2):
define i64* @get_malloc_address_location(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -8
%3 = bitcast i8* %2 to i64*
ret i64* %3
}
/* Variables and functions */
float __ocml_sinpi_f32(float);
float sinpif(float x) { return __ocml_sinpi_f32(x); }


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

x86 assembly (clang, -O2):
<sinpif>:
jmp    1030 <__ocml_sinpi_f32@plt>

LLVM IR (-O0):
define float @sinpif(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @__ocml_sinpi_f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @sinpif(float %0) {
%2 = tail call float @__ocml_sinpi_f32(float %0)
ret float %2
}
int effect_null_update(struct razer_fx_render_node *render) { return (1); }


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

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

LLVM IR (-O0):
%struct.razer_fx_render_node = type opaque
define i32 @effect_null_update(%struct.razer_fx_render_node* %0) {
%2 = alloca %struct.razer_fx_render_node*
store %struct.razer_fx_render_node* %0, %struct.razer_fx_render_node** %2
ret i32 1
}

LLVM IR (-O2):
%struct.razer_fx_render_node = type opaque
define i32 @effect_null_update(%struct.razer_fx_render_node* nocapture readnone %0) {
ret i32 1
}
int test_imm_A0uint16_mem(unsigned short *val) {
  return ((*val) & (-0xA0 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A0uint16_mem>:
movzwl (%rdi),%eax
test   $0xff60,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A0uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -160
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Usage(void) {
  fprintf(
      stderr,
      "            usage: gdbstub\n            [ -b <type> ]     select target "
      "board (default is 'default')\n            [ -p <port> ]     serial port "
      "(default is to auto-detect the port)\n            [ -P ]            "
      "list available serial ports\n            [ -I <path> ]     add a "
      "directory to the include path\n            [ -D var=value ]  define a "
      "board configuration variable\n            [ -l <logfile> ]  write a log "
      "file\n            [ -v ]            verbose output\n");
  exit(1);
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [464 x i8] c" usage: gdbstub\0A [ -b <type> ] select target board (default is 'default')\0A [ -p <port> ] serial port (default is to auto-detect the port)\0A [ -P ] list available serial ports\0A [ -I <path> ] add a directory to the include path\0A [ -D var=value ] define a board configuration variable\0A [ -l <logfile> ] write a log file\0A [ -v ] verbose output\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([464 x i8], [464 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [464 x i8] c" usage: gdbstub\0A [ -b <type> ] select target board (default is 'default')\0A [ -p <port> ] serial port (default is to auto-detect the port)\0A [ -P ] list available serial ports\0A [ -I <path> ] add a directory to the include path\0A [ -D var=value ] define a board configuration variable\0A [ -l <logfile> ] write a log file\0A [ -v ] verbose output\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([464 x i8], [464 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void fizzbuzz(int number, char *string) {}


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

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

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

LLVM IR (-O2):
define void @fizzbuzz(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: CryptX <input_file> <output_file> <key>\n");
  printf("Process odd number of times to encrypt, even number of times to "
         "decrypt\n");
  printf("\nversion: alpha-1.0\n");
  printf("by Gtsz(email:chuyt@live.hk)\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
call   1030 <printf@plt>
lea    0xf36(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3f(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xf37(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3f(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"Usage: CryptX <input_file> <output_file> <key>\0A\00"
@.str.1 = [73 x i8] c"Process odd number of times to encrypt, even number of times to decrypt\0A\00"
@.str.2 = [21 x i8] c"\0Aversion: alpha-1.0\0A\00"
@.str.3 = [30 x i8] c"by Gtsz(email:chuyt@live.hk)\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [47 x i8] c"Usage: CryptX <input_file> <output_file> <key>\00"
@str.4 = [72 x i8] c"Process odd number of times to encrypt, even number of times to decrypt\00"
@str.5 = [20 x i8] c"\0Aversion: alpha-1.0\00"
@str.6 = [29 x i8] c"by Gtsz(email:chuyt@live.hk)\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
int __attribute__((noipa, no)) foo(int i) {
  int a[2];
  a[1] = 1;
  int j = a[1];
  int *p = &a[0];
  p[i] = 0;
  return a[j];
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
movslq -0x10(%rbp),%rax
mov    -0xc(%rbp,%rax,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x1,-0x4(%rsp)
movslq %edi,%rax
movl   $0x0,-0x8(%rsp,%rax,4)
mov    -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i32]
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %2
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 1, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%8 = load i32, i32* %7
store i32 %8, i32* %4
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
store i32 0, i32* %13
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 %15
%17 = load i32, i32* %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = alloca [2 x i32]
%3 = bitcast [2 x i32]* %2 to i8*
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
store i32 1, i32* %4
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 %5
store i32 0, i32* %6
%7 = load i32, i32* %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ test(char *, char *);
void TEST_bit_and(void) {
  test("20", "main(){printf(\"%d\", 30&21);}");
  test("20", "main(){int i=30; i&=21; printf(\"%d\", i);}");
}


x86 assembly (clang, -O0):
<TEST_bit_and>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <test@plt>
lea    0xed2(%rip),%rdi
lea    0xeeb(%rip),%rsi
call   1030 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST_bit_and>:
push   %rbx
lea    0xee8(%rip),%rbx
lea    0xee4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test@plt>
lea    0xef2(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"20\00"
@.str.1 = [29 x i8] c"main(){printf(\22%d\22, 30&21);}\00"
@.str.2 = [42 x i8] c"main(){int i=30; i&=21; printf(\22%d\22, i);}\00"
define void @TEST_bit_and() {
%1 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"20\00"
@.str.1 = [29 x i8] c"main(){printf(\22%d\22, 30&21);}\00"
@.str.2 = [42 x i8] c"main(){int i=30; i&=21; printf(\22%d\22, i);}\00"
define void @TEST_bit_and() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void dhcp6_find_delegates1(void *arg) { {}; }


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

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

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

LLVM IR (-O2):
define void @dhcp6_find_delegates1(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emulcommand(int);
int /*<<< orphan*/ testemul(int, char *);
void resettable() {
  emulcommand(7);
  testemul(254, "no table reset ACK");
}


x86 assembly (clang, -O0):
<resettable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
call   1040 <emulcommand@plt>
mov    $0xfe,%edi
lea    0xec6(%rip),%rsi
call   1030 <testemul@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<resettable>:
push   %rax
mov    $0x7,%edi
call   1040 <emulcommand@plt>
lea    0xece(%rip),%rsi
mov    $0xfe,%edi
pop    %rax
jmp    1030 <testemul@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"no table reset ACK\00"
define void @resettable() {
%1 = call i32 @emulcommand(i32 7)
%2 = call i32 @testemul(i32 254, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"no table reset ACK\00"
define void @resettable() {
%1 = tail call i32 @emulcommand(i32 7)
%2 = tail call i32 @testemul(i32 254, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
const struct block_list *BL_UCCAST_(const struct block_list *bl) { return bl; }


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

x86 assembly (clang, -O2):
<BL_UCCAST_>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
%struct.block_list = type opaque
define %struct.block_list* @BL_UCCAST_(%struct.block_list* readnone returned %0) {
ret %struct.block_list* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void Usage(char *me) {
  fprintf(stderr, "usage: %s <ram-compressed-image> [-h<header>]\n", me);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"usage: %s <ram-compressed-image> [-h<header>]\0A\00"
define void @Usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"usage: %s <ram-compressed-image> [-h<header>]\0A\00"
define void @Usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint;

/* Variables and functions */
int readtrapno();
uint readtreturn() {
  switch (readtrapno()) {
  case 3:
    return *(int *)0x80001108;
  default:
    return *(int *)0x80001108 - 4;
  }
}


x86 assembly (clang, -O0):
<readtreturn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <readtrapno@plt>
sub    $0x3,%eax
jne    113c <readtreturn+0x2c>
jmp    112d <readtreturn+0x1d>
mov    $0x80001108,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <readtreturn+0x39>
mov    $0x80001108,%eax
mov    (%rax),%eax
sub    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readtreturn>:
push   %rax
xor    %eax,%eax
call   1030 <readtrapno@plt>
mov    $0x80001108,%ecx
mov    (%rcx),%edx
lea    -0x4(%rdx),%ecx
cmp    $0x3,%eax
cmove  %edx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @readtreturn() {
%1 = alloca i32
%2 = call i32 (...) @readtrapno()
switch i32 %2, label %5 [
i32 3, label %3
]
3: ; preds = %0
%4 = load i32, i32* inttoptr (i64 2147488008 to i32*)
store i32 %4, i32* %1
br label %8
5: ; preds = %0
%6 = load i32, i32* inttoptr (i64 2147488008 to i32*)
%7 = sub nsw i32 %6, 4
store i32 %7, i32* %1
br label %8
8: ; preds = %5, %3
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @readtreturn() {
%1 = tail call i32 (...) @readtrapno()
%2 = icmp eq i32 %1, 3
%3 = load i32, i32* inttoptr (i64 2147488008 to i32*)
%4 = add nsw i32 %3, -4
%5 = select i1 %2, i32 %3, i32 %4
ret i32 %5
}
/* Type definitions */
struct user_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_to_user(char *, struct user_t *);
void send_FBLogin_Request(struct user_t *user) {
  send_to_user("$FBLoginReq ", user);
  return;
}


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

x86 assembly (clang, -O2):
<send_FBLogin_Request>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <send_to_user@plt>

LLVM IR (-O0):
%struct.user_t = type { i32 }
@.str = [13 x i8] c"$FBLoginReq \00"
define void @send_FBLogin_Request(%struct.user_t* %0) {
%2 = alloca %struct.user_t*
store %struct.user_t* %0, %struct.user_t** %2
%3 = load %struct.user_t*, %struct.user_t** %2
%4 = call i32 @send_to_user(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.user_t* %3)
ret void
}

LLVM IR (-O2):
%struct.user_t = type { i32 }
@.str = [13 x i8] c"$FBLoginReq \00"
define void @send_FBLogin_Request(%struct.user_t* %0) {
%2 = tail call i32 @send_to_user(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.user_t* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ print_secr();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int check = 0;
  char buffer[32];
  gets(buffer);
  if (check == 0x74696445) {
    print_secr();
  } else {
    printf("No password to show\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x40(%rbp),%rdi
call   1040 <gets@plt>
cmpl   $0x74696445,-0x14(%rbp)
jne    116f <main+0x3f>
mov    $0x0,%al
call   1050 <print_secr@plt>
jmp    117b <main+0x4b>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    %rsp,%rdi
call   1040 <gets@plt>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"No password to show\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [32 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%9 = call i32 @gets(i8* %8)
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 1953064005
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @print_secr()
br label %16
14: ; preds = %2
%15 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@str = [20 x i8] c"No password to show\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int f_green() { return fputs("[32m", stdout); }


x86 assembly (clang, -O0):
<f_green>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_green>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[32m\00"
@stdout = global i32 0
define i32 @f_green() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[32m\00"
@stdout = global i32 0
define i32 @f_green() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, unsigned char, unsigned int);
void FillMemory(void *dest, unsigned int size, unsigned char val) {
  memset(dest, val, size);
}


x86 assembly (clang, -O0):
<FillMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xd(%rbp),%al
mov    -0xc(%rbp),%edx
movzbl %al,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FillMemory>:
mov    %esi,%eax
mov    %edx,%esi
mov    %eax,%edx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @FillMemory(i8* %0, i32 %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = load i8, i8* %6
%9 = load i32, i32* %5
%10 = call i32 @memset(i8* %7, i8 zeroext %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @FillMemory(i8* %0, i32 %1, i8 zeroext %2) {
%4 = tail call i32 @memset(i8* %0, i8 zeroext %2, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *pstrncpy(char *out, const char *in, size_t num) {
  memcpy(out, in, num);
  out[num] = '\0';
  return out;
}


x86 assembly (clang, -O0):
<pstrncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pstrncpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <memcpy@plt>
movb   $0x0,(%rbx,%r14,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @pstrncpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcpy(i8* %7, i8* %8, i64 %9)
%11 = load i8*, i8** %4
%12 = load i64, i64* %6
%13 = getelementptr inbounds i8, i8* %11, i64 %12
store i8 0, i8* %13
%14 = load i8*, i8** %4
ret i8* %14
}

LLVM IR (-O2):
define i8* @pstrncpy(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
%5 = getelementptr inbounds i8, i8* %0, i64 %2
store i8 0, i8* %5
ret i8* %0
}
/* Type definitions */
struct ell_v {
  int dummy;
};

/* Variables and functions */
struct ell_v *ell_string(char *, int);
struct ell_v *ell_boolean(bool b) {
  return ell_string("1", b);
}


x86 assembly (clang, -O0):
<ell_boolean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <ell_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ell_v = type { i32 }
@.str = [2 x i8] c"1\00"
define %struct.ell_v* @ell_boolean(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call %struct.ell_v* @ell_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %3)
ret %struct.ell_v* %4
}

LLVM IR (-O2):
%struct.ell_v = type { i32 }
@.str = [2 x i8] c"1\00"
define %struct.ell_v* @ell_boolean(i32 %0) {
%2 = tail call %struct.ell_v* @ell_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %0)
ret %struct.ell_v* %2
}
float square(float *cir_rad, float *cir_ans) {
  *cir_ans = ((*cir_rad * *cir_rad) * 3.14);
  return (*cir_ans);
}


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed8(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
movss  (%rdi),%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xeec(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define float @square(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = load float*, float** %3
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = fpext float %9 to double
%11 = fmul double %10, 3.140000e+00
%12 = fptrunc double %11 to float
%13 = load float*, float** %4
store float %12, float* %13
%14 = load float*, float** %4
%15 = load float, float* %14
ret float %15
}

LLVM IR (-O2):
define float @square(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
%4 = fmul float %3, %3
%5 = fpext float %4 to double
%6 = fmul double %5, 3.140000e+00
%7 = fptrunc double %6 to float
store float %7, float* %1
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ f(char const **);
void g(const char **p) { f(p); }


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

x86 assembly (clang, -O2):
<g>:
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define void @g(i8** %0) {
%2 = tail call i32 @f(i8** %0)
ret void
}
void g_unichar_iscntrl() {}


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

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

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

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