#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 */
struct account {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ account_deposit(struct account *, int);
int /*<<< orphan*/ account_dispose(struct account *);
int account_get_balance(struct account *);
int account_withdraw(struct account *, int);
int /*<<< orphan*/ assert(int);
struct account *create_account(int);
int main() {
  struct account *myAccount = create_account(-100);
  account_deposit(myAccount, 200);
  int w1 = account_withdraw(myAccount, 50);
  assert(w1 == 50);
  int b1 = account_get_balance(myAccount);
  assert(b1 == 150);
  int w2 = account_withdraw(myAccount, 300);
  assert(w2 == 250);
  int b2 = account_get_balance(myAccount);
  assert(b2 == -100);
  account_dispose(myAccount);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffffff9c,%edi
call   1030 <create_account@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xc8,%esi
call   1080 <account_deposit@plt>
mov    -0x10(%rbp),%rdi
mov    $0x32,%esi
call   1060 <account_withdraw@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x32,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1040 <account_get_balance@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x96,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    $0x12c,%esi
call   1060 <account_withdraw@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xfa,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1040 <account_get_balance@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffff9c,-0x20(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1070 <account_dispose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffff9c,%edi
call   1030 <create_account@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xc8,%esi
call   1080 <account_deposit@plt>
mov    %rbx,%rdi
mov    $0x32,%esi
call   1060 <account_withdraw@plt>
xor    %edi,%edi
cmp    $0x32,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1040 <account_get_balance@plt>
xor    %edi,%edi
cmp    $0x96,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
mov    $0x12c,%esi
call   1060 <account_withdraw@plt>
xor    %edi,%edi
cmp    $0xfa,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1040 <account_get_balance@plt>
xor    %edi,%edi
cmp    $0xffffff9c,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1070 <account_dispose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.account = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.account*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call %struct.account* @create_account(i32 -100)
store %struct.account* %7, %struct.account** %2
%8 = load %struct.account*, %struct.account** %2
%9 = call i32 @account_deposit(%struct.account* %8, i32 200)
%10 = load %struct.account*, %struct.account** %2
%11 = call i32 @account_withdraw(%struct.account* %10, i32 50)
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 50
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load %struct.account*, %struct.account** %2
%17 = call i32 @account_get_balance(%struct.account* %16)
store i32 %17, i32* %4
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 150
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = load %struct.account*, %struct.account** %2
%23 = call i32 @account_withdraw(%struct.account* %22, i32 300)
store i32 %23, i32* %5
%24 = load i32, i32* %5
%25 = icmp eq i32 %24, 250
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
%28 = load %struct.account*, %struct.account** %2
%29 = call i32 @account_get_balance(%struct.account* %28)
store i32 %29, i32* %6
%30 = load i32, i32* %6
%31 = icmp eq i32 %30, -100
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
%34 = load %struct.account*, %struct.account** %2
%35 = call i32 @account_dispose(%struct.account* %34)
ret i32 0
}

LLVM IR (-O2):
%struct.account = type { i32 }
define i32 @main() {
%1 = tail call %struct.account* @create_account(i32 -100)
%2 = tail call i32 @account_deposit(%struct.account* %1, i32 200)
%3 = tail call i32 @account_withdraw(%struct.account* %1, i32 50)
%4 = icmp eq i32 %3, 50
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @account_get_balance(%struct.account* %1)
%8 = icmp eq i32 %7, 150
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @account_withdraw(%struct.account* %1, i32 300)
%12 = icmp eq i32 %11, 250
%13 = zext i1 %12 to i32
%14 = tail call i32 @assert(i32 %13)
%15 = tail call i32 @account_get_balance(%struct.account* %1)
%16 = icmp eq i32 %15, -100
%17 = zext i1 %16 to i32
%18 = tail call i32 @assert(i32 %17)
%19 = tail call i32 @account_dispose(%struct.account* %1)
ret i32 0
}