#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 */
struct args_info {
  int dummy;
};

/* Variables and functions */
int match_int_internal(int *, char const *, int, char const *);
char *match_numeric_arg(struct args_info *, char const *);
int match_int_arg(int *out, struct args_info *args, const char *opt,
                  int allow_negative) {
  const char *found = match_numeric_arg(args, opt);
  if (!found)
    return 0;
  return match_int_internal(out, found, allow_negative, opt);
}


x86 assembly (clang, -O0):
<match_int_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <match_numeric_arg@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    115f <match_int_arg+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    1176 <match_int_arg+0x56>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1030 <match_int_internal@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_int_arg>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rdi,%rbp
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <match_numeric_arg@plt>
test   %rax,%rax
je     1152 <match_int_arg+0x32>
mov    %rbp,%rdi
mov    %rax,%rsi
mov    %r14d,%edx
mov    %rbx,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <match_int_internal@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.args_info = type { i32 }
define i32 @match_int_arg(i32* %0, %struct.args_info* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca %struct.args_info*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i32* %0, i32** %6
store %struct.args_info* %1, %struct.args_info** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%11 = load %struct.args_info*, %struct.args_info** %7
%12 = load i8*, i8** %8
%13 = call i8* @match_numeric_arg(%struct.args_info* %11, i8* %12)
store i8* %13, i8** %10
%14 = load i8*, i8** %10
%15 = icmp ne i8* %14, null
br i1 %15, label %17, label %16
16: ; preds = %4
store i32 0, i32* %5
br label %23
17: ; preds = %4
%18 = load i32*, i32** %6
%19 = load i8*, i8** %10
%20 = load i32, i32* %9
%21 = load i8*, i8** %8
%22 = call i32 @match_int_internal(i32* %18, i8* %19, i32 %20, i8* %21)
store i32 %22, i32* %5
br label %23
23: ; preds = %17, %16
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
%struct.args_info = type { i32 }
define i32 @match_int_arg(i32* %0, %struct.args_info* %1, i8* %2, i32 %3) {
%5 = tail call i8* @match_numeric_arg(%struct.args_info* %1, i8* %2)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @match_int_internal(i32* %0, i8* %5, i32 %3, i8* %2)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ %8, %7 ], [ 0, %4 ]
ret i32 %10
}