#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 *);
void parse_regtabs(int argc, char **argv, int *option, int *opt_len,
                   int *bad_arg) {
  if (*option || argc > 1)
    *bad_arg = 1;
  *option = 1;
  if (argc == 0) {
    *opt_len = 8;
    return;
  }
  *opt_len = atoi(argv[0]);
  if (*opt_len < 1 || *opt_len > 160) {
    *bad_arg = 1;
    return;
  }
}


x86 assembly (clang, -O0):
<parse_regtabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1142 <parse_regtabs+0x32>
cmpl   $0x1,-0x4(%rbp)
jle    114c <parse_regtabs+0x3c>
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
cmpl   $0x0,-0x4(%rbp)
jne    116f <parse_regtabs+0x5f>
mov    -0x20(%rbp),%rax
movl   $0x8,(%rax)
jmp    11aa <parse_regtabs+0x9a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
cmpl   $0x1,(%rax)
jl     11a0 <parse_regtabs+0x90>
mov    -0x20(%rbp),%rax
cmpl   $0xa0,(%rax)
jle    11aa <parse_regtabs+0x9a>
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_regtabs>:
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%rbx
cmp    $0x1,%edi
jg     1124 <parse_regtabs+0x14>
cmpl   $0x0,(%rdx)
je     112b <parse_regtabs+0x1b>
movl   $0x1,(%r14)
movl   $0x1,(%rdx)
test   %edi,%edi
je     1154 <parse_regtabs+0x44>
mov    (%rsi),%rdi
call   1030 <atoi@plt>
mov    %eax,(%rbx)
add    $0xffffff5f,%eax
cmp    $0xffffff5f,%eax
ja     115a <parse_regtabs+0x4a>
movl   $0x1,(%r14)
jmp    115a <parse_regtabs+0x4a>
movl   $0x8,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @parse_regtabs(i32 %0, i8** %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %8
%12 = load i32, i32* %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %5
%15 = load i32, i32* %6
%16 = icmp sgt i32 %15, 1
br i1 %16, label %17, label %19
17: ; preds = %14, %5
%18 = load i32*, i32** %10
store i32 1, i32* %18
br label %19
19: ; preds = %17, %14
%20 = load i32*, i32** %8
store i32 1, i32* %20
%21 = load i32, i32* %6
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = load i32*, i32** %9
store i32 8, i32* %24
br label %40
25: ; preds = %19
%26 = load i8**, i8*** %7
%27 = getelementptr inbounds i8*, i8** %26, i64 0
%28 = load i8*, i8** %27
%29 = call i32 @atoi(i8* %28)
%30 = load i32*, i32** %9
store i32 %29, i32* %30
%31 = load i32*, i32** %9
%32 = load i32, i32* %31
%33 = icmp slt i32 %32, 1
br i1 %33, label %38, label %34
34: ; preds = %25
%35 = load i32*, i32** %9
%36 = load i32, i32* %35
%37 = icmp sgt i32 %36, 160
br i1 %37, label %38, label %40
38: ; preds = %34, %25
%39 = load i32*, i32** %10
store i32 1, i32* %39
br label %40
40: ; preds = %23, %38, %34
ret void
}

LLVM IR (-O2):
define void @parse_regtabs(i32 %0, i8** nocapture %1, i32* nocapture %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
%8 = icmp sgt i32 %0, 1
%9 = or i1 %8, %7
br i1 %9, label %10, label %11
10: ; preds = %5
store i32 1, i32* %4
br label %11
11: ; preds = %5, %10
store i32 1, i32* %2
%12 = icmp eq i32 %0, 0
br i1 %12, label %13, label %14
13: ; preds = %11
store i32 8, i32* %3
br label %20
14: ; preds = %11
%15 = load i8*, i8** %1
%16 = tail call i32 @atoi(i8* %15)
store i32 %16, i32* %3
%17 = add i32 %16, -161
%18 = icmp ult i32 %17, -160
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 1, i32* %4
br label %20
20: ; preds = %14, %13, %19
ret void
}