#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*/ __CrestApply2(int, int, long long);
int /*<<< orphan*/ __CrestBranch(int, int, int);
int /*<<< orphan*/ __CrestCall(int, int);
int /*<<< orphan*/ __CrestClearStack(int);
int /*<<< orphan*/ __CrestLoad(int, unsigned long, long long);
int /*<<< orphan*/ __CrestReturn(int);
int /*<<< orphan*/ __CrestStore(int, unsigned long);
int /*<<< orphan*/ h(int);
int /*<<< orphan*/ i(int);
int /*<<< orphan*/ printf(char const *);
void g(int a) {
  {
    __CrestCall(12, 2);
    __CrestStore(11, (unsigned long)(&a));
    __CrestLoad(13, (unsigned long)(&a), (long long)a);
    h(a);
    __CrestClearStack(14);
    {
      __CrestLoad(17, (unsigned long)(&a), (long long)a);
      __CrestLoad(16, (unsigned long)0, (long long)7);
      __CrestApply2(15, 12, (long long)(a == 7));
      if (a == 7) {
        __CrestBranch(18, 8, 1);
        printf((char const *__restrict)"7\n");
        __CrestClearStack(20);
      } else {
        __CrestBranch(19, 9, 0);
        printf((char const *__restrict)"not 7\n");
        __CrestClearStack(21);
      }
    }
    __CrestLoad(22, (unsigned long)(&a), (long long)a);
    i(a);
    __CrestClearStack(23);
    {
      __CrestReturn(24);
      return;
    }
  }
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xc,%edi
mov    $0x2,%esi
call   1090 <__CrestCall@plt>
lea    -0x4(%rbp),%rsi
mov    $0xb,%edi
call   1070 <__CrestStore@plt>
lea    -0x4(%rbp),%rsi
movslq -0x4(%rbp),%rdx
mov    $0xd,%edi
call   10a0 <__CrestLoad@plt>
mov    -0x4(%rbp),%edi
call   1040 <h@plt>
mov    $0xe,%edi
call   10c0 <__CrestClearStack@plt>
lea    -0x4(%rbp),%rsi
movslq -0x4(%rbp),%rdx
mov    $0x11,%edi
call   10a0 <__CrestLoad@plt>
mov    $0x10,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x7,%edx
call   10a0 <__CrestLoad@plt>
cmpl   $0x7,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
movslq %eax,%rdx
mov    $0xf,%edi
mov    $0xc,%esi
call   1030 <__CrestApply2@plt>
cmpl   $0x7,-0x4(%rbp)
jne    1268 <g+0xc8>
mov    $0x12,%edi
mov    $0x8,%esi
mov    $0x1,%edx
call   1060 <__CrestBranch@plt>
lea    0xdb0(%rip),%rdi
call   1050 <printf@plt>
mov    $0x14,%edi
call   10c0 <__CrestClearStack@plt>
jmp    128f <g+0xef>
mov    $0x13,%edi
mov    $0x9,%esi
xor    %edx,%edx
call   1060 <__CrestBranch@plt>
lea    0xd80(%rip),%rdi
call   1050 <printf@plt>
mov    $0x15,%edi
call   10c0 <__CrestClearStack@plt>
lea    -0x4(%rbp),%rsi
movslq -0x4(%rbp),%rdx
mov    $0x16,%edi
call   10a0 <__CrestLoad@plt>
mov    -0x4(%rbp),%edi
call   10b0 <i@plt>
mov    $0x17,%edi
call   10c0 <__CrestClearStack@plt>
mov    $0x18,%edi
call   1080 <__CrestReturn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
mov    $0xc,%edi
mov    $0x2,%esi
call   1090 <__CrestCall@plt>
lea    0xc(%rsp),%rbx
mov    $0xb,%edi
mov    %rbx,%rsi
call   1070 <__CrestStore@plt>
movslq 0xc(%rsp),%rdx
mov    $0xd,%edi
mov    %rbx,%rsi
call   10a0 <__CrestLoad@plt>
mov    0xc(%rsp),%edi
call   1050 <h@plt>
mov    $0xe,%edi
call   10c0 <__CrestClearStack@plt>
movslq 0xc(%rsp),%rdx
mov    $0x11,%edi
mov    %rbx,%rsi
call   10a0 <__CrestLoad@plt>
mov    $0x7,%edx
mov    $0x10,%edi
xor    %esi,%esi
call   10a0 <__CrestLoad@plt>
xor    %edx,%edx
cmpl   $0x7,0xc(%rsp)
sete   %dl
mov    $0xf,%edi
mov    $0xc,%esi
call   1030 <__CrestApply2@plt>
cmpl   $0x7,0xc(%rsp)
jne    1254 <g+0xb4>
mov    $0x12,%edi
mov    $0x8,%esi
mov    $0x1,%edx
call   1060 <__CrestBranch@plt>
mov    $0x14,%ebx
lea    0xdb2(%rip),%rdi
jmp    1271 <g+0xd1>
mov    $0x13,%edi
mov    $0x9,%esi
xor    %edx,%edx
call   1060 <__CrestBranch@plt>
mov    $0x15,%ebx
lea    0xd8f(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%edi
call   10c0 <__CrestClearStack@plt>
movslq 0xc(%rsp),%rdx
lea    0xc(%rsp),%rsi
mov    $0x16,%edi
call   10a0 <__CrestLoad@plt>
mov    0xc(%rsp),%edi
call   10b0 <i@plt>
mov    $0x17,%edi
call   10c0 <__CrestClearStack@plt>
mov    $0x18,%edi
call   1080 <__CrestReturn@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"7\0A\00"
@.str.1 = [7 x i8] c"not 7\0A\00"
define void @g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @__CrestCall(i32 12, i32 2)
%4 = ptrtoint i32* %2 to i64
%5 = call i32 @__CrestStore(i32 11, i64 %4)
%6 = ptrtoint i32* %2 to i64
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = call i32 @__CrestLoad(i32 13, i64 %6, i64 %8)
%10 = load i32, i32* %2
%11 = call i32 @h(i32 %10)
%12 = call i32 @__CrestClearStack(i32 14)
%13 = ptrtoint i32* %2 to i64
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = call i32 @__CrestLoad(i32 17, i64 %13, i64 %15)
%17 = call i32 @__CrestLoad(i32 16, i64 0, i64 7)
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 7
%20 = zext i1 %19 to i32
%21 = sext i32 %20 to i64
%22 = call i32 @__CrestApply2(i32 15, i32 12, i64 %21)
%23 = load i32, i32* %2
%24 = icmp eq i32 %23, 7
br i1 %24, label %25, label %29
25: ; preds = %1
%26 = call i32 @__CrestBranch(i32 18, i32 8, i32 1)
%27 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%28 = call i32 @__CrestClearStack(i32 20)
br label %33
29: ; preds = %1
%30 = call i32 @__CrestBranch(i32 19, i32 9, i32 0)
%31 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%32 = call i32 @__CrestClearStack(i32 21)
br label %33
33: ; preds = %29, %25
%34 = ptrtoint i32* %2 to i64
%35 = load i32, i32* %2
%36 = sext i32 %35 to i64
%37 = call i32 @__CrestLoad(i32 22, i64 %34, i64 %36)
%38 = load i32, i32* %2
%39 = call i32 @i(i32 %38)
%40 = call i32 @__CrestClearStack(i32 23)
%41 = call i32 @__CrestReturn(i32 24)
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"not 7\00"
@str.2 = [2 x i8] c"7\00"
define void @g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = tail call i32 @__CrestCall(i32 12, i32 2)
%4 = ptrtoint i32* %2 to i64
%5 = call i32 @__CrestStore(i32 11, i64 %4)
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = call i32 @__CrestLoad(i32 13, i64 %4, i64 %7)
%9 = load i32, i32* %2
%10 = call i32 @h(i32 %9)
%11 = call i32 @__CrestClearStack(i32 14)
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = call i32 @__CrestLoad(i32 17, i64 %4, i64 %13)
%15 = call i32 @__CrestLoad(i32 16, i64 0, i64 7)
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 7
%18 = zext i1 %17 to i64
%19 = call i32 @__CrestApply2(i32 15, i32 12, i64 %18)
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 7
br i1 %21, label %22, label %24
22: ; preds = %1
%23 = call i32 @__CrestBranch(i32 18, i32 8, i32 1)
br label %26
24: ; preds = %1
%25 = call i32 @__CrestBranch(i32 19, i32 9, i32 0)
br label %26
26: ; preds = %24, %22
%27 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), %24 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0), %22 ]
%28 = phi i32 [ 21, %24 ], [ 20, %22 ]
%29 = call i32 @puts(i8* dereferenceable(1) %27)
%30 = call i32 @__CrestClearStack(i32 %28)
%31 = load i32, i32* %2
%32 = sext i32 %31 to i64
%33 = call i32 @__CrestLoad(i32 22, i64 %4, i64 %32)
%34 = load i32, i32* %2
%35 = call i32 @i(i32 %34)
%36 = call i32 @__CrestClearStack(i32 23)
%37 = call i32 @__CrestReturn(i32 24)
ret void
}