#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*/ abort();
unsigned int my_add(unsigned int, int);
scalar_t__ my_shift(unsigned int, unsigned int);
int func_4(unsigned int p_6) {
  int count = 0;
  for (p_6 = 1; p_6 < 3; p_6 = my_add(p_6, 1)) {
    if (count++ > 1)
      abort();
    if (my_shift(p_6, p_6))
      return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<func_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jae    11a9 <func_4+0x79>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x1,%eax
jle    116e <func_4+0x3e>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <my_shift@plt>
cmp    $0x0,%rax
je     118f <func_4+0x5f>
movl   $0x0,-0x4(%rbp)
jmp    11b0 <func_4+0x80>
jmp    1194 <func_4+0x64>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1050 <my_add@plt>
mov    %eax,-0x8(%rbp)
jmp    1149 <func_4+0x19>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_4>:
push   %rbx
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <my_shift@plt>
test   %rax,%rax
jne    117a <func_4+0x4a>
mov    $0x1,%edi
mov    $0x1,%esi
call   1050 <my_add@plt>
cmp    $0x2,%eax
ja     117a <func_4+0x4a>
mov    %eax,%ebx
mov    %eax,%edi
mov    %eax,%esi
call   1040 <my_shift@plt>
test   %rax,%rax
jne    117a <func_4+0x4a>
mov    %ebx,%edi
mov    $0x1,%esi
call   1050 <my_add@plt>
cmp    $0x3,%eax
jb     117e <func_4+0x4e>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @func_4(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
store i32 1, i32* %3
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %3
%7 = icmp ult i32 %6, 3
br i1 %7, label %8, label %24
8: ; preds = %5
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 1
store i32 %10, i32* %4
%11 = icmp sgt i32 %9, 1
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %8
%15 = load i32, i32* %3
%16 = load i32, i32* %3
%17 = call i64 @my_shift(i32 %15, i32 %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 0, i32* %2
br label %25
20: ; preds = %14
br label %21
21: ; preds = %20
%22 = load i32, i32* %3
%23 = call i32 @my_add(i32 %22, i32 1)
store i32 %23, i32* %3
br label %5
24: ; preds = %5
store i32 0, i32* %2
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @func_4(i32 %0) {
%2 = tail call i64 @my_shift(i32 1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %15
4: ; preds = %12
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
%7 = tail call i32 @my_add(i32 1, i32 1)
%8 = icmp ult i32 %7, 3
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = tail call i64 @my_shift(i32 %7, i32 %7)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = tail call i32 @my_add(i32 %7, i32 1)
%14 = icmp ult i32 %13, 3
br i1 %14, label %4, label %15
15: ; preds = %12, %9, %6, %1
ret i32 0
}