#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 */
scalar_t__ strcmp(char *, char *);
char *get_turn_str(int turn, char *name, char *u1) {
  if (strcmp(u1, name) == 0) {
    if (turn == 0)
      return "\tMINE";
    else
      return "THEIRS";
  }
  if (turn == 1)
    return "\tMINE";
  else
    return "THEIRS";
}


x86 assembly (clang, -O0):
<get_turn_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1164 <get_turn_str+0x54>
cmpl   $0x0,-0xc(%rbp)
jne    1154 <get_turn_str+0x44>
lea    0xeb5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1189 <get_turn_str+0x79>
lea    0xeab(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1189 <get_turn_str+0x79>
cmpl   $0x1,-0xc(%rbp)
jne    117e <get_turn_str+0x6e>
lea    0xe8b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1189 <get_turn_str+0x79>
lea    0xe81(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_turn_str>:
push   %rbx
mov    %edi,%ebx
mov    %rdx,%rdi
call   1030 <strcmp@plt>
test   %ebx,%ebx
lea    0xedc(%rip),%rdx
lea    0xedb(%rip),%rcx
mov    %rcx,%rsi
cmove  %rdx,%rsi
cmp    $0x1,%ebx
cmove  %rdx,%rcx
test   %rax,%rax
cmove  %rsi,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"\09MINE\00"
@.str.1 = [7 x i8] c"THEIRS\00"
define i8* @get_turn_str(i32 %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = load i8*, i8** %7
%9 = load i8*, i8** %6
%10 = call i64 @strcmp(i8* %8, i8* %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = load i32, i32* %5
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %4
br label %22
16: ; preds = %12
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %4
br label %22
17: ; preds = %3
%18 = load i32, i32* %5
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %21
20: ; preds = %17
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %4
br label %22
21: ; preds = %17
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %4
br label %22
22: ; preds = %21, %20, %16, %15
%23 = load i8*, i8** %4
ret i8* %23
}

LLVM IR (-O2):
@.str = [6 x i8] c"\09MINE\00"
@.str.1 = [7 x i8] c"THEIRS\00"
define i8* @get_turn_str(i32 %0, i8* %1, i8* %2) {
%4 = tail call i64 @strcmp(i8* %2, i8* %1)
%5 = icmp eq i64 %4, 0
%6 = icmp eq i32 %0, 0
%7 = select i1 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%8 = icmp eq i32 %0, 1
%9 = select i1 %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%10 = select i1 %5, i8* %7, i8* %9
ret i8* %10
}