#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*/ Death();
int /*<<< orphan*/ printf(char *, ...);
void HealthDamage(int p_health) {
  if (p_health <= 0) {
    Death();
  } else if (p_health > 0 && p_health <= 25) {
    printf("*** You are seriously injured! ***\n");
    printf("*** Health: %d ***\n", p_health);
    printf("\n");
  } else {
    printf("*** You are injured. ***\n");
    printf("*** Health: %d ***\n", p_health);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<HealthDamage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1141 <HealthDamage+0x21>
mov    $0x0,%al
call   1040 <Death@plt>
jmp    11b9 <HealthDamage+0x99>
cmpl   $0x0,-0x4(%rbp)
jle    1187 <HealthDamage+0x67>
cmpl   $0x19,-0x4(%rbp)
jg     1187 <HealthDamage+0x67>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b4 <HealthDamage+0x94>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b9 <HealthDamage+0x99>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HealthDamage>:
push   %rbx
test   %edi,%edi
jle    1155 <HealthDamage+0x15>
mov    %edi,%ebx
cmp    $0x19,%edi
ja     115d <HealthDamage+0x1d>
lea    0xeda(%rip),%rdi
jmp    1164 <HealthDamage+0x24>
xor    %eax,%eax
pop    %rbx
jmp    1060 <Death@plt>
lea    0xeb0(%rip),%rdi
call   1040 <puts@plt>
lea    0xe90(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"*** You are seriously injured! ***\0A\00"
@.str.1 = [20 x i8] c"*** Health: %d ***\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [26 x i8] c"*** You are injured. ***\0A\00"
define void @HealthDamage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @Death()
br label %24
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp sle i32 %11, 25
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %23
18: ; preds = %10, %7
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%20 = load i32, i32* %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %23
23: ; preds = %18, %13
br label %24
24: ; preds = %23, %5
ret void
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"*** Health: %d ***\0A\00"
@str = [25 x i8] c"*** You are injured. ***\00"
@str.4 = [35 x i8] c"*** You are seriously injured! ***\00"
define void @HealthDamage(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @Death()
br label %15
5: ; preds = %1
%6 = icmp ult i32 %0, 26
br i1 %6, label %7, label %11
7: ; preds = %5
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.4, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%10 = tail call i32 @putchar(i32 10)
br label %15
11: ; preds = %5
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%14 = tail call i32 @putchar(i32 10)
br label %15
15: ; preds = %7, %11, %3
ret void
}