#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 *, int *);
int main(void) {
  int pH;
  printf("Indtast pH: \n");
  scanf("%d", &pH);
  if (pH > 7) {
    if (pH < 12)
      printf("Alkaline\n");
    else
      printf("Very alkaline\n");
  } else {
    if (pH == 7)
      printf("Neutral\n");
    else {
      if (pH > 2)
        printf("Acidic\n");
      else
        printf("Very acidic\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x7,-0x8(%rbp)
jle    1181 <main+0x61>
cmpl   $0xc,-0x8(%rbp)
jge    1170 <main+0x50>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    117c <main+0x5c>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
jmp    11cd <main+0xad>
cmpl   $0x7,-0x8(%rbp)
jne    119c <main+0x7c>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
jmp    11c8 <main+0xa8>
cmpl   $0x2,-0x8(%rbp)
jle    11b7 <main+0x97>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
jmp    11c3 <main+0xa3>
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
jmp    11c8 <main+0xa8>
jmp    11cd <main+0xad>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x8,%eax
jl     115e <main+0x3e>
cmp    $0xc,%eax
lea    0xee8(%rip),%rax
lea    0xed3(%rip),%rdi
cmovb  %rax,%rdi
jmp    1181 <main+0x61>
cmp    $0x7,%eax
jne    116c <main+0x4c>
lea    0xeb9(%rip),%rdi
jmp    1181 <main+0x61>
cmp    $0x3,%eax
lea    0xea6(%rip),%rax
lea    0xe93(%rip),%rdi
cmovge %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [13 x i8] c"Indtast pH: \00"
@str.7 = [12 x i8] c"Very acidic\00"
@str.8 = [7 x i8] c"Acidic\00"
@str.9 = [8 x i8] c"Neutral\00"
@str.10 = [14 x i8] c"Very alkaline\00"
@str.11 = [9 x i8] c"Alkaline\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 7
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = icmp ult i32 %5, 12
%9 = select i1 %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.11, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str.10, i64 0, i64 0)
br label %15
10: ; preds = %0
%11 = icmp eq i32 %5, 7
br i1 %11, label %15, label %12
12: ; preds = %10
%13 = icmp sgt i32 %5, 2
%14 = select i1 %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str.8, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.7, i64 0, i64 0)
br label %15
15: ; preds = %12, %10, %7
%16 = phi i8* [ %9, %7 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.9, i64 0, i64 0), %10 ], [ %14, %12 ]
%17 = call i32 @puts(i8* dereferenceable(1) %16)
ret i32 0
}