#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*/ fprintf(int /*<<< orphan*/, char *, char const *);
int optind;
int /*<<< orphan*/ show_usage();
int /*<<< orphan*/ stderr;
bool arg_get_type(const char *cmd, int argc, char **argv,
                  const char **type_ret) {
  if (optind >= argc) {
    fprintf(stderr, "susetest config %s: missing type argument\n", cmd);
    show_usage();
    return false;
  }
  *type_ret = argv[optind++];
  return true;
}


x86 assembly (clang, -O0):
<arg_get_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
cmp    -0x14(%rbp),%eax
jl     1175 <arg_get_type+0x55>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xea3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <show_usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a5 <arg_get_type+0x85>
mov    -0x20(%rbp),%rax
mov    0x2e68(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    0x2e5a(%rip),%rdx
mov    %esi,(%rdx)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_get_type>:
push   %rbx
mov    %rdi,%rax
mov    0x2ebd(%rip),%rdi
movslq (%rdi),%rbx
cmp    %esi,%ebx
jge    1145 <arg_get_type+0x25>
lea    0x1(%rbx),%eax
mov    %eax,(%rdi)
mov    (%rdx,%rbx,8),%rax
mov    %rax,(%rcx)
mov    $0x1,%ebx
jmp    1166 <arg_get_type+0x46>
mov    0x2e8c(%rip),%rcx
mov    (%rcx),%edi
lea    0xeab(%rip),%rsi
mov    %rax,%rdx
call   1030 <fprintf@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <show_usage@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@optind = global i32 0
@stderr = global i32 0
@.str = [43 x i8] c"susetest config %s: missing type argument\0A\00"
define i32 @arg_get_type(i8* %0, i32 %1, i8** %2, i8** %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8**
%9 = alloca i8**
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8** %2, i8*** %8
store i8** %3, i8*** %9
%10 = load i32, i32* @optind
%11 = load i32, i32* %7
%12 = icmp sge i32 %10, %11
br i1 %12, label %13, label %18
13: ; preds = %4
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %6
%16 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i32 (...) @show_usage()
store i32 0, i32* %5
br label %26
18: ; preds = %4
%19 = load i8**, i8*** %8
%20 = load i32, i32* @optind
%21 = add nsw i32 %20, 1
store i32 %21, i32* @optind
%22 = sext i32 %20 to i64
%23 = getelementptr inbounds i8*, i8** %19, i64 %22
%24 = load i8*, i8** %23
%25 = load i8**, i8*** %9
store i8* %24, i8** %25
store i32 1, i32* %5
br label %26
26: ; preds = %18, %13
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
@optind = global i32 0
@stderr = global i32 0
@.str = [43 x i8] c"susetest config %s: missing type argument\0A\00"
define i32 @arg_get_type(i8* %0, i32 %1, i8** nocapture %2, i8** nocapture writeonly %3) {
%5 = load i32, i32* @optind
%6 = icmp slt i32 %5, %1
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0)
%10 = tail call i32 (...) @show_usage()
br label %16
11: ; preds = %4
%12 = add nsw i32 %5, 1
store i32 %12, i32* @optind
%13 = sext i32 %5 to i64
%14 = getelementptr inbounds i8*, i8** %2, i64 %13
%15 = load i8*, i8** %14
store i8* %15, i8** %3
br label %16
16: ; preds = %11, %7
%17 = phi i32 [ 0, %7 ], [ 1, %11 ]
ret i32 %17
}