#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 *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *args[]) {
  double min, max, t;
  int i, n, f;
  if (argc < 3) {
    printf("Usage: %s [p]... [-f]\n"
           "Prints the lowest and highest p values. Floors if -f.\n",
           args[0]);
    return 1;
  }
  f = !strcmp(args[argc - 1], "-f");
  min = max = atof(args[1]);
  for (i = 1, n = f ? argc - 2 : argc - 1; i < n; ++i) {
    t = atof(args[i + 1]);
    if (t > max)
      max = t;
    else if (t < min)
      min = t;
  }
  if (f)
    printf("%d %d\n", (int)min, (int)max);
  else
    printf("%.2f %.2f\n", min, max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1171 <main+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12a5 <main+0x175>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xec4(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm0,-0x18(%rbp)
movl   $0x1,-0x2c(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     11d4 <main+0xa4>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x38(%rbp)
jmp    11dd <main+0xad>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    125f <main+0x12f>
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1229 <main+0xf9>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    124c <main+0x11c>
movsd  -0x28(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1247 <main+0x117>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    124c <main+0x11c>
jmp    1251 <main+0x121>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11e3 <main+0xb3>
cmpl   $0x0,-0x34(%rbp)
je     1286 <main+0x156>
cvttsd2si -0x18(%rbp),%esi
cvttsd2si -0x20(%rbp),%edx
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    129e <main+0x16e>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xdc0(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r15
cmp    $0x2,%edi
jg     115d <main+0x2d>
mov    (%r15),%rsi
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%ebx
jmp    1224 <main+0xf4>
mov    %edi,%ebp
lea    -0x1(%rbp),%ebx
mov    (%r15,%rbx,8),%rdi
lea    0xee0(%rip),%rsi
call   1050 <strcmp@plt>
mov    %eax,%r14d
mov    0x8(%r15),%rdi
call   1030 <atof@plt>
movapd %xmm0,%xmm1
add    $0xfffffffe,%ebp
test   %r14d,%r14d
cmovne %ebx,%ebp
cmp    $0x2,%ebp
jb     11e3 <main+0xb3>
mov    %ebp,%ebp
add    $0xffffffffffffffff,%rbp
xor    %ebx,%ebx
movsd  %xmm1,0x8(%rsp)
jmp    11b9 <main+0x89>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
add    $0x1,%rbx
movapd %xmm0,%xmm1
cmp    %rbx,%rbp
je     11ed <main+0xbd>
movsd  %xmm1,0x10(%rsp)
mov    0x10(%r15,%rbx,8),%rdi
call   1030 <atof@plt>
ucomisd 0x8(%rsp),%xmm0
ja     11a0 <main+0x70>
movsd  0x10(%rsp),%xmm1
ucomisd %xmm0,%xmm1
ja     11ac <main+0x7c>
movapd %xmm1,%xmm0
jmp    11ac <main+0x7c>
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
test   %r14d,%r14d
je     120a <main+0xda>
lea    0xe5e(%rip),%rdi
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
xor    %ebx,%ebx
jmp    1224 <main+0xf4>
cvttsd2si %xmm0,%esi
cvttsd2si 0x8(%rsp),%edx
lea    0xe35(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [77 x i8] c"Usage: %s [p]... [-f]\0APrints the lowest and highest p values. Floors if -f.\0A\00"
@.str.1 = [3 x i8] c"-f\00"
@.str.2 = [7 x i8] c"%d %d\0A\00"
@.str.3 = [11 x i8] c"%.2f %.2f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 3
br i1 %13, label %14, label %19
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %17)
store i32 1, i32* %3
br label %86
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = load i32, i32* %4
%22 = sub nsw i32 %21, 1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8*, i8** %20, i64 %23
%25 = load i8*, i8** %24
%26 = call i32 @strcmp(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp ne i32 %26, 0
%28 = xor i1 %27, true
%29 = zext i1 %28 to i32
store i32 %29, i32* %11
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call double @atof(i8* %32)
store double %33, double* %7
store double %33, double* %6
store i32 1, i32* %9
%34 = load i32, i32* %11
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %19
%37 = load i32, i32* %4
%38 = sub nsw i32 %37, 2
br label %42
39: ; preds = %19
%40 = load i32, i32* %4
%41 = sub nsw i32 %40, 1
br label %42
42: ; preds = %39, %36
%43 = phi i32 [ %38, %36 ], [ %41, %39 ]
store i32 %43, i32* %10
br label %44
44: ; preds = %69, %42
%45 = load i32, i32* %9
%46 = load i32, i32* %10
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %72
48: ; preds = %44
%49 = load i8**, i8*** %5
%50 = load i32, i32* %9
%51 = add nsw i32 %50, 1
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8*, i8** %49, i64 %52
%54 = load i8*, i8** %53
%55 = call double @atof(i8* %54)
store double %55, double* %8
%56 = load double, double* %8
%57 = load double, double* %7
%58 = fcmp ogt double %56, %57
br i1 %58, label %59, label %61
59: ; preds = %48
%60 = load double, double* %8
store double %60, double* %7
br label %68
61: ; preds = %48
%62 = load double, double* %8
%63 = load double, double* %6
%64 = fcmp olt double %62, %63
br i1 %64, label %65, label %67
65: ; preds = %61
%66 = load double, double* %8
store double %66, double* %6
br label %67
67: ; preds = %65, %61
br label %68
68: ; preds = %67, %59
br label %69
69: ; preds = %68
%70 = load i32, i32* %9
%71 = add nsw i32 %70, 1
store i32 %71, i32* %9
br label %44
72: ; preds = %44
%73 = load i32, i32* %11
%74 = icmp ne i32 %73, 0
br i1 %74, label %75, label %81
75: ; preds = %72
%76 = load double, double* %6
%77 = fptosi double %76 to i32
%78 = load double, double* %7
%79 = fptosi double %78 to i32
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %77, i32 %79)
br label %85
81: ; preds = %72
%82 = load double, double* %6
%83 = load double, double* %7
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %82, double %83)
br label %85
85: ; preds = %81, %75
store i32 0, i32* %3
br label %86
86: ; preds = %85, %14
%87 = load i32, i32* %3
ret i32 %87
}

LLVM IR (-O2):
@.str = [77 x i8] c"Usage: %s [p]... [-f]\0APrints the lowest and highest p values. Floors if -f.\0A\00"
@.str.1 = [3 x i8] c"-f\00"
@.str.2 = [7 x i8] c"%d %d\0A\00"
@.str.3 = [11 x i8] c"%.2f %.2f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %47
7: ; preds = %2
%8 = add nsw i32 %0, -1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = tail call double @atof(i8* %15)
%17 = add nsw i32 %0, -2
%18 = select i1 %13, i32 %17, i32 %8
%19 = icmp ugt i32 %18, 1
br i1 %19, label %20, label %38
20: ; preds = %7
%21 = zext i32 %18 to i64
br label %22
22: ; preds = %20, %34
%23 = phi i64 [ 1, %20 ], [ %26, %34 ]
%24 = phi double [ %16, %20 ], [ %36, %34 ]
%25 = phi double [ %16, %20 ], [ %35, %34 ]
%26 = add nuw nsw i64 %23, 1
%27 = getelementptr inbounds i8*, i8** %1, i64 %26
%28 = load i8*, i8** %27
%29 = tail call double @atof(i8* %28)
%30 = fcmp ogt double %29, %25
br i1 %30, label %34, label %31
31: ; preds = %22
%32 = fcmp olt double %29, %24
br i1 %32, label %33, label %34
33: ; preds = %31
br label %34
34: ; preds = %22, %33, %31
%35 = phi double [ %25, %33 ], [ %25, %31 ], [ %29, %22 ]
%36 = phi double [ %29, %33 ], [ %24, %31 ], [ %24, %22 ]
%37 = icmp eq i64 %26, %21
br i1 %37, label %38, label %22
38: ; preds = %34, %7
%39 = phi double [ %16, %7 ], [ %35, %34 ]
%40 = phi double [ %16, %7 ], [ %36, %34 ]
br i1 %13, label %41, label %45
41: ; preds = %38
%42 = fptosi double %40 to i32
%43 = fptosi double %39 to i32
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %42, i32 %43)
br label %47
45: ; preds = %38
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %40, double %39)
br label %47
47: ; preds = %41, %45, %4
%48 = phi i32 [ 1, %4 ], [ 0, %45 ], [ 0, %41 ]
ret i32 %48
}