#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*/ fprintf(int /*<<< orphan*/, char *, int);
int reg_read(int);
int /*<<< orphan*/ stderr;
void __attribute__((unused)) dump(void) {
  fprintf(stderr, "GPIOCN %02x\n", reg_read(0xe2));
  fprintf(stderr, "  P0      %02x\n", reg_read(0x80));
  fprintf(stderr, "  P0MDOUT %02x\n", reg_read(0xa4));
  fprintf(stderr, "  P2      %02x\n", reg_read(0xa0));
  fprintf(stderr, "  P2MDOUT %02x\n", reg_read(0xa6));
}


x86 assembly (clang, -O0):
<dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    $0xe2,%edi
call   1030 <reg_read@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%edx
lea    0xeb6(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    $0x80,%edi
call   1030 <reg_read@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%edx
lea    0xe9c(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0xa4,%edi
call   1030 <reg_read@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%edx
lea    0xe85(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0xa0,%edi
call   1030 <reg_read@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%edx
lea    0xe6e(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e15(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0xa6,%edi
call   1030 <reg_read@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%edx
lea    0xe57(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump>:
push   %r14
push   %rbx
push   %rax
mov    0x2eb5(%rip),%r14
mov    (%r14),%ebx
mov    $0xe2,%edi
call   1030 <reg_read@plt>
lea    0xec1(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
call   1040 <fprintf@plt>
mov    (%r14),%ebx
mov    $0x80,%edi
call   1030 <reg_read@plt>
lea    0xeb1(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
call   1040 <fprintf@plt>
mov    (%r14),%ebx
mov    $0xa4,%edi
call   1030 <reg_read@plt>
lea    0xea4(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
call   1040 <fprintf@plt>
mov    (%r14),%ebx
mov    $0xa0,%edi
call   1030 <reg_read@plt>
lea    0xe97(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
call   1040 <fprintf@plt>
mov    (%r14),%ebx
mov    $0xa6,%edi
call   1030 <reg_read@plt>
lea    0xe8a(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"GPIOCN %02x\0A\00"
@.str.1 = [16 x i8] c" P0 %02x\0A\00"
@.str.2 = [16 x i8] c" P0MDOUT %02x\0A\00"
@.str.3 = [16 x i8] c" P2 %02x\0A\00"
@.str.4 = [16 x i8] c" P2MDOUT %02x\0A\00"
define void @dump() {
%1 = load i32, i32* @stderr
%2 = call i32 @reg_read(i32 226)
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @stderr
%5 = call i32 @reg_read(i32 128)
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @stderr
%8 = call i32 @reg_read(i32 164)
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @stderr
%11 = call i32 @reg_read(i32 160)
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @stderr
%14 = call i32 @reg_read(i32 166)
%15 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %14)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"GPIOCN %02x\0A\00"
@.str.1 = [16 x i8] c" P0 %02x\0A\00"
@.str.2 = [16 x i8] c" P0MDOUT %02x\0A\00"
@.str.3 = [16 x i8] c" P2 %02x\0A\00"
@.str.4 = [16 x i8] c" P2MDOUT %02x\0A\00"
define void @dump() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @reg_read(i32 226)
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @reg_read(i32 128)
%6 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @stderr
%8 = tail call i32 @reg_read(i32 164)
%9 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @stderr
%11 = tail call i32 @reg_read(i32 160)
%12 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @stderr
%14 = tail call i32 @reg_read(i32 166)
%15 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %14)
ret void
}