#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*/ snprintf(char *, int, char *);
int /*<<< orphan*/ uwrite_init();
int /*<<< orphan*/ uwrite_print_buff(char *);
int /*<<< orphan*/ uwrite_println_byte(char *);
int /*<<< orphan*/ uwrite_println_long(long *);
int /*<<< orphan*/ uwrite_println_short(int *);
int main(void) {
  uwrite_init();
  char message[10];
  snprintf(message, 10, "Mega!\r\n");
  uwrite_print_buff(message);
  uwrite_println_byte("3");
  int a_number = 65535;
  uwrite_println_short(&a_number);
  long a_long_number = 525600;
  uwrite_println_long(&a_long_number);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <uwrite_init@plt>
lea    -0xe(%rbp),%rdi
mov    $0xa,%esi
lea    0xe7a(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0xe(%rbp),%rdi
call   1070 <uwrite_print_buff@plt>
lea    0xe6d(%rip),%rdi
call   1060 <uwrite_println_byte@plt>
movl   $0xffff,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1080 <uwrite_println_short@plt>
movq   $0x80520,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <uwrite_println_long@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
xor    %eax,%eax
call   1030 <uwrite_init@plt>
lea    0xe8d(%rip),%rdx
lea    0x16(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <snprintf@plt>
mov    %rbx,%rdi
call   1070 <uwrite_print_buff@plt>
lea    0xe74(%rip),%rdi
call   1060 <uwrite_println_byte@plt>
movl   $0xffff,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1080 <uwrite_println_short@plt>
movq   $0x80520,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <uwrite_println_long@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Mega!\0D\0A\00"
@.str.1 = [2 x i8] c"3\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca i32
%4 = alloca i64
store i32 0, i32* %1
%5 = call i32 (...) @uwrite_init()
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 @snprintf(i8* %6, i32 10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%9 = call i32 @uwrite_print_buff(i8* %8)
%10 = call i32 @uwrite_println_byte(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 65535, i32* %3
%11 = call i32 @uwrite_println_short(i32* %3)
store i64 525600, i64* %4
%12 = call i32 @uwrite_println_long(i64* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"Mega!\0D\0A\00"
@.str.1 = [2 x i8] c"3\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca i32
%3 = alloca i64
%4 = tail call i32 (...) @uwrite_init()
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @uwrite_print_buff(i8* %5)
%8 = call i32 @uwrite_println_byte(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = bitcast i32* %2 to i8*
store i32 65535, i32* %2
%10 = call i32 @uwrite_println_short(i32* %2)
%11 = bitcast i64* %3 to i8*
store i64 525600, i64* %3
%12 = call i32 @uwrite_println_long(i64* %3)
ret i32 0
}