int gofish(askedfor, player, hand)
int askedfor, player;
int *hand;
{
  printplayer((1 - (player)));
  (void)printf("say \"GO FISH!\"\n");
  if (askedfor == drawcard(player, hand)) {
    printplayer(player);
    (void)printf("drew the guess!\n");
    printplayer(player);
    (void)printf("get to ask again!\n");
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<gofish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%edi
sub    -0xc(%rbp),%edi
mov    $0x0,%al
call   1050 <printplayer@plt>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <drawcard@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jne    11bc <gofish+0x8c>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1050 <printplayer@plt>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1050 <printplayer@plt>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11c3 <gofish+0x93>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gofish>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%ebx
mov    %edi,%r15d
mov    $0x1,%edi
sub    %esi,%edi
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <printplayer@plt>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <drawcard@plt>
cmp    %r15d,%eax
jne    119b <gofish+0x6b>
mov    %ebx,%edi
xor    %eax,%eax
call   1050 <printplayer@plt>
lea    0xe93(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1050 <printplayer@plt>
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"say \22GO FISH!\22\0A\00"
@.str.1 = [17 x i8] c"drew the guess!\0A\00"
@.str.2 = [19 x i8] c"get to ask again!\0A\00"
define i32 @gofish(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%8 = load i32, i32* %6
%9 = sub nsw i32 1, %8
%10 = call i32 (i32, ...) bitcast (i32 (...)* @printplayer to i32 (i32, ...)*)(i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load i32*, i32** %7
%15 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @drawcard to i32 (i32, i32*, ...)*)(i32 %13, i32* %14)
%16 = icmp eq i32 %12, %15
br i1 %16, label %17, label %24
17: ; preds = %3
%18 = load i32, i32* %6
%19 = call i32 (i32, ...) bitcast (i32 (...)* @printplayer to i32 (i32, ...)*)(i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32, i32* %6
%22 = call i32 (i32, ...) bitcast (i32 (...)* @printplayer to i32 (i32, ...)*)(i32 %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %4
br label %25
24: ; preds = %3
store i32 0, i32* %4
br label %25
25: ; preds = %24, %17
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
@str = [15 x i8] c"say \22GO FISH!\22\00"
@str.3 = [16 x i8] c"drew the guess!\00"
@str.4 = [18 x i8] c"get to ask again!\00"
define i32 @gofish(i32 %0, i32 %1, i32* %2) {
%4 = sub nsw i32 1, %1
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @printplayer to i32 (i32, ...)*)(i32 %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 (i32, i32*, ...) bitcast (i32 (...)* @drawcard to i32 (i32, i32*, ...)*)(i32 %1, i32* %2)
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @printplayer to i32 (i32, ...)*)(i32 %1)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.3, i64 0, i64 0))
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @printplayer to i32 (i32, ...)*)(i32 %1)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.4, i64 0, i64 0))
br label %14
14: ; preds = %3, %9
%15 = phi i32 [ 1, %9 ], [ 0, %3 ]
ret i32 %15
}