#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 *, ...);
void nround_announce(char winner, char player1, char player2,
                     char next_player) {
  printf("\n---- New Round ----\n");
  if (winner == 'O') {
    if (winner == player1) {
      printf("%c switches stones with %c\n", winner, next_player);
    } else if (winner == player2) {
      printf("%c switches stones with %c\n", winner, next_player);
    } else {
      printf("Round stones remain unchanged.\n");
    }
  } else {
    printf("Round stones remain unchanged.\n");
  }
}


x86 assembly (clang, -O0):
<nround_announce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x4f,%eax
jne    11b8 <nround_announce+0xa8>
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jne    1175 <nround_announce+0x65>
movsbl -0x1(%rbp),%esi
movsbl -0x4(%rbp),%edx
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b3 <nround_announce+0xa3>
movsbl -0x1(%rbp),%eax
movsbl -0x3(%rbp),%ecx
cmp    %ecx,%eax
jne    11a0 <nround_announce+0x90>
movsbl -0x1(%rbp),%esi
movsbl -0x4(%rbp),%edx
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ae <nround_announce+0x9e>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b3 <nround_announce+0xa3>
jmp    11c6 <nround_announce+0xb6>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nround_announce>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x4f,%bpl
jne    116f <nround_announce+0x4f>
cmp    $0x4f,%bl
je     114e <nround_announce+0x2e>
cmp    $0x4f,%r15b
jne    116f <nround_announce+0x4f>
movsbl %r14b,%edx
lea    0xea7(%rip),%rdi
mov    $0x4f,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>
lea    0xebb(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"\0A---- New Round ----\0A\00"
@.str.1 = [28 x i8] c"%c switches stones with %c\0A\00"
@.str.2 = [32 x i8] c"Round stones remain unchanged.\0A\00"
define void @nround_announce(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 79
br i1 %12, label %13, label %41
13: ; preds = %4
%14 = load i8, i8* %5
%15 = sext i8 %14 to i32
%16 = load i8, i8* %6
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %15, %17
br i1 %18, label %19, label %25
19: ; preds = %13
%20 = load i8, i8* %5
%21 = sext i8 %20 to i32
%22 = load i8, i8* %8
%23 = sext i8 %22 to i32
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %21, i32 %23)
br label %40
25: ; preds = %13
%26 = load i8, i8* %5
%27 = sext i8 %26 to i32
%28 = load i8, i8* %7
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %27, %29
br i1 %30, label %31, label %37
31: ; preds = %25
%32 = load i8, i8* %5
%33 = sext i8 %32 to i32
%34 = load i8, i8* %8
%35 = sext i8 %34 to i32
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %33, i32 %35)
br label %39
37: ; preds = %25
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %39
39: ; preds = %37, %31
br label %40
40: ; preds = %39, %19
br label %43
41: ; preds = %4
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %43
43: ; preds = %41, %40
ret void
}

LLVM IR (-O2):
@.str.1 = [28 x i8] c"%c switches stones with %c\0A\00"
@str = [21 x i8] c"\0A---- New Round ----\00"
@str.4 = [31 x i8] c"Round stones remain unchanged.\00"
define void @nround_announce(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%6 = icmp eq i8 %0, 79
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = icmp eq i8 %1, 79
br i1 %8, label %9, label %12
9: ; preds = %7
%10 = sext i8 %3 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 79, i32 %10)
br label %21
12: ; preds = %7
%13 = icmp eq i8 %2, 79
br i1 %13, label %14, label %17
14: ; preds = %12
%15 = sext i8 %3 to i32
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 79, i32 %15)
br label %21
17: ; preds = %12
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.4, i64 0, i64 0))
br label %21
19: ; preds = %4
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.4, i64 0, i64 0))
br label %21
21: ; preds = %9, %17, %14, %19
ret void
}