#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 */
double atof(char const *);
int /*<<< orphan*/ error_exit(int /*<<< orphan*/);
int /*<<< orphan*/ gettext(char *);
char *strchr(char const *, char);
void parse_nagios_settings(const char *in, double *nagios_warn,
                           double *nagios_crit) {
  char *dummy = strchr(in, ',');
  if (!dummy)
    error_exit(gettext("-n: missing parameter\n"));
  *nagios_warn = atof(in);
  *nagios_crit = atof(dummy + 1);
}


x86 assembly (clang, -O0):
<parse_nagios_settings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2c,%esi
call   1050 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1184 <parse_nagios_settings+0x44>
lea    0xe88(%rip),%rdi
call   1040 <gettext@plt>
mov    %eax,%edi
call   1060 <error_exit@plt>
mov    -0x8(%rbp),%rdi
call   1030 <atof@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1030 <atof@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_nagios_settings>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
mov    $0x2c,%esi
call   1050 <strchr@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1176 <parse_nagios_settings+0x36>
lea    0xe96(%rip),%rdi
call   1040 <gettext@plt>
mov    %eax,%edi
call   1060 <error_exit@plt>
mov    %r12,%rdi
call   1030 <atof@plt>
movsd  %xmm0,(%r15)
add    $0x1,%rbx
mov    %rbx,%rdi
call   1030 <atof@plt>
movsd  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [23 x i8] c"-n: missing parameter\0A\00"
define void @parse_nagios_settings(i8* %0, double* %1, double* %2) {
%4 = alloca i8*
%5 = alloca double*
%6 = alloca double*
%7 = alloca i8*
store i8* %0, i8** %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load i8*, i8** %4
%9 = call i8* @strchr(i8* %8, i8 signext 44)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = icmp ne i8* %10, null
br i1 %11, label %15, label %12
12: ; preds = %3
%13 = call i32 @gettext(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @error_exit(i32 %13)
br label %15
15: ; preds = %12, %3
%16 = load i8*, i8** %4
%17 = call double @atof(i8* %16)
%18 = load double*, double** %5
store double %17, double* %18
%19 = load i8*, i8** %7
%20 = getelementptr inbounds i8, i8* %19, i64 1
%21 = call double @atof(i8* %20)
%22 = load double*, double** %6
store double %21, double* %22
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"-n: missing parameter\0A\00"
define void @parse_nagios_settings(i8* %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 44)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @gettext(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @error_exit(i32 %7)
br label %9
9: ; preds = %6, %3
%10 = tail call double @atof(i8* %0)
store double %10, double* %1
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = tail call double @atof(i8* %11)
store double %12, double* %2
ret void
}