#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_progressbox(char const *, char *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ numeric_arg(char **, int);
int call_progressbox(const char *t, char *av[], int *offset_add) {
  *offset_add = arg_rest(av);
  return (
      (*offset_add == 4)
          ? dialog_progressbox(t, av[1], numeric_arg(av, 2), numeric_arg(av, 3))
          : dialog_progressbox(t, "", numeric_arg(av, 1), numeric_arg(av, 2)));
}


x86 assembly (clang, -O0):
<call_progressbox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <arg_rest@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
cmpl   $0x4,(%rax)
jne    11af <call_progressbox+0x7f>
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   1050 <numeric_arg@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1050 <numeric_arg@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    %eax,%ecx
call   1040 <dialog_progressbox@plt>
mov    %eax,-0x1c(%rbp)
jmp    11ee <call_progressbox+0xbe>
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1050 <numeric_arg@plt>
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1050 <numeric_arg@plt>
mov    -0x40(%rbp),%rdi
mov    -0x34(%rbp),%edx
mov    %eax,%ecx
lea    0xe1a(%rip),%rsi
call   1040 <dialog_progressbox@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_progressbox>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%rbp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <arg_rest@plt>
mov    %eax,0x0(%rbp)
cmp    $0x4,%eax
jne    1162 <call_progressbox+0x32>
mov    0x8(%rbx),%r15
mov    $0x3,%r12d
mov    $0x2,%esi
jmp    1174 <call_progressbox+0x44>
lea    0xe97(%rip),%r15
mov    $0x2,%r12d
mov    $0x1,%esi
mov    %rbx,%rdi
call   1050 <numeric_arg@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r12d,%esi
call   1050 <numeric_arg@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <dialog_progressbox@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @call_progressbox(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 i32*, i32** %6
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 4
br i1 %12, label %13, label %23
13: ; preds = %3
%14 = load i8*, i8** %4
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = load i8**, i8*** %5
%19 = call i32 @numeric_arg(i8** %18, i32 2)
%20 = load i8**, i8*** %5
%21 = call i32 @numeric_arg(i8** %20, i32 3)
%22 = call i32 @dialog_progressbox(i8* %14, i8* %17, i32 %19, i32 %21)
br label %30
23: ; preds = %3
%24 = load i8*, i8** %4
%25 = load i8**, i8*** %5
%26 = call i32 @numeric_arg(i8** %25, i32 1)
%27 = load i8**, i8*** %5
%28 = call i32 @numeric_arg(i8** %27, i32 2)
%29 = call i32 @dialog_progressbox(i8* %24, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %26, i32 %28)
br label %30
30: ; preds = %23, %13
%31 = phi i32 [ %22, %13 ], [ %29, %23 ]
ret i32 %31
}

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