#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 */
char *parse_arg_tag(int *, int, char const **, char const *, char const *,
                    char *);
int strlen(char const *);
int parse_opt(int *arg, int argc, const char **argv, int opos, const char *stag,
              const char *ltag) {
  const char *tmp_str = NULL;
  if ((tmp_str = parse_arg_tag(arg, argc, argv, stag, ltag, ""))) {
    return strlen(tmp_str);
  }
  return 1;
}


x86 assembly (clang, -O0):
<parse_opt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%r8
lea    0xea0(%rip),%r9
call   1040 <parse_arg_tag@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
je     1184 <parse_opt+0x64>
mov    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x4(%rbp)
jmp    118b <parse_opt+0x6b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_opt>:
push   %rax
mov    %r9,%rax
mov    %r8,%rcx
lea    0xed2(%rip),%r9
mov    %rax,%r8
call   1040 <parse_arg_tag@plt>
test   %rax,%rax
je     1144 <parse_opt+0x24>
mov    %rax,%rdi
pop    %rax
jmp    1030 <strlen@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @parse_opt(i32* %0, i32 %1, i8** %2, i32 %3, i8* %4, i8* %5) {
%7 = tail call i8* @parse_arg_tag(i32* %0, i32 %1, i8** %2, i8* %4, i8* %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @strlen(i8* %7)
br label %11
11: ; preds = %6, %9
%12 = phi i32 [ %10, %9 ], [ 1, %6 ]
ret i32 %12
}