#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 */
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
scalar_t__ get_u32(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ invarg(char *, char *);
int xfrm_reqid_parse(__u32 *reqid, int *argcp, char ***argvp) {
  int argc = *argcp;
  char **argv = *argvp;
  if (get_u32(reqid, *argv, 0))
    invarg("\"REQID\" is invalid", *argv);
  *argcp = argc;
  *argvp = argv;
  return 0;
}


x86 assembly (clang, -O0):
<xfrm_reqid_parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
xor    %edx,%edx
call   1030 <get_u32@plt>
cmp    $0x0,%rax
je     1177 <xfrm_reqid_parse+0x57>
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
lea    0xe8e(%rip),%rdi
call   1040 <invarg@plt>
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfrm_reqid_parse>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    (%rsi),%r15d
mov    (%rdx),%rbp
mov    0x0(%rbp),%rsi
xor    %edx,%edx
call   1030 <get_u32@plt>
test   %rax,%rax
je     1153 <xfrm_reqid_parse+0x33>
mov    0x0(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <invarg@plt>
mov    %r15d,(%rbx)
mov    %rbp,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\22REQID\22 is invalid\00"
define i32 @xfrm_reqid_parse(i32* %0, i32* %1, i8*** %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8***
%7 = alloca i32
%8 = alloca i8**
store i32* %0, i32** %4
store i32* %1, i32** %5
store i8*** %2, i8**** %6
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
store i32 %10, i32* %7
%11 = load i8***, i8**** %6
%12 = load i8**, i8*** %11
store i8** %12, i8*** %8
%13 = load i32*, i32** %4
%14 = load i8**, i8*** %8
%15 = load i8*, i8** %14
%16 = call i64 @get_u32(i32* %13, i8* %15, i32 0)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %3
%19 = load i8**, i8*** %8
%20 = load i8*, i8** %19
%21 = call i32 @invarg(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %20)
br label %22
22: ; preds = %18, %3
%23 = load i32, i32* %7
%24 = load i32*, i32** %5
store i32 %23, i32* %24
%25 = load i8**, i8*** %8
%26 = load i8***, i8**** %6
store i8** %25, i8*** %26
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"\22REQID\22 is invalid\00"
define i32 @xfrm_reqid_parse(i32* %0, i32* nocapture %1, i8*** nocapture %2) {
%4 = load i32, i32* %1
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = tail call i64 @get_u32(i32* %0, i8* %6, i32 0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = load i8*, i8** %5
%11 = tail call i32 @invarg(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %3
store i32 %4, i32* %1
store i8** %5, i8*** %2
ret i32 0
}