#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*/ __CrestCall(int, int);
int /*<<< orphan*/ __CrestHandleReturn(int, long long);
int /*<<< orphan*/ __CrestLoad(int, unsigned long, long long);
int /*<<< orphan*/ __CrestReturn(int);
int /*<<< orphan*/ __CrestStore(int, unsigned long);
int inc(int);
int mult(int y) {
  {
    __CrestCall(10, 2);
    __CrestStore(9, (unsigned long)(&y));
    __CrestLoad(13, (unsigned long)0, (long long)6);
    __CrestLoad(12, (unsigned long)(&y), (long long)y);
    __CrestApply2(11, 2, (long long)(6 * y));
    __CrestStore(14, (unsigned long)(&y));
    y = 6 * y;
    __CrestLoad(15, (unsigned long)(&y), (long long)y);
    y = inc(y);
    __CrestHandleReturn(17, (long long)y);
    __CrestStore(16, (unsigned long)(&y));
    {
      __CrestLoad(18, (unsigned long)(&y), (long long)y);
      __CrestReturn(19);
      return (y);
    }
  }
}


x86 assembly (clang, -O0):
<mult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xa,%edi
mov    $0x2,%esi
call   1060 <__CrestCall@plt>
lea    -0x4(%rbp),%rsi
mov    $0x9,%edi
call   1040 <__CrestStore@plt>
mov    $0xd,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x6,%edx
call   1070 <__CrestLoad@plt>
lea    -0x4(%rbp),%rsi
movslq -0x4(%rbp),%rdx
mov    $0xc,%edi
call   1070 <__CrestLoad@plt>
imul   $0x6,-0x4(%rbp),%eax
movslq %eax,%rdx
mov    $0xb,%edi
mov    $0x2,%esi
call   1030 <__CrestApply2@plt>
lea    -0x4(%rbp),%rsi
mov    $0xe,%edi
call   1040 <__CrestStore@plt>
imul   $0x6,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rsi
movslq -0x4(%rbp),%rdx
mov    $0xf,%edi
call   1070 <__CrestLoad@plt>
mov    -0x4(%rbp),%edi
call   1090 <inc@plt>
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rsi
mov    $0x11,%edi
call   1080 <__CrestHandleReturn@plt>
lea    -0x4(%rbp),%rsi
mov    $0x10,%edi
call   1040 <__CrestStore@plt>
lea    -0x4(%rbp),%rsi
movslq -0x4(%rbp),%rdx
mov    $0x12,%edi
call   1070 <__CrestLoad@plt>
mov    $0x13,%edi
call   1050 <__CrestReturn@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
mov    $0xa,%edi
mov    $0x2,%esi
call   1060 <__CrestCall@plt>
lea    0xc(%rsp),%rbx
mov    $0x9,%edi
mov    %rbx,%rsi
call   1040 <__CrestStore@plt>
mov    $0x6,%edx
mov    $0xd,%edi
xor    %esi,%esi
call   1070 <__CrestLoad@plt>
movslq 0xc(%rsp),%rdx
mov    $0xc,%edi
mov    %rbx,%rsi
call   1070 <__CrestLoad@plt>
movslq 0xc(%rsp),%rax
add    %rax,%rax
lea    (%rax,%rax,2),%rdx
mov    $0xb,%edi
mov    $0x2,%esi
call   1030 <__CrestApply2@plt>
mov    $0xe,%edi
mov    %rbx,%rsi
call   1040 <__CrestStore@plt>
movslq 0xc(%rsp),%rax
add    %rax,%rax
lea    (%rax,%rax,2),%rdx
mov    %edx,0xc(%rsp)
mov    $0xf,%edi
mov    %rbx,%rsi
call   1070 <__CrestLoad@plt>
mov    0xc(%rsp),%edi
call   1090 <inc@plt>
mov    %eax,0xc(%rsp)
movslq %eax,%rsi
mov    $0x11,%edi
call   1080 <__CrestHandleReturn@plt>
mov    $0x10,%edi
mov    %rbx,%rsi
call   1040 <__CrestStore@plt>
movslq 0xc(%rsp),%rdx
mov    $0x12,%edi
mov    %rbx,%rsi
call   1070 <__CrestLoad@plt>
mov    $0x13,%edi
call   1050 <__CrestReturn@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mult(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @__CrestCall(i32 10, i32 2)
%4 = ptrtoint i32* %2 to i64
%5 = call i32 @__CrestStore(i32 9, i64 %4)
%6 = call i32 @__CrestLoad(i32 13, i64 0, i64 6)
%7 = ptrtoint i32* %2 to i64
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = call i32 @__CrestLoad(i32 12, i64 %7, i64 %9)
%11 = load i32, i32* %2
%12 = mul nsw i32 6, %11
%13 = sext i32 %12 to i64
%14 = call i32 @__CrestApply2(i32 11, i32 2, i64 %13)
%15 = ptrtoint i32* %2 to i64
%16 = call i32 @__CrestStore(i32 14, i64 %15)
%17 = load i32, i32* %2
%18 = mul nsw i32 6, %17
store i32 %18, i32* %2
%19 = ptrtoint i32* %2 to i64
%20 = load i32, i32* %2
%21 = sext i32 %20 to i64
%22 = call i32 @__CrestLoad(i32 15, i64 %19, i64 %21)
%23 = load i32, i32* %2
%24 = call i32 @inc(i32 %23)
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = sext i32 %25 to i64
%27 = call i32 @__CrestHandleReturn(i32 17, i64 %26)
%28 = ptrtoint i32* %2 to i64
%29 = call i32 @__CrestStore(i32 16, i64 %28)
%30 = ptrtoint i32* %2 to i64
%31 = load i32, i32* %2
%32 = sext i32 %31 to i64
%33 = call i32 @__CrestLoad(i32 18, i64 %30, i64 %32)
%34 = call i32 @__CrestReturn(i32 19)
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
define i32 @mult(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = tail call i32 @__CrestCall(i32 10, i32 2)
%4 = ptrtoint i32* %2 to i64
%5 = call i32 @__CrestStore(i32 9, i64 %4)
%6 = call i32 @__CrestLoad(i32 13, i64 0, i64 6)
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = call i32 @__CrestLoad(i32 12, i64 %4, i64 %8)
%10 = load i32, i32* %2
%11 = mul nsw i32 %10, 6
%12 = sext i32 %11 to i64
%13 = call i32 @__CrestApply2(i32 11, i32 2, i64 %12)
%14 = call i32 @__CrestStore(i32 14, i64 %4)
%15 = load i32, i32* %2
%16 = mul nsw i32 %15, 6
store i32 %16, i32* %2
%17 = sext i32 %16 to i64
%18 = call i32 @__CrestLoad(i32 15, i64 %4, i64 %17)
%19 = load i32, i32* %2
%20 = call i32 @inc(i32 %19)
store i32 %20, i32* %2
%21 = sext i32 %20 to i64
%22 = call i32 @__CrestHandleReturn(i32 17, i64 %21)
%23 = call i32 @__CrestStore(i32 16, i64 %4)
%24 = load i32, i32* %2
%25 = sext i32 %24 to i64
%26 = call i32 @__CrestLoad(i32 18, i64 %4, i64 %25)
%27 = call i32 @__CrestReturn(i32 19)
%28 = load i32, i32* %2
ret i32 %28
}