#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 */
struct utsname {
  int /*<<< orphan*/ nodename;
};

/* Variables and functions */
int /*<<< orphan*/ cprintf(char *, char *, ...);
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ uname(struct utsname *);
void scr_report_display() {
  char *dname = "0";
  struct utsname ut;
  (void)uname(&ut);
  if (strncmp(dname, "unix:", 5) == 0)
    cprintf("%s%s\r", ut.nodename, dname + 4);
  else if (dname[0] == ':')
    cprintf("%s%s\r", ut.nodename, dname);
  else
    cprintf("%s\r", dname);
}


x86 assembly (clang, -O0):
<scr_report_display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <uname@plt>
mov    -0x8(%rbp),%rdi
lea    0xeab(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    118a <scr_report_display+0x5a>
movslq -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
add    $0x4,%rdx
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1050 <cprintf@plt>
jmp    11cc <scr_report_display+0x9c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    11b5 <scr_report_display+0x85>
movslq -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1050 <cprintf@plt>
jmp    11c7 <scr_report_display+0x97>
mov    -0x8(%rbp),%rsi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1050 <cprintf@plt>
jmp    11cc <scr_report_display+0x9c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scr_report_display>:
push   %rax
mov    %rsp,%rdi
call   1040 <uname@plt>
lea    0xec0(%rip),%rdi
lea    0xebb(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     116c <scr_report_display+0x3c>
lea    0xead(%rip),%rdi
lea    0xe9c(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1050 <cprintf@plt>
movslq (%rsp),%rsi
lea    0xe91(%rip),%rdi
lea    0xe86(%rip),%rdx
xor    %eax,%eax
pop    %rcx
jmp    1050 <cprintf@plt>

LLVM IR (-O0):
%struct.utsname = type { i32 }
@.str = [2 x i8] c"0\00"
@.str.1 = [6 x i8] c"unix:\00"
@.str.2 = [6 x i8] c"%s%s\0D\00"
@.str.3 = [4 x i8] c"%s\0D\00"
define void @scr_report_display() {
%1 = alloca i8*
%2 = alloca %struct.utsname
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = call i32 @uname(%struct.utsname* %2)
%4 = load i8*, i8** %1
%5 = call i64 @strncmp(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %0
%8 = getelementptr inbounds %struct.utsname, %struct.utsname* %2, i32 0, i32 0
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
%12 = load i8*, i8** %1
%13 = getelementptr inbounds i8, i8* %12, i64 4
%14 = call i32 (i8*, i8*, ...) @cprintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %11, i8* %13)
br label %32
15: ; preds = %0
%16 = load i8*, i8** %1
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 58
br i1 %20, label %21, label %28
21: ; preds = %15
%22 = getelementptr inbounds %struct.utsname, %struct.utsname* %2, i32 0, i32 0
%23 = load i32, i32* %22
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i8*
%26 = load i8*, i8** %1
%27 = call i32 (i8*, i8*, ...) @cprintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %25, i8* %26)
br label %31
28: ; preds = %15
%29 = load i8*, i8** %1
%30 = call i32 (i8*, i8*, ...) @cprintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %28, %21
br label %32
32: ; preds = %31, %7
ret void
}

LLVM IR (-O2):
%struct.utsname = type { i32 }
@.str = [2 x i8] c"0\00"
@.str.1 = [6 x i8] c"unix:\00"
@.str.2 = [6 x i8] c"%s%s\0D\00"
@.str.3 = [4 x i8] c"%s\0D\00"
define void @scr_report_display() {
%1 = alloca %struct.utsname
%2 = bitcast %struct.utsname* %1 to i8*
%3 = call i32 @uname(%struct.utsname* %1)
%4 = tail call i64 @strncmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = tail call i32 (i8*, i8*, ...) @cprintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 2, i64 0))
br label %14
12: ; preds = %0
%13 = tail call i32 (i8*, i8*, ...) @cprintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %6
ret void
}