#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*/ HAL_Delay(int);
int /*<<< orphan*/ HAL_Init();
int /*<<< orphan*/ LED_init();
int /*<<< orphan*/ LED_toggle(int);
int /*<<< orphan*/ SystemClock_Config();
int /*<<< orphan*/ TIMER4_init();
int /*<<< orphan*/ UART_init();
int /*<<< orphan*/ printf(char *);
int main(void) {
  HAL_Init();
  SystemClock_Config();
  LED_init();
  TIMER4_init();
  UART_init();
  printf("I'm alive\n");
  while (1) {
    printf("wawawa\n");
    HAL_Delay(125);
    LED_toggle(1);
    HAL_Delay(125);
    LED_toggle(1);
    LED_toggle(2);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <HAL_Init@plt>
mov    $0x0,%al
call   1030 <SystemClock_Config@plt>
mov    $0x0,%al
call   1090 <LED_init@plt>
mov    $0x0,%al
call   1080 <TIMER4_init@plt>
mov    $0x0,%al
call   1050 <UART_init@plt>
lea    0xe47(%rip),%rdi
call   1060 <printf@plt>
lea    0xe46(%rip),%rdi
call   1060 <printf@plt>
mov    $0x7d,%edi
call   1040 <HAL_Delay@plt>
mov    $0x1,%edi
call   10a0 <LED_toggle@plt>
mov    $0x7d,%edi
call   1040 <HAL_Delay@plt>
mov    $0x1,%edi
call   10a0 <LED_toggle@plt>
mov    $0x2,%edi
call   10a0 <LED_toggle@plt>
jmp    11be <main+0x3e>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1070 <HAL_Init@plt>
xor    %eax,%eax
call   1040 <SystemClock_Config@plt>
xor    %eax,%eax
call   1090 <LED_init@plt>
xor    %eax,%eax
call   1080 <TIMER4_init@plt>
xor    %eax,%eax
call   1060 <UART_init@plt>
lea    0xe55(%rip),%rdi
call   1030 <puts@plt>
lea    0xe53(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x7d,%edi
call   1050 <HAL_Delay@plt>
mov    $0x1,%edi
call   10a0 <LED_toggle@plt>
mov    $0x7d,%edi
call   1050 <HAL_Delay@plt>
mov    $0x1,%edi
call   10a0 <LED_toggle@plt>
mov    $0x2,%edi
call   10a0 <LED_toggle@plt>
jmp    11c0 <main+0x40>

LLVM IR (-O0):
@.str = [11 x i8] c"I'm alive\0A\00"
@.str.1 = [8 x i8] c"wawawa\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @HAL_Init()
%3 = call i32 (...) @SystemClock_Config()
%4 = call i32 (...) @LED_init()
%5 = call i32 (...) @TIMER4_init()
%6 = call i32 (...) @UART_init()
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %0, %8
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @HAL_Delay(i32 125)
%11 = call i32 @LED_toggle(i32 1)
%12 = call i32 @HAL_Delay(i32 125)
%13 = call i32 @LED_toggle(i32 1)
%14 = call i32 @LED_toggle(i32 2)
br label %8
}

LLVM IR (-O2):
@str = [10 x i8] c"I'm alive\00"
@str.2 = [7 x i8] c"wawawa\00"
define i32 @main() {
%1 = tail call i32 (...) @HAL_Init()
%2 = tail call i32 (...) @SystemClock_Config()
%3 = tail call i32 (...) @LED_init()
%4 = tail call i32 (...) @TIMER4_init()
%5 = tail call i32 (...) @UART_init()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %0, %7
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0))
%9 = tail call i32 @HAL_Delay(i32 125)
%10 = tail call i32 @LED_toggle(i32 1)
%11 = tail call i32 @HAL_Delay(i32 125)
%12 = tail call i32 @LED_toggle(i32 1)
%13 = tail call i32 @LED_toggle(i32 2)
br label %7
}