#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*/ exit(int);
scalar_t__ graphicsinit(int, char **);
scalar_t__ keyinit();
int /*<<< orphan*/ printf(char *);
void inithardware(int argc, char **argv) {
  if (graphicsinit(argc, argv))
    exit(-1);
  if (keyinit()) {
    printf("Could not initialize the keyboard.\n");
    exit(-1);
  }
  printf("Keyboard initialized.\n");
}


x86 assembly (clang, -O0):
<inithardware>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <graphicsinit@plt>
cmp    $0x0,%rax
je     116f <inithardware+0x2f>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    $0x0,%al
call   1060 <keyinit@plt>
cmp    $0x0,%rax
je     1196 <inithardware+0x56>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inithardware>:
push   %rax
call   1040 <graphicsinit@plt>
test   %rax,%rax
jne    1164 <inithardware+0x24>
xor    %eax,%eax
call   1060 <keyinit@plt>
test   %rax,%rax
jne    116e <inithardware+0x2e>
lea    0xea2(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Could not initialize the keyboard.\0A\00"
@.str.1 = [23 x i8] c"Keyboard initialized.\0A\00"
define void @inithardware(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i64 @graphicsinit(i32 %5, i8** %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %2
%12 = call i64 (...) @keyinit()
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 -1)
unreachable
17: ; preds = %11
%18 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"Keyboard initialized.\00"
@str.2 = [35 x i8] c"Could not initialize the keyboard.\00"
define void @inithardware(i32 %0, i8** %1) {
%3 = tail call i64 @graphicsinit(i32 %0, i8** %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %2
%8 = tail call i64 (...) @keyinit()
%9 = icmp eq i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.2, i64 0, i64 0))
%12 = tail call i32 @exit(i32 -1)
unreachable
13: ; preds = %7
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}