#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*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, int);
void check_input(int *edges) {
  for (int i = 0; i < 2; i++) {
    if (*edges < 0 || *edges > 12) {
      printf("%s %d\n", "Invalid input:", *edges);
      exit(1);
    } else {
      edges++;
    }
  }
}


x86 assembly (clang, -O0):
<check_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1199 <check_input+0x79>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jl     1157 <check_input+0x37>
mov    -0x8(%rbp),%rax
cmpl   $0xc,(%rax)
jle    117a <check_input+0x5a>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xe9c(%rip),%rdi
lea    0xe9c(%rip),%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    118b <check_input+0x6b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <check_input+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_input>:
push   %rax
mov    (%rdi),%edx
cmp    $0xd,%edx
jae    1132 <check_input+0x12>
mov    0x4(%rdi),%edx
cmp    $0xc,%edx
ja     1132 <check_input+0x12>
pop    %rax
ret
lea    0xec7(%rip),%rdi
lea    0xec7(%rip),%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s %d\0A\00"
@.str.1 = [15 x i8] c"Invalid input:\00"
define void @check_input(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %24, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %27
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = icmp slt i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i32*, i32** %2
%13 = load i32, i32* %12
%14 = icmp sgt i32 %13, 12
br i1 %14, label %15, label %20
15: ; preds = %11, %7
%16 = load i32*, i32** %2
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %11
%21 = load i32*, i32** %2
%22 = getelementptr inbounds i32, i32* %21, i32 1
store i32* %22, i32** %2
br label %23
23: ; preds = %20
br label %24
24: ; preds = %23
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %4
27: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %d\0A\00"
@.str.1 = [15 x i8] c"Invalid input:\00"
define void @check_input(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ugt i32 %2, 12
br i1 %3, label %4, label %8
4: ; preds = %8, %1
%5 = phi i32 [ %2, %1 ], [ %10, %8 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = getelementptr inbounds i32, i32* %0, i64 1
%10 = load i32, i32* %9
%11 = icmp ugt i32 %10, 12
br i1 %11, label %4, label %12
12: ; preds = %8
ret void
}