#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 */
unsigned char ieee_p_2592010699_sub_381452733968206518_503743352(char *,
                                                                 unsigned char);
unsigned char xsi_signal_has_event(char *);
char *xsi_signal_last_value(char *);
unsigned char ieee_p_2592010699_sub_13554554585326073636_503743352(
    char *t1, char *t2, unsigned int t3, unsigned int t4) {
  unsigned char t0;
  unsigned char t7;
  unsigned char t8;
  unsigned char t9;
  char *t10;
  char *t11;
  unsigned char t12;
  unsigned char t13;
  unsigned char t14;
  unsigned char t15;
  unsigned char t16;
  unsigned char t17;
LAB0:
  t9 = xsi_signal_has_event(t2);
  if (t9 == 1)
    goto LAB5;
LAB6:
  t8 = (unsigned char)0;
LAB7:
  if (t8 == 1)
    goto LAB2;
LAB3:
  t7 = (unsigned char)0;
LAB4:
  t0 = t7;
LAB1:
  return t0;
LAB2:
  t11 = xsi_signal_last_value(t2);
  t15 = *((unsigned char *)t11);
  t16 = ieee_p_2592010699_sub_381452733968206518_503743352(t1, t15);
  t17 = (t16 == (unsigned char)3);
  t7 = t17;
  goto LAB4;
LAB5:
  t10 = (t2 + 40U);
  t11 = *((char **)t10);
  t10 = (t11 + t4);
  t12 = *((unsigned char *)t10);
  t13 = ieee_p_2592010699_sub_381452733968206518_503743352(t1, t12);
  t14 = (t13 == (unsigned char)2);
  t8 = t14;
  goto LAB7;
LAB8:;
}


x86 assembly (clang, -O0):
<ieee_p_2592010699_sub_13554554585326073636_503743352>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <xsi_signal_has_event@plt>
mov    %al,-0x24(%rbp)
movzbl -0x24(%rbp),%eax
cmp    $0x1,%eax
jne    1164 <ieee_p_2592010699_sub_13554554585326073636_503743352+0x34>
jmp    11dc <ieee_p_2592010699_sub_13554554585326073636_503743352+0xac>
jmp    1169 <ieee_p_2592010699_sub_13554554585326073636_503743352+0x39>
movb   $0x0,-0x23(%rbp)
movzbl -0x23(%rbp),%eax
cmp    $0x1,%eax
jne    117f <ieee_p_2592010699_sub_13554554585326073636_503743352+0x4f>
jmp    1199 <ieee_p_2592010699_sub_13554554585326073636_503743352+0x69>
jmp    1184 <ieee_p_2592010699_sub_13554554585326073636_503743352+0x54>
movb   $0x0,-0x22(%rbp)
mov    -0x22(%rbp),%al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1237 <ieee_p_2592010699_sub_13554554585326073636_503743352+0x107>
mov    -0x18(%rbp),%rdi
call   1030 <xsi_signal_last_value@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x3c(%rbp)
mov    -0x10(%rbp),%rdi
movzbl -0x3c(%rbp),%esi
call   1040 <ieee_p_2592010699_sub_381452733968206518_503743352@plt>
mov    %al,-0x3d(%rbp)
movzbl -0x3d(%rbp),%eax
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x3e(%rbp)
mov    -0x3e(%rbp),%al
mov    %al,-0x22(%rbp)
jmp    1188 <ieee_p_2592010699_sub_13554554585326073636_503743352+0x58>
mov    -0x18(%rbp),%rax
add    $0x28,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x39(%rbp)
mov    -0x10(%rbp),%rdi
movzbl -0x39(%rbp),%esi
call   1040 <ieee_p_2592010699_sub_381452733968206518_503743352@plt>
mov    %al,-0x3a(%rbp)
movzbl -0x3a(%rbp),%eax
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x3b(%rbp)
mov    -0x3b(%rbp),%al
mov    %al,-0x23(%rbp)
jmp    116d <ieee_p_2592010699_sub_13554554585326073636_503743352+0x3d>
movzbl -0x1(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee_p_2592010699_sub_13554554585326073636_503743352>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <xsi_signal_has_event@plt>
cmp    $0x1,%al
jne    1178 <ieee_p_2592010699_sub_13554554585326073636_503743352+0x48>
mov    0x28(%rbx),%rax
mov    %ebp,%ecx
movzbl (%rax,%rcx,1),%esi
mov    %r14,%rdi
call   1040 <ieee_p_2592010699_sub_381452733968206518_503743352@plt>
cmp    $0x2,%al
jne    1178 <ieee_p_2592010699_sub_13554554585326073636_503743352+0x48>
mov    %rbx,%rdi
call   1030 <xsi_signal_last_value@plt>
movzbl (%rax),%esi
mov    %r14,%rdi
call   1040 <ieee_p_2592010699_sub_381452733968206518_503743352@plt>
cmp    $0x3,%al
sete   %al
jmp    117a <ieee_p_2592010699_sub_13554554585326073636_503743352+0x4a>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @ieee_p_2592010699_sub_13554554585326073636_503743352(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8
%17 = alloca i8
%18 = alloca i8
%19 = alloca i8
%20 = alloca i8
%21 = alloca i8
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
br label %22
22: ; preds = %4
%23 = load i8*, i8** %7
%24 = call zeroext i8 @xsi_signal_has_event(i8* %23)
store i8 %24, i8* %13
%25 = load i8, i8* %13
%26 = zext i8 %25 to i32
%27 = icmp eq i32 %26, 1
br i1 %27, label %28, label %29
28: ; preds = %22
br label %56
29: ; preds = %22
br label %30
30: ; preds = %29
store i8 0, i8* %12
br label %31
31: ; preds = %56, %30
%32 = load i8, i8* %12
%33 = zext i8 %32 to i32
%34 = icmp eq i32 %33, 1
br i1 %34, label %35, label %36
35: ; preds = %31
br label %42
36: ; preds = %31
br label %37
37: ; preds = %36
store i8 0, i8* %11
br label %38
38: ; preds = %42, %37
%39 = load i8, i8* %11
store i8 %39, i8* %10
br label %40
40: ; preds = %38
%41 = load i8, i8* %10
store i8 %41, i8* %5
br label %78
42: ; preds = %35
%43 = load i8*, i8** %7
%44 = call i8* @xsi_signal_last_value(i8* %43)
store i8* %44, i8** %15
%45 = load i8*, i8** %15
%46 = load i8, i8* %45
store i8 %46, i8* %19
%47 = load i8*, i8** %6
%48 = load i8, i8* %19
%49 = call zeroext i8 @ieee_p_2592010699_sub_381452733968206518_503743352(i8* %47, i8 zeroext %48)
store i8 %49, i8* %20
%50 = load i8, i8* %20
%51 = zext i8 %50 to i32
%52 = icmp eq i32 %51, 3
%53 = zext i1 %52 to i32
%54 = trunc i32 %53 to i8
store i8 %54, i8* %21
%55 = load i8, i8* %21
store i8 %55, i8* %11
br label %38
56: ; preds = %28
%57 = load i8*, i8** %7
%58 = getelementptr inbounds i8, i8* %57, i64 40
store i8* %58, i8** %14
%59 = load i8*, i8** %14
%60 = bitcast i8* %59 to i8**
%61 = load i8*, i8** %60
store i8* %61, i8** %15
%62 = load i8*, i8** %15
%63 = load i32, i32* %9
%64 = zext i32 %63 to i64
%65 = getelementptr inbounds i8, i8* %62, i64 %64
store i8* %65, i8** %14
%66 = load i8*, i8** %14
%67 = load i8, i8* %66
store i8 %67, i8* %16
%68 = load i8*, i8** %6
%69 = load i8, i8* %16
%70 = call zeroext i8 @ieee_p_2592010699_sub_381452733968206518_503743352(i8* %68, i8 zeroext %69)
store i8 %70, i8* %17
%71 = load i8, i8* %17
%72 = zext i8 %71 to i32
%73 = icmp eq i32 %72, 2
%74 = zext i1 %73 to i32
%75 = trunc i32 %74 to i8
store i8 %75, i8* %18
%76 = load i8, i8* %18
store i8 %76, i8* %12
br label %31
77: ; No predecessors!
br label %78
78: ; preds = %77, %40
%79 = load i8, i8* %5
ret i8 %79
}

LLVM IR (-O2):
define zeroext i8 @ieee_p_2592010699_sub_13554554585326073636_503743352(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call zeroext i8 @xsi_signal_has_event(i8* %1)
%6 = icmp eq i8 %5, 1
br i1 %6, label %15, label %7
7: ; preds = %4, %15, %9
%8 = phi i8 [ %14, %9 ], [ 0, %15 ], [ 0, %4 ]
ret i8 %8
9: ; preds = %15
%10 = tail call i8* @xsi_signal_last_value(i8* %1)
%11 = load i8, i8* %10
%12 = tail call zeroext i8 @ieee_p_2592010699_sub_381452733968206518_503743352(i8* %0, i8 zeroext %11)
%13 = icmp eq i8 %12, 3
%14 = zext i1 %13 to i8
br label %7
15: ; preds = %4
%16 = getelementptr inbounds i8, i8* %1, i64 40
%17 = bitcast i8* %16 to i8**
%18 = load i8*, i8** %17
%19 = zext i32 %3 to i64
%20 = getelementptr inbounds i8, i8* %18, i64 %19
%21 = load i8, i8* %20
%22 = tail call zeroext i8 @ieee_p_2592010699_sub_381452733968206518_503743352(i8* %0, i8 zeroext %21)
%23 = icmp eq i8 %22, 2
br i1 %23, label %9, label %7
}