#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*/ endshake();
int /*<<< orphan*/ init_interrupts();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ report(int);
int /*<<< orphan*/ test_external_clock();
int /*<<< orphan*/ test_interrupts();
int /*<<< orphan*/ test_registers();
int /*<<< orphan*/ test_simple_io();
int main() {
  printf("Starting GPIO test\n");
  init_interrupts();
  test_registers();
  test_simple_io();
  test_interrupts();
  test_external_clock();
  endshake();
  printf("Ending GPIO test\n");
  report(0xdeaddead);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe6a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <init_interrupts@plt>
mov    $0x0,%al
call   1090 <test_registers@plt>
mov    $0x0,%al
call   1050 <test_simple_io@plt>
mov    $0x0,%al
call   1070 <test_interrupts@plt>
mov    $0x0,%al
call   1060 <test_external_clock@plt>
mov    $0x0,%al
call   1030 <endshake@plt>
lea    0xe48(%rip),%rdi
call   1040 <printf@plt>
mov    $0xdeaddead,%edi
call   10a0 <report@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe78(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1080 <init_interrupts@plt>
xor    %eax,%eax
call   1090 <test_registers@plt>
xor    %eax,%eax
call   1050 <test_simple_io@plt>
xor    %eax,%eax
call   1070 <test_interrupts@plt>
xor    %eax,%eax
call   1060 <test_external_clock@plt>
xor    %eax,%eax
call   1030 <endshake@plt>
lea    0xe55(%rip),%rdi
call   1040 <puts@plt>
mov    $0xdeaddead,%edi
call   10a0 <report@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Starting GPIO test\0A\00"
@.str.1 = [18 x i8] c"Ending GPIO test\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @init_interrupts()
%4 = call i32 (...) @test_registers()
%5 = call i32 (...) @test_simple_io()
%6 = call i32 (...) @test_interrupts()
%7 = call i32 (...) @test_external_clock()
%8 = call i32 (...) @endshake()
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @report(i32 -559030611)
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Starting GPIO test\00"
@str.2 = [17 x i8] c"Ending GPIO test\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @init_interrupts()
%3 = tail call i32 (...) @test_registers()
%4 = tail call i32 (...) @test_simple_io()
%5 = tail call i32 (...) @test_interrupts()
%6 = tail call i32 (...) @test_external_clock()
%7 = tail call i32 (...) @endshake()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.2, i64 0, i64 0))
%9 = tail call i32 @report(i32 -559030611)
ret i32 0
}