#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 game {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ output(struct game const *);
int player2symbol(char const);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdout;
int get_move(const struct game *g, const char player) {
  output(g);
  printf("Zug für Spieler '%c'?: ", player2symbol(player));
  fflush(stdout);
  int move = -1;
  scanf("%d", &move);
  return move;
}


x86 assembly (clang, -O0):
<get_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <output@plt>
movsbl -0x9(%rbp),%edi
call   1050 <player2symbol@plt>
mov    %eax,%esi
lea    0xe83(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
movl   $0xffffffff,-0x10(%rbp)
lea    0xe7b(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_move>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
call   1030 <output@plt>
mov    %ebx,%edi
call   1050 <player2symbol@plt>
lea    0xe96(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
movl   $0xffffffff,0xc(%rsp)
ff
lea    0xe8b(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.game = type { i32 }
@.str = [25 x i8] c"Zug f\C3\BCr Spieler '%c'?: \00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%d\00"
define i32 @get_move(%struct.game* %0, i8 signext %1) {
%3 = alloca %struct.game*
%4 = alloca i8
%5 = alloca i32
store %struct.game* %0, %struct.game** %3
store i8 %1, i8* %4
%6 = load %struct.game*, %struct.game** %3
%7 = call i32 @output(%struct.game* %6)
%8 = load i8, i8* %4
%9 = call i32 @player2symbol(i8 signext %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @stdout
%12 = call i32 @fflush(i32 %11)
store i32 -1, i32* %5
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
%struct.game = type { i32 }
@.str = [25 x i8] c"Zug f\C3\BCr Spieler '%c'?: \00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%d\00"
define i32 @get_move(%struct.game* %0, i8 signext %1) {
%3 = alloca i32
%4 = tail call i32 @output(%struct.game* %0)
%5 = tail call i32 @player2symbol(i8 signext %1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fflush(i32 %7)
%9 = bitcast i32* %3 to i8*
store i32 -1, i32* %3
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = load i32, i32* %3
ret i32 %11
}