#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*/ SPI_init(int /*<<< orphan*/);
int /*<<< orphan*/ SSD1339_init();
int /*<<< orphan*/ gpio_function(int, int /*<<< orphan*/);
int /*<<< orphan*/ gpio_init();
int /*<<< orphan*/ printf(char *);
void oled_init(void) {
  gpio_init();
  gpio_function(42, 0);
  gpio_function(45, 0);
  gpio_function(43, 0);
  printf("gpios ok\n");
  SPI_init(0);
  printf("spi ok\n");
  SSD1339_init();
  printf("ssd1339 up, oled ready\n");
}


x86 assembly (clang, -O0):
<oled_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <gpio_init@plt>
mov    $0x2a,%edi
xor    %esi,%esi
call   1030 <gpio_function@plt>
mov    $0x2d,%edi
xor    %esi,%esi
call   1030 <gpio_function@plt>
mov    $0x2b,%edi
xor    %esi,%esi
call   1030 <gpio_function@plt>
lea    0xe7a(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <SPI_init@plt>
lea    0xe71(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <SSD1339_init@plt>
lea    0xe66(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<oled_init>:
push   %rax
xor    %eax,%eax
call   1060 <gpio_init@plt>
mov    $0x2a,%edi
xor    %esi,%esi
call   1030 <gpio_function@plt>
mov    $0x2d,%edi
xor    %esi,%esi
call   1030 <gpio_function@plt>
mov    $0x2b,%edi
xor    %esi,%esi
call   1030 <gpio_function@plt>
lea    0xe7d(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1070 <SPI_init@plt>
lea    0xe73(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <SSD1339_init@plt>
lea    0xe67(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"gpios ok\0A\00"
@.str.1 = [8 x i8] c"spi ok\0A\00"
@.str.2 = [24 x i8] c"ssd1339 up, oled ready\0A\00"
define void @oled_init() {
%1 = call i32 (...) @gpio_init()
%2 = call i32 @gpio_function(i32 42, i32 0)
%3 = call i32 @gpio_function(i32 45, i32 0)
%4 = call i32 @gpio_function(i32 43, i32 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @SPI_init(i32 0)
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (...) @SSD1339_init()
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"gpios ok\00"
@str.3 = [7 x i8] c"spi ok\00"
@str.4 = [23 x i8] c"ssd1339 up, oled ready\00"
define void @oled_init() {
%1 = tail call i32 (...) @gpio_init()
%2 = tail call i32 @gpio_function(i32 42, i32 0)
%3 = tail call i32 @gpio_function(i32 45, i32 0)
%4 = tail call i32 @gpio_function(i32 43, i32 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @SPI_init(i32 0)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.3, i64 0, i64 0))
%8 = tail call i32 (...) @SSD1339_init()
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.4, i64 0, i64 0))
ret void
}