#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*/ printf(char *, char *);
scalar_t__ tic_tac_win(int);
main() {
  printf("win by tic: %s\n", tic_tac_win(1) ? "true" : "false");
  printf("win by tac: %s\n", tic_tac_win(2) ? "true" : "false");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <tic_tac_win@plt>
mov    %rax,%rcx
lea    0xedd(%rip),%rsi
lea    0xed1(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <tic_tac_win@plt>
mov    %rax,%rcx
lea    0xeae(%rip),%rsi
lea    0xea2(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%edi
call   1040 <tic_tac_win@plt>
test   %rax,%rax
lea    0xedd(%rip),%r14
lea    0xed1(%rip),%rbx
mov    %rbx,%rsi
cmove  %r14,%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <tic_tac_win@plt>
test   %rax,%rax
cmove  %r14,%rbx
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"win by tic: %s\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
@.str.3 = [16 x i8] c"win by tac: %s\0A\00"
define i32 @main() {
%1 = call i64 @tic_tac_win(i32 1)
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i64 @tic_tac_win(i32 2)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"win by tic: %s\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
@.str.3 = [16 x i8] c"win by tac: %s\0A\00"
define i32 @main() {
%1 = tail call i64 @tic_tac_win(i32 1)
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i64 @tic_tac_win(i32 2)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %7)
ret i32 0
}