#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 dialog_mixedgauge(char const *, char *, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/, int, char **);
int howmany_tags(char **, int);
int /*<<< orphan*/ numeric_arg(char **, int);
int call_mixed_gauge(const char *t, char *av[], int *offset_add) {
  int tags = howmany_tags(av + 5, 2);
  *offset_add = 5 + tags * 2;
  return dialog_mixedgauge(t, av[1], numeric_arg(av, 2), numeric_arg(av, 3),
                           numeric_arg(av, 4), tags, av + 5);
}


x86 assembly (clang, -O0):
<call_mixed_gauge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x28,%rdi
mov    $0x2,%esi
call   1030 <howmany_tags@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x5,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1050 <numeric_arg@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1050 <numeric_arg@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1050 <numeric_arg@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    %eax,%r8d
mov    -0x1c(%rbp),%r9d
mov    -0x10(%rbp),%rax
add    $0x28,%rax
mov    %rax,(%rsp)
call   1040 <dialog_mixedgauge@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_mixed_gauge>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %rdi,0x10(%rsp)
lea    0x28(%rsi),%r15
mov    %r15,%rdi
mov    $0x2,%esi
call   1030 <howmany_tags@plt>
mov    %eax,%r12d
lea    (%r12,%r12,1),%eax
add    $0x5,%eax
mov    %eax,0x0(%r13)
mov    0x8(%rbx),%r13
mov    %rbx,%rdi
mov    $0x2,%esi
call   1050 <numeric_arg@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x3,%esi
call   1050 <numeric_arg@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
mov    $0x4,%esi
call   1050 <numeric_arg@plt>
mov    %r15,(%rsp)
mov    0x10(%rsp),%rdi
mov    %r13,%rsi
mov    %ebp,%edx
mov    %r14d,%ecx
mov    %eax,%r8d
mov    %r12d,%r9d
call   1040 <dialog_mixedgauge@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @call_mixed_gauge(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 = getelementptr inbounds i8*, i8** %8, i64 5
%10 = call i32 @howmany_tags(i8** %9, i32 2)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = mul nsw i32 %11, 2
%13 = add nsw i32 5, %12
%14 = load i32*, i32** %6
store i32 %13, i32* %14
%15 = load i8*, i8** %4
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = load i8**, i8*** %5
%20 = call i32 @numeric_arg(i8** %19, i32 2)
%21 = load i8**, i8*** %5
%22 = call i32 @numeric_arg(i8** %21, i32 3)
%23 = load i8**, i8*** %5
%24 = call i32 @numeric_arg(i8** %23, i32 4)
%25 = load i32, i32* %7
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 5
%28 = call i32 @dialog_mixedgauge(i8* %15, i8* %18, i32 %20, i32 %22, i32 %24, i32 %25, i8** %27)
ret i32 %28
}

LLVM IR (-O2):
define i32 @call_mixed_gauge(i8* %0, i8** %1, i32* nocapture writeonly %2) {
%4 = getelementptr inbounds i8*, i8** %1, i64 5
%5 = tail call i32 @howmany_tags(i8** %4, i32 2)
%6 = shl nsw i32 %5, 1
%7 = add nsw i32 %6, 5
store i32 %7, i32* %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @numeric_arg(i8** %1, i32 2)
%11 = tail call i32 @numeric_arg(i8** %1, i32 3)
%12 = tail call i32 @numeric_arg(i8** %1, i32 4)
%13 = tail call i32 @dialog_mixedgauge(i8* %0, i8* %9, i32 %10, i32 %11, i32 %12, i32 %5, i8** %4)
ret i32 %13
}