#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ PrintSlow(char *);
int /*<<< orphan*/ ResetFiveMsgs();
char *get_user_name();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ unlink(char *);
void NewUserResetFiveMsgs(void) {
  char obuf[256];
  sprintf(obuf, "%s/users/%s/keycode", "/home/bbs", get_user_name());
  unlink(obuf);
  sleep(1);
  printf("\n");
  printf("\033[1;32mWelcome to the System, %s.\n", get_user_name());
  PrintSlow("\033[1;31mKeycode PASSED!\n");
  printf("\033[0;31m=-=-=-=-=-=-=-=-=-=\033[1;32m\n");
  printf("To save yourself some reading, you can\n");
  printf("Set to read just the last five messages\n");
  ResetFiveMsgs();
  printf("\n\033[1;35mPointers reset..\n\n");
}


x86 assembly (clang, -O0):
<NewUserResetFiveMsgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x100(%rbp),%rax
mov    %rax,-0x108(%rbp)
mov    $0x0,%al
call   1070 <get_user_name@plt>
mov    -0x108(%rbp),%rdi
mov    %rax,%rcx
lea    0xe5f(%rip),%rsi
lea    0xe6c(%rip),%rdx
call   1080 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <unlink@plt>
mov    $0x1,%edi
call   1090 <sleep@plt>
lea    0xf1c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <get_user_name@plt>
mov    %rax,%rsi
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe51(%rip),%rdi
call   1050 <PrintSlow@plt>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <ResetFiveMsgs@plt>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NewUserResetFiveMsgs>:
push   %rbx
sub    $0x100,%rsp
xor    %eax,%eax
call   1090 <get_user_name@plt>
lea    0xe5a(%rip),%rsi
lea    0xe67(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rax,%rcx
call   10a0 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <unlink@plt>
mov    $0x1,%edi
call   10b0 <sleep@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1090 <get_user_name@plt>
lea    0xe39(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe4b(%rip),%rdi
call   1070 <PrintSlow@plt>
lea    0xe57(%rip),%rdi
call   1050 <puts@plt>
lea    0xe6d(%rip),%rdi
call   1050 <puts@plt>
lea    0xe88(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1080 <ResetFiveMsgs@plt>
lea    0xe9d(%rip),%rdi
add    $0x100,%rsp
pop    %rbx
jmp    1050 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"%s/users/%s/keycode\00"
@.str.1 = [10 x i8] c"/home/bbs\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [35 x i8] c"\1B[1;32mWelcome to the System, %s.\0A\00"
@.str.4 = [24 x i8] c"\1B[1;31mKeycode PASSED!\0A\00"
@.str.5 = [35 x i8] c"\1B[0;31m=-=-=-=-=-=-=-=-=-=\1B[1;32m\0A\00"
@.str.6 = [40 x i8] c"To save yourself some reading, you can\0A\00"
@.str.7 = [41 x i8] c"Set to read just the last five messages\0A\00"
@.str.8 = [27 x i8] c"\0A\1B[1;35mPointers reset..\0A\0A\00"
define void @NewUserResetFiveMsgs() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i8* (...) @get_user_name()
%4 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = call i32 @unlink(i8* %5)
%7 = call i32 @sleep(i32 1)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%9 = call i8* (...) @get_user_name()
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i8* %9)
%11 = call i32 @PrintSlow(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
%15 = call i32 (...) @ResetFiveMsgs()
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s/users/%s/keycode\00"
@.str.1 = [10 x i8] c"/home/bbs\00"
@.str.3 = [35 x i8] c"\1B[1;32mWelcome to the System, %s.\0A\00"
@.str.4 = [24 x i8] c"\1B[1;31mKeycode PASSED!\0A\00"
@str = [34 x i8] c"\1B[0;31m=-=-=-=-=-=-=-=-=-=\1B[1;32m\00"
@str.9 = [39 x i8] c"To save yourself some reading, you can\00"
@str.10 = [40 x i8] c"Set to read just the last five messages\00"
@str.11 = [26 x i8] c"\0A\1B[1;35mPointers reset..\0A\00"
define void @NewUserResetFiveMsgs() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i8* (...) @get_user_name()
%4 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = call i32 @unlink(i8* %2)
%6 = tail call i32 @sleep(i32 1)
%7 = tail call i32 @putchar(i32 10)
%8 = tail call i8* (...) @get_user_name()
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%10 = tail call i32 @PrintSlow(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.9, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.10, i64 0, i64 0))
%14 = tail call i32 (...) @ResetFiveMsgs()
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.11, i64 0, i64 0))
ret void
}