#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 gethostname(char *name, size_t __attribute__((unused)) len) {
  *name++ = 'n';
  *name++ = 'o';
  *name++ = 'n';
  *name++ = 'f';
  *name++ = 'q';
  *name++ = 'd';
  *name++ = 'n';
  *name++ = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<gethostname>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x6e,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x6f,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x6e,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x66,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x71,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x64,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x6e,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethostname>:
movabs $0x6e6471666e6f6e,%rax
mov    %rax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @gethostname(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %3
store i8 110, i8* %5
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %3
store i8 111, i8* %7
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
store i8 110, i8* %9
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
store i8 102, i8* %11
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
store i8 113, i8* %13
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
store i8 100, i8* %15
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %3
store i8 110, i8* %17
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
store i8 0, i8* %19
ret i32 0
}

LLVM IR (-O2):
define i32 @gethostname(i8* nocapture writeonly %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
store i8 110, i8* %0
%4 = getelementptr inbounds i8, i8* %0, i64 2
store i8 111, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 3
store i8 110, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 4
store i8 102, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 5
store i8 113, i8* %6
%8 = getelementptr inbounds i8, i8* %0, i64 6
store i8 100, i8* %7
%9 = getelementptr inbounds i8, i8* %0, i64 7
store i8 110, i8* %8
store i8 0, i8* %9
ret i32 0
}