#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*/ data_getcards(int, int);
int /*<<< orphan*/ devcards_remaining();
int /*<<< orphan*/ io_printcards(int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/, int);
void devcards_refresh(int p, int pos) {
  io_printcards(devcards_remaining(), data_getcards(p, 0), data_getcards(p, 1),
                data_getcards(p, 2), data_getcards(p, 3), data_getcards(p, 4),
                pos);
}


x86 assembly (clang, -O0):
<devcards_refresh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <devcards_remaining@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <data_getcards@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <data_getcards@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1030 <data_getcards@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3,%esi
call   1030 <data_getcards@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1030 <data_getcards@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    %eax,%r9d
mov    -0x8(%rbp),%eax
mov    %eax,(%rsp)
call   1040 <io_printcards@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<devcards_refresh>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %esi,0x14(%rsp)
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <devcards_remaining@plt>
mov    %eax,%r15d
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <data_getcards@plt>
mov    %eax,%r12d
mov    %ebx,%edi
mov    $0x1,%esi
call   1030 <data_getcards@plt>
mov    %eax,%r13d
mov    %ebx,%edi
mov    $0x2,%esi
call   1030 <data_getcards@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x3,%esi
call   1030 <data_getcards@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0x4,%esi
call   1030 <data_getcards@plt>
mov    0x14(%rsp),%ecx
mov    %ecx,(%rsp)
mov    %r15d,%edi
mov    %r12d,%esi
mov    %r13d,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
mov    %eax,%r9d
call   1040 <io_printcards@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @devcards_refresh(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @devcards_remaining()
%6 = load i32, i32* %3
%7 = call i32 @data_getcards(i32 %6, i32 0)
%8 = load i32, i32* %3
%9 = call i32 @data_getcards(i32 %8, i32 1)
%10 = load i32, i32* %3
%11 = call i32 @data_getcards(i32 %10, i32 2)
%12 = load i32, i32* %3
%13 = call i32 @data_getcards(i32 %12, i32 3)
%14 = load i32, i32* %3
%15 = call i32 @data_getcards(i32 %14, i32 4)
%16 = load i32, i32* %4
%17 = call i32 @io_printcards(i32 %5, i32 %7, i32 %9, i32 %11, i32 %13, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @devcards_refresh(i32 %0, i32 %1) {
%3 = tail call i32 (...) @devcards_remaining()
%4 = tail call i32 @data_getcards(i32 %0, i32 0)
%5 = tail call i32 @data_getcards(i32 %0, i32 1)
%6 = tail call i32 @data_getcards(i32 %0, i32 2)
%7 = tail call i32 @data_getcards(i32 %0, i32 3)
%8 = tail call i32 @data_getcards(i32 %0, i32 4)
%9 = tail call i32 @io_printcards(i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %1)
ret void
}