#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 argp_state {
  int arg_num;
};
typedef int /*<<< orphan*/ error_t;

/* Variables and functions */
int /*<<< orphan*/ ARGP_ERR_UNKNOWN;
#define ARGP_KEY_ARG 129
#define ARGP_KEY_END 128
int /*<<< orphan*/ argp_usage(struct argp_state *);
int /*<<< orphan*/ skin(char *);
error_t parse_opt(int key, char *arg, struct argp_state *state) {
  switch (key) {
  case ARGP_KEY_ARG:
    skin(arg);
    break;
  case ARGP_KEY_END:
    if (state->arg_num < 1)
      argp_usage(state);
    break;
  default:
    return ARGP_ERR_UNKNOWN;
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_opt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x80,%eax
je     116a <parse_opt+0x4a>
jmp    1149 <parse_opt+0x29>
mov    -0x1c(%rbp),%eax
sub    $0x81,%eax
jne    1185 <parse_opt+0x65>
jmp    115c <parse_opt+0x3c>
mov    -0x10(%rbp),%rdi
call   1030 <skin@plt>
jmp    1196 <parse_opt+0x76>
mov    -0x18(%rbp),%rax
cmpl   $0x1,(%rax)
jge    1180 <parse_opt+0x60>
mov    -0x18(%rbp),%rdi
call   1040 <argp_usage@plt>
jmp    1196 <parse_opt+0x76>
mov    0x2e54(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    119d <parse_opt+0x7d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_opt>:
push   %rbx
cmp    $0x80,%edi
je     113d <parse_opt+0x1d>
cmp    $0x81,%edi
jne    114e <parse_opt+0x2e>
mov    %rsi,%rdi
call   1030 <skin@plt>
xor    %ebx,%ebx
jmp    1157 <parse_opt+0x37>
xor    %ebx,%ebx
cmpl   $0x0,(%rdx)
jg     1157 <parse_opt+0x37>
mov    %rdx,%rdi
call   1040 <argp_usage@plt>
jmp    1157 <parse_opt+0x37>
mov    0x2e8b(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.argp_state = type { i32 }
@ARGP_ERR_UNKNOWN = global i32 0
define i32 @parse_opt(i32 %0, i8* %1, %struct.argp_state* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca %struct.argp_state*
store i32 %0, i32* %5
store i8* %1, i8** %6
store %struct.argp_state* %2, %struct.argp_state** %7
%8 = load i32, i32* %5
switch i32 %8, label %21 [
i32 129, label %9
i32 128, label %12
]
9: ; preds = %3
%10 = load i8*, i8** %6
%11 = call i32 @skin(i8* %10)
br label %23
12: ; preds = %3
%13 = load %struct.argp_state*, %struct.argp_state** %7
%14 = getelementptr inbounds %struct.argp_state, %struct.argp_state* %13, i32 0, i32 0
%15 = load i32, i32* %14
%16 = icmp slt i32 %15, 1
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = load %struct.argp_state*, %struct.argp_state** %7
%19 = call i32 @argp_usage(%struct.argp_state* %18)
br label %20
20: ; preds = %17, %12
br label %23
21: ; preds = %3
%22 = load i32, i32* @ARGP_ERR_UNKNOWN
store i32 %22, i32* %4
br label %24
23: ; preds = %20, %9
store i32 0, i32* %4
br label %24
24: ; preds = %23, %21
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
%struct.argp_state = type { i32 }
@ARGP_ERR_UNKNOWN = global i32 0
define i32 @parse_opt(i32 %0, i8* %1, %struct.argp_state* %2) {
switch i32 %0, label %12 [
i32 129, label %4
i32 128, label %6
]
4: ; preds = %3
%5 = tail call i32 @skin(i8* %1)
br label %14
6: ; preds = %3
%7 = getelementptr inbounds %struct.argp_state, %struct.argp_state* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = icmp slt i32 %8, 1
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = tail call i32 @argp_usage(%struct.argp_state* %2)
br label %14
12: ; preds = %3
%13 = load i32, i32* @ARGP_ERR_UNKNOWN
br label %14
14: ; preds = %4, %10, %6, %12
%15 = phi i32 [ %13, %12 ], [ 0, %6 ], [ 0, %10 ], [ 0, %4 ]
ret i32 %15
}