#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double ph;
  printf("Indtast pH værdi\n");
  (void)scanf("%lf", &ph);
  if (ph <= 2)
    printf("Very acidic");
  else if (ph < 7)
    printf("Acidic");
  else if (ph == 7)
    printf("Neutral");
  else if (ph < 12)
    printf("Alkaline");
  else
    printf("Very alkaline");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xead(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     116f <main+0x4f>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    1200 <main+0xe0>
movsd  0xe91(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1193 <main+0x73>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    11fb <main+0xdb>
movsd  -0x10(%rbp),%xmm0
movsd  0xe68(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11c1 <main+0xa1>
jp     11c1 <main+0xa1>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
jmp    11f6 <main+0xd6>
movsd  0xe47(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11e5 <main+0xc5>
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
jmp    11f1 <main+0xd1>
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
jmp    11f6 <main+0xd6>
jmp    11fb <main+0xdb>
jmp    1200 <main+0xe0>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf16(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
movsd  0xea7(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1176 <main+0x46>
movsd  0xea1(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    117f <main+0x4f>
lea    0xeb4(%rip),%rdi
jmp    11b2 <main+0x82>
lea    0xe9f(%rip),%rdi
jmp    11b2 <main+0x82>
ucomisd 0xe81(%rip),%xmm0
jne    1194 <main+0x64>
jp     1194 <main+0x64>
lea    0xe9d(%rip),%rdi
jmp    11b2 <main+0x82>
movsd  0xe74(%rip),%xmm1
ucomisd %xmm0,%xmm1
lea    0xe90(%rip),%rax
lea    0xe92(%rip),%rdi
cmova  %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Indtast pH v\C3\A6rdi\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [12 x i8] c"Very acidic\00"
@.str.3 = [7 x i8] c"Acidic\00"
@.str.4 = [8 x i8] c"Neutral\00"
@.str.5 = [9 x i8] c"Alkaline\00"
@.str.6 = [14 x i8] c"Very alkaline\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = fcmp ole double %5, 2.000000e+00
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %29
9: ; preds = %0
%10 = load double, double* %2
%11 = fcmp olt double %10, 7.000000e+00
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %28
14: ; preds = %9
%15 = load double, double* %2
%16 = fcmp oeq double %15, 7.000000e+00
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
br label %27
19: ; preds = %14
%20 = load double, double* %2
%21 = fcmp olt double %20, 1.200000e+01
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %26
24: ; preds = %19
%25 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
br label %26
26: ; preds = %24, %22
br label %27
27: ; preds = %26, %17
br label %28
28: ; preds = %27, %12
br label %29
29: ; preds = %28, %7
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [12 x i8] c"Very acidic\00"
@.str.3 = [7 x i8] c"Acidic\00"
@.str.4 = [8 x i8] c"Neutral\00"
@.str.5 = [9 x i8] c"Alkaline\00"
@.str.6 = [14 x i8] c"Very alkaline\00"
@str = [18 x i8] c"Indtast pH v\C3\A6rdi\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fcmp ugt double %5, 2.000000e+00
br i1 %6, label %7, label %14
7: ; preds = %0
%8 = fcmp olt double %5, 7.000000e+00
br i1 %8, label %14, label %9
9: ; preds = %7
%10 = fcmp oeq double %5, 7.000000e+00
br i1 %10, label %14, label %11
11: ; preds = %9
%12 = fcmp olt double %5, 1.200000e+01
%13 = select i1 %12, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0)
br label %14
14: ; preds = %11, %9, %7, %0
%15 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), %0 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), %7 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), %9 ], [ %13, %11 ]
%16 = call i32 @printf(i8* dereferenceable(1) %15)
ret i32 0
}