#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 mb_interpreter_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int mb_attempt_func_begin(struct mb_interpreter_t *, void **);
int mb_attempt_func_end(struct mb_interpreter_t *, void **);
int /*<<< orphan*/ putchar(char);
int beep(struct mb_interpreter_t *s, void **l) {
  int result = 0;
  do {
    ((void)(s && l));
    assert(s && l);
  } while (0);
  {
    int __hr = mb_attempt_func_begin(s, l);
    if (__hr != 0) {
      return __hr;
    }
  };
  {
    int __hr = mb_attempt_func_end(s, l);
    if (__hr != 0) {
      return __hr;
    }
  };
  putchar('\a');
  return result;
}


x86 assembly (clang, -O0):
<beep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x25(%rbp)
je     1172 <beep+0x32>
cmpq   $0x0,-0x18(%rbp)
setne  %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x26(%rbp)
je     1190 <beep+0x50>
cmpq   $0x0,-0x18(%rbp)
setne  %al
mov    %al,-0x26(%rbp)
mov    -0x26(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <mb_attempt_func_begin@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     11c2 <beep+0x82>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11f7 <beep+0xb7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <mb_attempt_func_end@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     11e7 <beep+0xa7>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11f7 <beep+0xb7>
mov    $0x7,%edi
call   1030 <putchar@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beep>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <mb_attempt_func_begin@plt>
test   %eax,%eax
jne    118a <beep+0x4a>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <mb_attempt_func_end@plt>
test   %eax,%eax
jne    118a <beep+0x4a>
mov    $0x7,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.mb_interpreter_t = type { i32 }
define i32 @beep(%struct.mb_interpreter_t* %0, i8** %1) {
%3 = alloca i32
%4 = alloca %struct.mb_interpreter_t*
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.mb_interpreter_t* %0, %struct.mb_interpreter_t** %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %9
9: ; preds = %2
%10 = load %struct.mb_interpreter_t*, %struct.mb_interpreter_t** %4
%11 = icmp ne %struct.mb_interpreter_t* %10, null
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i8**, i8*** %5
%14 = icmp ne i8** %13, null
br label %15
15: ; preds = %12, %9
%16 = phi i1 [ false, %9 ], [ %14, %12 ]
%17 = zext i1 %16 to i32
%18 = load %struct.mb_interpreter_t*, %struct.mb_interpreter_t** %4
%19 = icmp ne %struct.mb_interpreter_t* %18, null
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load i8**, i8*** %5
%22 = icmp ne i8** %21, null
br label %23
23: ; preds = %20, %15
%24 = phi i1 [ false, %15 ], [ %22, %20 ]
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
br label %27
27: ; preds = %23
%28 = load %struct.mb_interpreter_t*, %struct.mb_interpreter_t** %4
%29 = load i8**, i8*** %5
%30 = call i32 @mb_attempt_func_begin(%struct.mb_interpreter_t* %28, i8** %29)
store i32 %30, i32* %7
%31 = load i32, i32* %7
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %27
%34 = load i32, i32* %7
store i32 %34, i32* %3
br label %46
35: ; preds = %27
%36 = load %struct.mb_interpreter_t*, %struct.mb_interpreter_t** %4
%37 = load i8**, i8*** %5
%38 = call i32 @mb_attempt_func_end(%struct.mb_interpreter_t* %36, i8** %37)
store i32 %38, i32* %8
%39 = load i32, i32* %8
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %35
%42 = load i32, i32* %8
store i32 %42, i32* %3
br label %46
43: ; preds = %35
%44 = call i32 @putchar(i8 signext 7)
%45 = load i32, i32* %6
store i32 %45, i32* %3
br label %46
46: ; preds = %43, %41, %33
%47 = load i32, i32* %3
ret i32 %47
}

LLVM IR (-O2):
%struct.mb_interpreter_t = type { i32 }
define i32 @beep(%struct.mb_interpreter_t* %0, i8** %1) {
%3 = icmp ne %struct.mb_interpreter_t* %0, null
%4 = icmp ne i8** %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @mb_attempt_func_begin(%struct.mb_interpreter_t* %0, i8** %1)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = tail call i32 @mb_attempt_func_end(%struct.mb_interpreter_t* %0, i8** %1)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 @putchar(i8 signext 7)
br label %15
15: ; preds = %10, %2, %13
%16 = phi i32 [ 0, %13 ], [ %11, %10 ], [ %8, %2 ]
ret i32 %16
}