#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 atoi(char *);
int /*<<< orphan*/ input_append_input_arguments_with_int(char const *, int);
char *input_get_argument(int, char **, char const *);
int input_get_int(int argc, char **argv, const char *argument, int _default) {
  char *value = input_get_argument(argc, argv, argument);
  if (value) {
    input_append_input_arguments_with_int(argument, atoi(value));
    return atoi(value);
  }
  return _default;
}


x86 assembly (clang, -O0):
<input_get_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <input_get_argument@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1192 <input_get_int+0x62>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <atoi@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%esi
call   1040 <input_append_input_arguments_with_int@plt>
mov    -0x28(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
jmp    1198 <input_get_int+0x68>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_get_int>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%ebp
mov    %rdx,%r14
call   1030 <input_get_argument@plt>
test   %rax,%rax
je     1164 <input_get_int+0x34>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <atoi@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <input_append_input_arguments_with_int@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <atoi@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @input_get_int(i32 %0, i8** %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = call i8* @input_get_argument(i32 %11, i8** %12, i8* %13)
store i8* %14, i8** %10
%15 = load i8*, i8** %10
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %24
17: ; preds = %4
%18 = load i8*, i8** %8
%19 = load i8*, i8** %10
%20 = call i32 @atoi(i8* %19)
%21 = call i32 @input_append_input_arguments_with_int(i8* %18, i32 %20)
%22 = load i8*, i8** %10
%23 = call i32 @atoi(i8* %22)
store i32 %23, i32* %5
br label %26
24: ; preds = %4
%25 = load i32, i32* %9
store i32 %25, i32* %5
br label %26
26: ; preds = %24, %17
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
define i32 @input_get_int(i32 %0, i8** %1, i8* %2, i32 %3) {
%5 = tail call i8* @input_get_argument(i32 %0, i8** %1, i8* %2)
%6 = icmp eq i8* %5, null
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = tail call i32 @atoi(i8* %5)
%9 = tail call i32 @input_append_input_arguments_with_int(i8* %2, i32 %8)
%10 = tail call i32 @atoi(i8* %5)
br label %11
11: ; preds = %4, %7
%12 = phi i32 [ %10, %7 ], [ %3, %4 ]
ret i32 %12
}