#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int sscanf(char *, char *, double *, char *);
int /*<<< orphan*/ stderr;
int pl_N_Double(void *variable, int argc, char *argv[], int i, int k) {
  char c = '\0';
  if (i >= argc) {
    fprintf(stderr, "The command line is missing a negative floating ");
    fprintf(stderr, "point number at its end.\n\n");
    return (0);
  } else if ((sscanf(&argv[i][k], "%lf%c", (double *)variable, &c) != 1) ||
             (c != '\0') || (*((double *)variable) >= 0)) {
    fprintf(stderr, "\"%s\" (from item %d on the command line) ", &argv[i][k],
            i);
    fprintf(stderr, "is not a negative floating point number.\n\n");
    return (0);
  } else
    return (i + 1);
}


x86 assembly (clang, -O0):
<pl_N_Double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8d,-0x28(%rbp)
movb   $0x0,-0x29(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     1184 <pl_N_Double+0x64>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xea6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    122f <pl_N_Double+0x10f>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x28(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rdx
lea    0xeaa(%rip),%rsi
lea    -0x29(%rbp),%rcx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    11d6 <pl_N_Double+0xb6>
movsbl -0x29(%rbp),%eax
cmp    $0x0,%eax
jne    11d6 <pl_N_Double+0xb6>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1226 <pl_N_Double+0x106>
mov    0x2e03(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
movslq -0x28(%rbp),%rax
add    %rax,%rdx
mov    -0x24(%rbp),%ecx
lea    0xe56(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dd6(%rip),%rax
mov    (%rax),%edi
lea    0xe68(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    122f <pl_N_Double+0x10f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pl_N_Double>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
cmp    %esi,%ecx
jge    1181 <pl_N_Double+0x61>
mov    %ecx,%ebx
mov    %rdx,%r14
mov    %rdi,%r15
movslq %ecx,%r12
movslq %r8d,%rbp
mov    (%rdx,%r12,8),%rdi
add    %rbp,%rdi
lea    0xefb(%rip),%rsi
lea    0xf(%rsp),%rcx
mov    %r15,%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    11a6 <pl_N_Double+0x86>
cmpb   $0x0,0xf(%rsp)
jne    11a6 <pl_N_Double+0x86>
movsd  (%r15),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    11a6 <pl_N_Double+0x86>
add    $0x1,%ebx
mov    %ebx,%r14d
jmp    11db <pl_N_Double+0xbb>
mov    0x2e58(%rip),%rbx
mov    (%rbx),%edi
lea    0xe6f(%rip),%rsi
xor    %r14d,%r14d
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe8d(%rip),%rsi
jmp    11d4 <pl_N_Double+0xb4>
mov    0x2e33(%rip),%r15
mov    (%r15),%edi
add    (%r14,%r12,8),%rbp
lea    0xe97(%rip),%rsi
xor    %r14d,%r14d
mov    %rbp,%rdx
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
lea    0xea7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %r14d,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"The command line is missing a negative floating \00"
@.str.1 = [27 x i8] c"point number at its end.\0A\0A\00"
@.str.2 = [6 x i8] c"%lf%c\00"
@.str.3 = [41 x i8] c"\22%s\22 (from item %d on the command line) \00"
@.str.4 = [43 x i8] c"is not a negative floating point number.\0A\0A\00"
define i32 @pl_N_Double(i8* %0, i32 %1, i8** %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8**
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8
store i8* %0, i8** %7
store i32 %1, i32* %8
store i8** %2, i8*** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i8 0, i8* %12
%13 = load i32, i32* %10
%14 = load i32, i32* %8
%15 = icmp sge i32 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %5
%17 = load i32, i32* @stderr
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%19 = load i32, i32* @stderr
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %6
br label %60
21: ; preds = %5
%22 = load i8**, i8*** %9
%23 = load i32, i32* %10
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
%27 = load i32, i32* %11
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
%30 = load i8*, i8** %7
%31 = bitcast i8* %30 to double*
%32 = call i32 @sscanf(i8* %29, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double* %31, i8* %12)
%33 = icmp ne i32 %32, 1
br i1 %33, label %43, label %34
34: ; preds = %21
%35 = load i8, i8* %12
%36 = sext i8 %35 to i32
%37 = icmp ne i32 %36, 0
br i1 %37, label %43, label %38
38: ; preds = %34
%39 = load i8*, i8** %7
%40 = bitcast i8* %39 to double*
%41 = load double, double* %40
%42 = fcmp oge double %41, 0.000000e+00
br i1 %42, label %43, label %57
43: ; preds = %38, %34, %21
%44 = load i32, i32* @stderr
%45 = load i8**, i8*** %9
%46 = load i32, i32* %10
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8*, i8** %45, i64 %47
%49 = load i8*, i8** %48
%50 = load i32, i32* %11
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8, i8* %49, i64 %51
%53 = load i32, i32* %10
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i8* %52, i32 %53)
%55 = load i32, i32* @stderr
%56 = call i32 (i32, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %6
br label %60
57: ; preds = %38
%58 = load i32, i32* %10
%59 = add nsw i32 %58, 1
store i32 %59, i32* %6
br label %60
60: ; preds = %57, %43, %16
%61 = load i32, i32* %6
ret i32 %61
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"The command line is missing a negative floating \00"
@.str.1 = [27 x i8] c"point number at its end.\0A\0A\00"
@.str.2 = [6 x i8] c"%lf%c\00"
@.str.3 = [41 x i8] c"\22%s\22 (from item %d on the command line) \00"
@.str.4 = [43 x i8] c"is not a negative floating point number.\0A\0A\00"
define i32 @pl_N_Double(i8* %0, i32 %1, i8** nocapture %2, i32 %3, i32 %4) {
%6 = alloca i8
store i8 0, i8* %6
%7 = icmp slt i32 %3, %1
br i1 %7, label %13, label %8
8: ; preds = %5
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %37
13: ; preds = %5
%14 = sext i32 %3 to i64
%15 = getelementptr inbounds i8*, i8** %2, i64 %14
%16 = load i8*, i8** %15
%17 = sext i32 %4 to i64
%18 = getelementptr inbounds i8, i8* %16, i64 %17
%19 = bitcast i8* %0 to double*
%20 = call i32 @sscanf(i8* %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double* %19, i8* %6)
%21 = icmp ne i32 %20, 1
%22 = load i8, i8* %6
%23 = icmp ne i8 %22, 0
%24 = select i1 %21, i1 true, i1 %23
br i1 %24, label %28, label %25
25: ; preds = %13
%26 = load double, double* %19
%27 = fcmp ult double %26, 0.000000e+00
br i1 %27, label %35, label %28
28: ; preds = %25, %13
%29 = load i32, i32* @stderr
%30 = load i8*, i8** %15
%31 = getelementptr inbounds i8, i8* %30, i64 %17
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i8* %31, i32 %3)
%33 = load i32, i32* @stderr
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0))
br label %37
35: ; preds = %25
%36 = add nsw i32 %3, 1
br label %37
37: ; preds = %35, %28, %8
%38 = phi i32 [ 0, %8 ], [ 0, %28 ], [ %36, %35 ]
ret i32 %38
}