#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 arg_rest(char **);
int dialog_inputbox(char const *, char *, int /*<<< orphan*/,
                    int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ numeric_arg(char **, int);
int /*<<< orphan*/ optional_str(char **, int, int /*<<< orphan*/);
int call_inputbox(const char *t, char *av[], int *offset_add) {
  *offset_add = arg_rest(av);
  return dialog_inputbox(t, av[1], numeric_arg(av, 2), numeric_arg(av, 3),
                         optional_str(av, 4, 0), 0);
}


x86 assembly (clang, -O0):
<call_inputbox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <arg_rest@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1060 <numeric_arg@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1060 <numeric_arg@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <optional_str@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    %eax,%r8d
xor    %r9d,%r9d
call   1040 <dialog_inputbox@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_inputbox>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <arg_rest@plt>
mov    %eax,(%r15)
mov    0x8(%rbx),%r15
mov    %rbx,%rdi
mov    $0x2,%esi
call   1060 <numeric_arg@plt>
mov    %eax,%r12d
mov    %rbx,%rdi
mov    $0x3,%esi
call   1060 <numeric_arg@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <optional_str@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12d,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
xor    %r9d,%r9d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <dialog_inputbox@plt>

LLVM IR (-O0):
define i32 @call_inputbox(i8* %0, i8** %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%7 = load i8**, i8*** %5
%8 = call i32 @arg_rest(i8** %7)
%9 = load i32*, i32** %6
store i32 %8, i32* %9
%10 = load i8*, i8** %4
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = call i32 @numeric_arg(i8** %14, i32 2)
%16 = load i8**, i8*** %5
%17 = call i32 @numeric_arg(i8** %16, i32 3)
%18 = load i8**, i8*** %5
%19 = call i32 @optional_str(i8** %18, i32 4, i32 0)
%20 = call i32 @dialog_inputbox(i8* %10, i8* %13, i32 %15, i32 %17, i32 %19, i32 0)
ret i32 %20
}

LLVM IR (-O2):
define i32 @call_inputbox(i8* %0, i8** %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @arg_rest(i8** %1)
store i32 %4, i32* %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @numeric_arg(i8** %1, i32 2)
%8 = tail call i32 @numeric_arg(i8** %1, i32 3)
%9 = tail call i32 @optional_str(i8** %1, i32 4, i32 0)
%10 = tail call i32 @dialog_inputbox(i8* %0, i8* %6, i32 %7, i32 %8, i32 %9, i32 0)
ret i32 %10
}