#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 /*<<< orphan*/ ft_error();
void arg_check(char *str) {
  if (*str == '-' || *str == '+')
    str++;
  if (!*str)
    ft_error();
  while (*str) {
    if (*str > '9' || *str < '0')
      ft_error();
    str++;
  }
}


x86 assembly (clang, -O0):
<arg_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     113c <arg_check+0x2c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    1148 <arg_check+0x38>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    115c <arg_check+0x4c>
mov    $0x0,%al
call   1030 <ft_error@plt>
jmp    1161 <arg_check+0x51>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     11a6 <arg_check+0x96>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     118e <arg_check+0x7e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jge    1195 <arg_check+0x85>
mov    $0x0,%al
call   1030 <ft_error@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1161 <arg_check+0x51>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_check>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
cmp    $0x2d,%al
je     111e <arg_check+0xe>
cmp    $0x2b,%al
jne    1125 <arg_check+0x15>
mov    0x1(%rbx),%al
add    $0x1,%rbx
test   %al,%al
jne    1136 <arg_check+0x26>
xor    %eax,%eax
call   1030 <ft_error@plt>
mov    (%rbx),%al
test   %al,%al
je     115a <arg_check+0x4a>
add    $0x1,%rbx
jmp    114b <arg_check+0x3b>
nopl   0x0(%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     115a <arg_check+0x4a>
add    $0xc6,%al
cmp    $0xf5,%al
ja     1140 <arg_check+0x30>
xor    %eax,%eax
call   1030 <ft_error@plt>
jmp    1140 <arg_check+0x30>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @arg_check(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %6 [
i8 45, label %3
i8 43, label %3
]
3: ; preds = %1, %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
br label %6
6: ; preds = %1, %3
%7 = phi i8 [ %2, %1 ], [ %5, %3 ]
%8 = phi i8* [ %0, %1 ], [ %4, %3 ]
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = tail call i32 (...) @ft_error()
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %27, label %14
14: ; preds = %6, %10
%15 = phi i8 [ %7, %6 ], [ %12, %10 ]
br label %16
16: ; preds = %14, %23
%17 = phi i8 [ %25, %23 ], [ %15, %14 ]
%18 = phi i8* [ %24, %23 ], [ %8, %14 ]
%19 = add i8 %17, -58
%20 = icmp ult i8 %19, -10
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = tail call i32 (...) @ft_error()
br label %23
23: ; preds = %16, %21
%24 = getelementptr inbounds i8, i8* %18, i64 1
%25 = load i8, i8* %24
%26 = icmp eq i8 %25, 0
br i1 %26, label %27, label %16
27: ; preds = %23, %10
ret void
}