#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*/ atoi(char const *const);
int dialog_menu(char const *, char const *const, int /*<<< orphan*/,
                int /*<<< orphan*/, int /*<<< orphan*/, char const *const, int,
                char const *const *);
int j_menu(const char *t, int ac, const char *const *av) {
  return dialog_menu(t, av[2], atoi(av[3]), atoi(av[4]), atoi(av[5]), av[6],
                     (ac - 6) / 2, av + 7);
}


x86 assembly (clang, -O0):
<j_menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    0x28(%rax),%rdi
call   1040 <atoi@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%ecx
mov    %eax,%r8d
mov    -0x18(%rbp),%rax
mov    0x30(%rax),%r9
mov    -0xc(%rbp),%eax
sub    $0x6,%eax
mov    $0x2,%r10d
cltd
idiv   %r10d
mov    -0x1c(%rbp),%edx
mov    %eax,%r10d
mov    -0x18(%rbp),%rax
add    $0x38,%rax
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <dialog_menu@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_menu>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%r12d
mov    %rdi,(%rsp)
mov    0x10(%rdx),%r15
mov    0x18(%rdx),%rdi
call   1040 <atoi@plt>
mov    %eax,%r13d
mov    0x20(%rbx),%rdi
call   1040 <atoi@plt>
mov    %eax,%r14d
mov    0x28(%rbx),%rdi
call   1040 <atoi@plt>
mov    0x30(%rbx),%r9
mov    %r12d,%ecx
add    $0xfffffffa,%ecx
shr    $0x1f,%ecx
lea    (%r12,%rcx,1),%ebp
add    $0xfffffffa,%ebp
sar    %ebp
add    $0x38,%rbx
mov    (%rsp),%rdi
mov    %r15,%rsi
mov    %r13d,%edx
mov    %r14d,%ecx
mov    %eax,%r8d
push   %rbx
push   %rbp
call   1030 <dialog_menu@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @j_menu(i8* %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %6
%9 = getelementptr inbounds i8*, i8** %8, i64 2
%10 = load i8*, i8** %9
%11 = load i8**, i8*** %6
%12 = getelementptr inbounds i8*, i8** %11, i64 3
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
%15 = load i8**, i8*** %6
%16 = getelementptr inbounds i8*, i8** %15, i64 4
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
%19 = load i8**, i8*** %6
%20 = getelementptr inbounds i8*, i8** %19, i64 5
%21 = load i8*, i8** %20
%22 = call i32 @atoi(i8* %21)
%23 = load i8**, i8*** %6
%24 = getelementptr inbounds i8*, i8** %23, i64 6
%25 = load i8*, i8** %24
%26 = load i32, i32* %5
%27 = sub nsw i32 %26, 6
%28 = sdiv i32 %27, 2
%29 = load i8**, i8*** %6
%30 = getelementptr inbounds i8*, i8** %29, i64 7
%31 = call i32 @dialog_menu(i8* %7, i8* %10, i32 %14, i32 %18, i32 %22, i8* %25, i32 %28, i8** %30)
ret i32 %31
}

LLVM IR (-O2):
define i32 @j_menu(i8* %0, i32 %1, i8** %2) {
%4 = getelementptr inbounds i8*, i8** %2, i64 2
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8*, i8** %2, i64 3
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = getelementptr inbounds i8*, i8** %2, i64 4
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = getelementptr inbounds i8*, i8** %2, i64 5
%13 = load i8*, i8** %12
%14 = tail call i32 @atoi(i8* %13)
%15 = getelementptr inbounds i8*, i8** %2, i64 6
%16 = load i8*, i8** %15
%17 = add nsw i32 %1, -6
%18 = sdiv i32 %17, 2
%19 = getelementptr inbounds i8*, i8** %2, i64 7
%20 = tail call i32 @dialog_menu(i8* %0, i8* %5, i32 %8, i32 %11, i32 %14, i8* %16, i32 %18, i8** %19)
ret i32 %20
}