#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 */
typedef int int8_t;

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int8_t supplyAdequacyCheck(int a[5]) {
  for (int i = 0; i < 4; i++) {
    if (i == 3 && a[i] <= 12) {
      puts("YOU'D BETTER DO SOME HUNTING OR BUY FOOD AND SOON!!!!");
    }
    if (a[i] <= 0) {
      a[i] = 0;
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<supplyAdequacyCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1195 <supplyAdequacyCheck+0x85>
cmpl   $0x3,-0x14(%rbp)
jne    1155 <supplyAdequacyCheck+0x45>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0xc,(%rax,%rcx,4)
jg     1155 <supplyAdequacyCheck+0x45>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jg     1182 <supplyAdequacyCheck+0x72>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
movl   $0x0,-0x4(%rbp)
jmp    119c <supplyAdequacyCheck+0x8c>
jmp    1187 <supplyAdequacyCheck+0x77>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <supplyAdequacyCheck+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<supplyAdequacyCheck>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
cmpl   $0x0,(%rdi)
jle    1159 <supplyAdequacyCheck+0x49>
cmpl   $0x0,0x4(%rbx)
jle    114d <supplyAdequacyCheck+0x3d>
cmpl   $0x0,0x8(%rbx)
jle    1154 <supplyAdequacyCheck+0x44>
mov    $0x1,%ebp
cmpl   $0xc,0xc(%rbx)
jg     1162 <supplyAdequacyCheck+0x52>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,0xc(%rbx)
jg     1162 <supplyAdequacyCheck+0x52>
mov    $0x3,%eax
jmp    1159 <supplyAdequacyCheck+0x49>
mov    $0x1,%eax
jmp    1159 <supplyAdequacyCheck+0x49>
mov    $0x2,%eax
movl   $0x0,(%rbx,%rax,4)
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [54 x i8] c"YOU'D BETTER DO SOME HUNTING OR BUY FOOD AND SOON!!!!\00"
define i32 @supplyAdequacyCheck(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 0, i32* %4
br label %5
5: ; preds = %33, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %36
8: ; preds = %5
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 3
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = icmp sle i32 %16, 12
br i1 %17, label %18, label %20
18: ; preds = %11
%19 = call i32 @puts(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18, %11, %8
%21 = load i32*, i32** %3
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
%25 = load i32, i32* %24
%26 = icmp sle i32 %25, 0
br i1 %26, label %27, label %32
27: ; preds = %20
%28 = load i32*, i32** %3
%29 = load i32, i32* %4
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
store i32 0, i32* %31
store i32 0, i32* %2
br label %37
32: ; preds = %20
br label %33
33: ; preds = %32
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %5
36: ; preds = %5
store i32 1, i32* %2
br label %37
37: ; preds = %36, %27
%38 = load i32, i32* %2
ret i32 %38
}

LLVM IR (-O2):
@.str = [54 x i8] c"YOU'D BETTER DO SOME HUNTING OR BUY FOOD AND SOON!!!!\00"
define i32 @supplyAdequacyCheck(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %0
%4 = icmp slt i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %19, %12, %8, %1
%6 = phi i64 [ 0, %1 ], [ 1, %8 ], [ 2, %12 ], [ 3, %19 ]
%7 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 0, i32* %7
br label %23
8: ; preds = %1
%9 = getelementptr inbounds i32, i32* %0, i64 1
%10 = load i32, i32* %9
%11 = icmp slt i32 %10, 1
br i1 %11, label %5, label %12
12: ; preds = %8
%13 = getelementptr inbounds i32, i32* %0, i64 2
%14 = load i32, i32* %13
%15 = icmp slt i32 %14, 1
br i1 %15, label %5, label %16
16: ; preds = %12
%17 = load i32, i32* %2
%18 = icmp slt i32 %17, 13
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%21 = load i32, i32* %2
%22 = icmp slt i32 %21, 1
br i1 %22, label %5, label %23
23: ; preds = %16, %19, %5
%24 = phi i32 [ 0, %5 ], [ 1, %19 ], [ 1, %16 ]
ret i32 %24
}