#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*/ cng_clear_screen();
int /*<<< orphan*/ cng_close_font();
int /*<<< orphan*/ cng_current_color_index(int);
int /*<<< orphan*/ cng_draw_string(char *, int, int);
int /*<<< orphan*/ cng_open_font(char *);
void menu() {
  cng_current_color_index(255);
  cng_clear_screen();
  cng_current_color_index(1);
  cng_open_font("font1");
  cng_draw_string("MENU", 20, 10);
  cng_close_font();
  cng_open_font("font2");
  cng_draw_string("[a] association d'une touche", 20, 50);
  cng_draw_string("[b] palette du feu", 20, 65);
  cng_draw_string("[c] animation tres simple", 20, 80);
  cng_draw_string(
      "Evenements pris en compte : bouton 0 et deplacement de la souris", 20,
      110);
  cng_draw_string("[ESC] Quitter", 20, 140);
  cng_close_font();
}


x86 assembly (clang, -O0):
<menu>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff,%edi
call   1030 <cng_current_color_index@plt>
mov    $0x0,%al
call   1040 <cng_clear_screen@plt>
mov    $0x1,%edi
call   1030 <cng_current_color_index@plt>
lea    0xe8a(%rip),%rdi
call   1060 <cng_open_font@plt>
lea    0xe84(%rip),%rdi
mov    $0x14,%esi
mov    $0xa,%edx
call   1070 <cng_draw_string@plt>
mov    $0x0,%al
call   1050 <cng_close_font@plt>
lea    0xe6c(%rip),%rdi
call   1060 <cng_open_font@plt>
lea    0xe66(%rip),%rdi
mov    $0x14,%esi
mov    $0x32,%edx
call   1070 <cng_draw_string@plt>
lea    0xe6d(%rip),%rdi
mov    $0x14,%esi
mov    $0x41,%edx
call   1070 <cng_draw_string@plt>
lea    0xe6a(%rip),%rdi
mov    $0x14,%esi
mov    $0x50,%edx
call   1070 <cng_draw_string@plt>
lea    0xe6e(%rip),%rdi
mov    $0x14,%esi
mov    $0x6e,%edx
call   1070 <cng_draw_string@plt>
lea    0xe99(%rip),%rdi
mov    $0x14,%esi
mov    $0x8c,%edx
call   1070 <cng_draw_string@plt>
mov    $0x0,%al
call   1050 <cng_close_font@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu>:
push   %rax
mov    $0xff,%edi
call   1030 <cng_current_color_index@plt>
xor    %eax,%eax
call   1040 <cng_clear_screen@plt>
mov    $0x1,%edi
call   1030 <cng_current_color_index@plt>
lea    0xe8d(%rip),%rdi
call   1060 <cng_open_font@plt>
lea    0xe87(%rip),%rdi
mov    $0x14,%esi
mov    $0xa,%edx
call   1070 <cng_draw_string@plt>
xor    %eax,%eax
call   1050 <cng_close_font@plt>
lea    0xe6f(%rip),%rdi
call   1060 <cng_open_font@plt>
lea    0xe69(%rip),%rdi
mov    $0x14,%esi
mov    $0x32,%edx
call   1070 <cng_draw_string@plt>
lea    0xe70(%rip),%rdi
mov    $0x14,%esi
mov    $0x41,%edx
call   1070 <cng_draw_string@plt>
lea    0xe6d(%rip),%rdi
mov    $0x14,%esi
mov    $0x50,%edx
call   1070 <cng_draw_string@plt>
lea    0xe71(%rip),%rdi
mov    $0x14,%esi
mov    $0x6e,%edx
call   1070 <cng_draw_string@plt>
lea    0xe9c(%rip),%rdi
mov    $0x14,%esi
mov    $0x8c,%edx
call   1070 <cng_draw_string@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cng_close_font@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"font1\00"
@.str.1 = [5 x i8] c"MENU\00"
@.str.2 = [6 x i8] c"font2\00"
@.str.3 = [29 x i8] c"[a] association d'une touche\00"
@.str.4 = [19 x i8] c"[b] palette du feu\00"
@.str.5 = [26 x i8] c"[c] animation tres simple\00"
@.str.6 = [65 x i8] c"Evenements pris en compte : bouton 0 et deplacement de la souris\00"
@.str.7 = [14 x i8] c"[ESC] Quitter\00"
define void @menu() {
%1 = call i32 @cng_current_color_index(i32 255)
%2 = call i32 (...) @cng_clear_screen()
%3 = call i32 @cng_current_color_index(i32 1)
%4 = call i32 @cng_open_font(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @cng_draw_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 20, i32 10)
%6 = call i32 (...) @cng_close_font()
%7 = call i32 @cng_open_font(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @cng_draw_string(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 20, i32 50)
%9 = call i32 @cng_draw_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 20, i32 65)
%10 = call i32 @cng_draw_string(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 20, i32 80)
%11 = call i32 @cng_draw_string(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.6, i64 0, i64 0), i32 20, i32 110)
%12 = call i32 @cng_draw_string(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 20, i32 140)
%13 = call i32 (...) @cng_close_font()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"font1\00"
@.str.1 = [5 x i8] c"MENU\00"
@.str.2 = [6 x i8] c"font2\00"
@.str.3 = [29 x i8] c"[a] association d'une touche\00"
@.str.4 = [19 x i8] c"[b] palette du feu\00"
@.str.5 = [26 x i8] c"[c] animation tres simple\00"
@.str.6 = [65 x i8] c"Evenements pris en compte : bouton 0 et deplacement de la souris\00"
@.str.7 = [14 x i8] c"[ESC] Quitter\00"
define void @menu() {
%1 = tail call i32 @cng_current_color_index(i32 255)
%2 = tail call i32 (...) @cng_clear_screen()
%3 = tail call i32 @cng_current_color_index(i32 1)
%4 = tail call i32 @cng_open_font(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @cng_draw_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 20, i32 10)
%6 = tail call i32 (...) @cng_close_font()
%7 = tail call i32 @cng_open_font(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @cng_draw_string(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 20, i32 50)
%9 = tail call i32 @cng_draw_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 20, i32 65)
%10 = tail call i32 @cng_draw_string(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 20, i32 80)
%11 = tail call i32 @cng_draw_string(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.6, i64 0, i64 0), i32 20, i32 110)
%12 = tail call i32 @cng_draw_string(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 20, i32 140)
%13 = tail call i32 (...) @cng_close_font()
ret void
}