#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*/ add_item_to_menu(int, int, char *, int);
void add_items_to_menu() {
  add_item_to_menu(0, 1, (char *)"View", 2);
  add_item_to_menu(1, 1, (char *)"Adjust", 3);
  add_item_to_menu(2, 1, (char *)"Clock", 4);
  add_item_to_menu(0, 2, (char *)"SetPoint", -1);
  add_item_to_menu(1, 2, (char *)"Actual", -1);
  add_item_to_menu(2, 2, (char *)"Back", 1);
  add_item_to_menu(0, 3, (char *)"Adj. SetPoint", -1);
  add_item_to_menu(1, 3, (char *)"Adj. Actual", -1);
  add_item_to_menu(2, 3, (char *)"Back", 1);
  add_item_to_menu(0, 4, (char *)"Adjust clock", -1);
  add_item_to_menu(1, 4, (char *)"Back", 1);
}


x86 assembly (clang, -O0):
<add_items_to_menu>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
lea    0xede(%rip),%rdx
mov    $0x2,%ecx
call   1030 <add_item_to_menu@plt>
mov    $0x1,%esi
lea    0xecd(%rip),%rdx
mov    $0x3,%ecx
mov    %esi,%edi
call   1030 <add_item_to_menu@plt>
mov    $0x2,%edi
mov    $0x1,%esi
lea    0xeb7(%rip),%rdx
mov    $0x4,%ecx
call   1030 <add_item_to_menu@plt>
xor    %edi,%edi
mov    $0x2,%esi
lea    0xeaf(%rip),%rdx
mov    $0xffffffff,%ecx
call   1030 <add_item_to_menu@plt>
mov    $0x1,%edi
mov    $0x2,%esi
lea    0xea2(%rip),%rdx
mov    $0xffffffff,%ecx
call   1030 <add_item_to_menu@plt>
mov    $0x2,%esi
lea    0xe74(%rip),%rdx
mov    $0x1,%ecx
mov    %esi,%edi
call   1030 <add_item_to_menu@plt>
xor    %edi,%edi
mov    $0x3,%esi
lea    0xe5f(%rip),%rdx
mov    $0xffffffff,%ecx
call   1030 <add_item_to_menu@plt>
mov    $0x1,%edi
mov    $0x3,%esi
lea    0xe52(%rip),%rdx
mov    $0xffffffff,%ecx
call   1030 <add_item_to_menu@plt>
mov    $0x2,%edi
mov    $0x3,%esi
lea    0xe24(%rip),%rdx
mov    $0x1,%ecx
call   1030 <add_item_to_menu@plt>
xor    %edi,%edi
mov    $0x4,%esi
lea    0xe2b(%rip),%rdx
mov    $0xffffffff,%ecx
call   1030 <add_item_to_menu@plt>
mov    $0x1,%ecx
mov    $0x4,%esi
lea    0xdf1(%rip),%rdx
mov    %ecx,%edi
call   1030 <add_item_to_menu@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_items_to_menu>:
push   %rbx
lea    0xee8(%rip),%rdx
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%ecx
call   1030 <add_item_to_menu@plt>
lea    0xed5(%rip),%rdx
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x3,%ecx
call   1030 <add_item_to_menu@plt>
lea    0xec1(%rip),%rdx
mov    $0x2,%edi
mov    $0x1,%esi
mov    $0x4,%ecx
call   1030 <add_item_to_menu@plt>
lea    0xeb6(%rip),%rdx
xor    %edi,%edi
mov    $0x2,%esi
mov    $0xffffffff,%ecx
call   1030 <add_item_to_menu@plt>
lea    0xeac(%rip),%rdx
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0xffffffff,%ecx
call   1030 <add_item_to_menu@plt>
lea    0xe79(%rip),%rbx
mov    $0x2,%edi
mov    $0x2,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
call   1030 <add_item_to_menu@plt>
lea    0xe60(%rip),%rdx
xor    %edi,%edi
mov    $0x3,%esi
mov    $0xffffffff,%ecx
call   1030 <add_item_to_menu@plt>
lea    0xe56(%rip),%rdx
mov    $0x1,%edi
mov    $0x3,%esi
mov    $0xffffffff,%ecx
call   1030 <add_item_to_menu@plt>
mov    $0x2,%edi
mov    $0x3,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
call   1030 <add_item_to_menu@plt>
lea    0xe30(%rip),%rdx
xor    %edi,%edi
mov    $0x4,%esi
mov    $0xffffffff,%ecx
call   1030 <add_item_to_menu@plt>
mov    $0x1,%edi
mov    $0x4,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
pop    %rbx
jmp    1030 <add_item_to_menu@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"View\00"
@.str.1 = [7 x i8] c"Adjust\00"
@.str.2 = [6 x i8] c"Clock\00"
@.str.3 = [9 x i8] c"SetPoint\00"
@.str.4 = [7 x i8] c"Actual\00"
@.str.5 = [5 x i8] c"Back\00"
@.str.6 = [14 x i8] c"Adj. SetPoint\00"
@.str.7 = [12 x i8] c"Adj. Actual\00"
@.str.8 = [13 x i8] c"Adjust clock\00"
define void @add_items_to_menu() {
%1 = call i32 @add_item_to_menu(i32 0, i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = call i32 @add_item_to_menu(i32 1, i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 3)
%3 = call i32 @add_item_to_menu(i32 2, i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 4)
%4 = call i32 @add_item_to_menu(i32 0, i32 2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 -1)
%5 = call i32 @add_item_to_menu(i32 1, i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 -1)
%6 = call i32 @add_item_to_menu(i32 2, i32 2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 1)
%7 = call i32 @add_item_to_menu(i32 0, i32 3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 -1)
%8 = call i32 @add_item_to_menu(i32 1, i32 3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 -1)
%9 = call i32 @add_item_to_menu(i32 2, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 1)
%10 = call i32 @add_item_to_menu(i32 0, i32 4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 -1)
%11 = call i32 @add_item_to_menu(i32 1, i32 4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"View\00"
@.str.1 = [7 x i8] c"Adjust\00"
@.str.2 = [6 x i8] c"Clock\00"
@.str.3 = [9 x i8] c"SetPoint\00"
@.str.4 = [7 x i8] c"Actual\00"
@.str.5 = [5 x i8] c"Back\00"
@.str.6 = [14 x i8] c"Adj. SetPoint\00"
@.str.7 = [12 x i8] c"Adj. Actual\00"
@.str.8 = [13 x i8] c"Adjust clock\00"
define void @add_items_to_menu() {
%1 = tail call i32 @add_item_to_menu(i32 0, i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @add_item_to_menu(i32 1, i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 3)
%3 = tail call i32 @add_item_to_menu(i32 2, i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 4)
%4 = tail call i32 @add_item_to_menu(i32 0, i32 2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 -1)
%5 = tail call i32 @add_item_to_menu(i32 1, i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 -1)
%6 = tail call i32 @add_item_to_menu(i32 2, i32 2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 1)
%7 = tail call i32 @add_item_to_menu(i32 0, i32 3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 -1)
%8 = tail call i32 @add_item_to_menu(i32 1, i32 3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 -1)
%9 = tail call i32 @add_item_to_menu(i32 2, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 1)
%10 = tail call i32 @add_item_to_menu(i32 0, i32 4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 -1)
%11 = tail call i32 @add_item_to_menu(i32 1, i32 4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 1)
ret void
}