#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_rangebox(char const *, char *, int, int, int, int, int);
int numeric_arg(char **, int);
int call_rangebox(const char *t, char *av[], int *offset_add) {
  int min_value;
  *offset_add = arg_rest(av);
  min_value = numeric_arg(av, 4);
  return dialog_rangebox(t, av[1], numeric_arg(av, 2), numeric_arg(av, 3),
                         min_value, numeric_arg(av, 5),
                         (*offset_add > 6) ? numeric_arg(av, 6) : min_value);
}


x86 assembly (clang, -O0):
<call_rangebox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <arg_rest@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1050 <numeric_arg@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1050 <numeric_arg@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1050 <numeric_arg@plt>
mov    %eax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
call   1050 <numeric_arg@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x6,(%rax)
jle    11d6 <call_rangebox+0xa6>
mov    -0x10(%rbp),%rdi
mov    $0x6,%esi
call   1050 <numeric_arg@plt>
mov    %eax,-0x44(%rbp)
jmp    11dc <call_rangebox+0xac>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x20(%rbp),%r9d
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%ecx
mov    -0x2c(%rbp),%edx
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <dialog_rangebox@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_rangebox>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%rbp
mov    %rsi,%rbx
mov    %rdi,0x10(%rsp)
mov    %rsi,%rdi
call   1040 <arg_rest@plt>
mov    %eax,0x0(%rbp)
mov    %rbx,%rdi
mov    $0x4,%esi
call   1050 <numeric_arg@plt>
mov    %eax,%r12d
mov    0x8(%rbx),%rax
mov    %rax,0x8(%rsp)
mov    %rbx,%rdi
mov    $0x2,%esi
call   1050 <numeric_arg@plt>
mov    %eax,%r13d
mov    %rbx,%rdi
mov    $0x3,%esi
call   1050 <numeric_arg@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <numeric_arg@plt>
mov    %eax,%r15d
cmpl   $0x7,0x0(%rbp)
mov    %r12d,%eax
jl     11b3 <call_rangebox+0x83>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1050 <numeric_arg@plt>
mov    %eax,(%rsp)
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    %r13d,%edx
mov    %r14d,%ecx
mov    %r12d,%r8d
mov    %r15d,%r9d
call   1030 <dialog_rangebox@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @call_rangebox(i8* %0, i8** %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%8 = load i8**, i8*** %5
%9 = call i32 @arg_rest(i8** %8)
%10 = load i32*, i32** %6
store i32 %9, i32* %10
%11 = load i8**, i8*** %5
%12 = call i32 @numeric_arg(i8** %11, i32 4)
store i32 %12, i32* %7
%13 = load i8*, i8** %4
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = load i8**, i8*** %5
%18 = call i32 @numeric_arg(i8** %17, i32 2)
%19 = load i8**, i8*** %5
%20 = call i32 @numeric_arg(i8** %19, i32 3)
%21 = load i32, i32* %7
%22 = load i8**, i8*** %5
%23 = call i32 @numeric_arg(i8** %22, i32 5)
%24 = load i32*, i32** %6
%25 = load i32, i32* %24
%26 = icmp sgt i32 %25, 6
br i1 %26, label %27, label %30
27: ; preds = %3
%28 = load i8**, i8*** %5
%29 = call i32 @numeric_arg(i8** %28, i32 6)
br label %32
30: ; preds = %3
%31 = load i32, i32* %7
br label %32
32: ; preds = %30, %27
%33 = phi i32 [ %29, %27 ], [ %31, %30 ]
%34 = call i32 @dialog_rangebox(i8* %13, i8* %16, i32 %18, i32 %20, i32 %21, i32 %23, i32 %33)
ret i32 %34
}

LLVM IR (-O2):
define i32 @call_rangebox(i8* %0, i8** %1, i32* nocapture %2) {
%4 = tail call i32 @arg_rest(i8** %1)
store i32 %4, i32* %2
%5 = tail call i32 @numeric_arg(i8** %1, i32 4)
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @numeric_arg(i8** %1, i32 2)
%9 = tail call i32 @numeric_arg(i8** %1, i32 3)
%10 = tail call i32 @numeric_arg(i8** %1, i32 5)
%11 = load i32, i32* %2
%12 = icmp sgt i32 %11, 6
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = tail call i32 @numeric_arg(i8** %1, i32 6)
br label %15
15: ; preds = %3, %13
%16 = phi i32 [ %14, %13 ], [ %5, %3 ]
%17 = tail call i32 @dialog_rangebox(i8* %0, i8* %7, i32 %8, i32 %9, i32 %5, i32 %10, i32 %16)
ret i32 %17
}