#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("Enter a pH value from 0-14 rounded to the nearest integer: ");
  scanf("%d", &pH);
  if (pH > 7) {
    if (pH < 12) {
      printf("alkaline");
    } else {
      printf("very alkaline");
    }
  } else {
    if (pH == 7) {
      printf("neutral");
    } else if (pH > 2) {
      printf("acidic");
    } else
      printf("very acidic");
  }
  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    0xefa(%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    0xede(%rip),%rdi
call   1030 <printf@plt>
jmp    117c <main+0x5c>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
jmp    11cd <main+0xad>
cmpl   $0x7,-0x8(%rbp)
jne    119c <main+0x7c>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
jmp    11c8 <main+0xa8>
cmpl   $0x2,-0x8(%rbp)
jle    11b7 <main+0x97>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
jmp    11c3 <main+0xa3>
lea    0xe97(%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    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xf08(%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    0xef3(%rip),%rax
lea    0xee7(%rip),%rdi
cmovb  %rax,%rdi
jmp    1181 <main+0x61>
cmp    $0x7,%eax
jne    116c <main+0x4c>
lea    0xee3(%rip),%rdi
jmp    1181 <main+0x61>
cmp    $0x3,%eax
lea    0xee4(%rip),%rax
lea    0xed8(%rip),%rdi
cmovge %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [60 x i8] c"Enter a pH value from 0-14 rounded to the nearest integer: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [9 x i8] c"alkaline\00"
@.str.3 = [14 x i8] c"very alkaline\00"
@.str.4 = [8 x i8] c"neutral\00"
@.str.5 = [7 x i8] c"acidic\00"
@.str.6 = [12 x i8] c"very acidic\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 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 ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %14
12: ; preds = %7
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 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 ([8 x i8], [8 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 ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %27
25: ; preds = %20
%26 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 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 = [60 x i8] c"Enter a pH value from 0-14 rounded to the nearest integer: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [9 x i8] c"alkaline\00"
@.str.3 = [14 x i8] c"very alkaline\00"
@.str.4 = [8 x i8] c"neutral\00"
@.str.5 = [7 x i8] c"acidic\00"
@.str.6 = [12 x i8] c"very acidic\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 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.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, 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.5, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, 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.4, i64 0, i64 0), %10 ], [ %14, %12 ]
%17 = call i32 @printf(i8* dereferenceable(1) %16)
ret i32 0
}