#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 {
  char *sysname;
};

/* Variables and functions */
scalar_t__ iupStrEqualNoCase(char *, char *);
char *iupStrReturnStr(char *);
int /*<<< orphan*/ uname(struct utsname *);
char *iupdrvGetSystemName(void) {
  struct utsname un;
  uname(&un);
  if (iupStrEqualNoCase(un.sysname, "Darwin"))
    return iupStrReturnStr("MacOS");
  else
    return iupStrReturnStr(un.sysname);
}


x86 assembly (clang, -O0):
<iupdrvGetSystemName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
call   1030 <uname@plt>
mov    -0x10(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1040 <iupStrEqualNoCase@plt>
cmp    $0x0,%rax
je     1170 <iupdrvGetSystemName+0x40>
lea    0xea5(%rip),%rdi
call   1050 <iupStrReturnStr@plt>
mov    %rax,-0x8(%rbp)
jmp    117d <iupdrvGetSystemName+0x4d>
mov    -0x10(%rbp),%rdi
call   1050 <iupStrReturnStr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iupdrvGetSystemName>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rdi
call   1030 <uname@plt>
mov    0x8(%rsp),%rbx
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdi
call   1040 <iupStrEqualNoCase@plt>
test   %rax,%rax
lea    0xeaa(%rip),%rdi
cmove  %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <iupStrReturnStr@plt>

LLVM IR (-O0):
%struct.utsname = type { i8* }
@.str = [7 x i8] c"Darwin\00"
@.str.1 = [6 x i8] c"MacOS\00"
define i8* @iupdrvGetSystemName() {
%1 = alloca i8*
%2 = alloca %struct.utsname
%3 = call i32 @uname(%struct.utsname* %2)
%4 = getelementptr inbounds %struct.utsname, %struct.utsname* %2, i32 0, i32 0
%5 = load i8*, i8** %4
%6 = call i64 @iupStrEqualNoCase(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i8* @iupStrReturnStr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i8* %9, i8** %1
br label %14
10: ; preds = %0
%11 = getelementptr inbounds %struct.utsname, %struct.utsname* %2, i32 0, i32 0
%12 = load i8*, i8** %11
%13 = call i8* @iupStrReturnStr(i8* %12)
store i8* %13, i8** %1
br label %14
14: ; preds = %10, %8
%15 = load i8*, i8** %1
ret i8* %15
}

LLVM IR (-O2):
%struct.utsname = type { i8* }
@.str = [7 x i8] c"Darwin\00"
@.str.1 = [6 x i8] c"MacOS\00"
define i8* @iupdrvGetSystemName() {
%1 = alloca %struct.utsname
%2 = bitcast %struct.utsname* %1 to i8*
%3 = call i32 @uname(%struct.utsname* %1)
%4 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 0
%5 = load i8*, i8** %4
%6 = tail call i64 @iupStrEqualNoCase(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%9 = tail call i8* @iupStrReturnStr(i8* %8)
ret i8* %9
}