#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);
void editCount(int *count, int value) {
  if ((value > 2) && (value < 7)) {
    *count = *count + 1;
  } else if (value == 10) {
    *count = *count - 1;
  }
  printf("Current count: %i\n", *count);
}


x86 assembly (clang, -O0):
<editCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jle    1147 <editCount+0x37>
cmpl   $0x7,-0xc(%rbp)
jge    1147 <editCount+0x37>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    1165 <editCount+0x55>
cmpl   $0xa,-0xc(%rbp)
jne    1160 <editCount+0x50>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    1165 <editCount+0x55>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<editCount>:
mov    %esi,%eax
lea    -0x3(%rax),%ecx
cmp    $0x3,%ecx
ja     1121 <editCount+0x11>
mov    (%rdi),%esi
add    $0x1,%esi
jmp    112b <editCount+0x1b>
mov    (%rdi),%esi
cmp    $0xa,%eax
jne    112d <editCount+0x1d>
add    $0xffffffff,%esi
mov    %esi,(%rdi)
lea    0xecc(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"Current count: %i\0A\00"
define void @editCount(i32* nocapture %0, i32 %1) {
%3 = add i32 %1, -3
%4 = icmp ult i32 %3, 4
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* %0
%7 = add nsw i32 %6, 1
br label %13
8: ; preds = %2
%9 = icmp eq i32 %1, 10
%10 = load i32, i32* %0
br i1 %9, label %11, label %15
11: ; preds = %8
%12 = add nsw i32 %10, -1
br label %13
13: ; preds = %5, %11
%14 = phi i32 [ %12, %11 ], [ %7, %5 ]
store i32 %14, i32* %0
br label %15
15: ; preds = %13, %8
%16 = phi i32 [ %10, %8 ], [ %14, %13 ]
%17 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %16)
ret void
}