#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 */
scalar_t__ fps_should_record_wav();
scalar_t__ is_movie_mode();
scalar_t__ mlv_snd_is_enabled();
scalar_t__ raw_lv_is_enabled();
int sound_recording_enabled_canon();
int sound_recording_enabled() {
  if (fps_should_record_wav()) {
    return 1;
  }
  if (mlv_snd_is_enabled()) {
    return 1;
  }
  if (is_movie_mode() && raw_lv_is_enabled()) {
    return 0;
  }
  return sound_recording_enabled_canon();
}


x86 assembly (clang, -O0):
<sound_recording_enabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1070 <fps_should_record_wav@plt>
cmp    $0x0,%rax
je     1175 <sound_recording_enabled+0x25>
movl   $0x1,-0x4(%rbp)
jmp    11ca <sound_recording_enabled+0x7a>
mov    $0x0,%al
call   1040 <mlv_snd_is_enabled@plt>
cmp    $0x0,%rax
je     1192 <sound_recording_enabled+0x42>
movl   $0x1,-0x4(%rbp)
jmp    11ca <sound_recording_enabled+0x7a>
mov    $0x0,%al
call   1050 <is_movie_mode@plt>
cmp    $0x0,%rax
je     11c0 <sound_recording_enabled+0x70>
mov    $0x0,%al
call   1060 <raw_lv_is_enabled@plt>
cmp    $0x0,%rax
je     11c0 <sound_recording_enabled+0x70>
movl   $0x0,-0x4(%rbp)
jmp    11ca <sound_recording_enabled+0x7a>
mov    $0x0,%al
call   1030 <sound_recording_enabled_canon@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sound_recording_enabled>:
push   %rbx
xor    %eax,%eax
call   1070 <fps_should_record_wav@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    116e <sound_recording_enabled+0x1e>
xor    %eax,%eax
call   1040 <mlv_snd_is_enabled@plt>
test   %rax,%rax
je     1172 <sound_recording_enabled+0x22>
mov    %ebx,%eax
pop    %rbx
ret
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <is_movie_mode@plt>
test   %rax,%rax
je     118c <sound_recording_enabled+0x3c>
xor    %eax,%eax
call   1060 <raw_lv_is_enabled@plt>
test   %rax,%rax
jne    116e <sound_recording_enabled+0x1e>
xor    %eax,%eax
pop    %rbx
jmp    1030 <sound_recording_enabled_canon@plt>

LLVM IR (-O0):
define i32 @sound_recording_enabled() {
%1 = alloca i32
%2 = call i64 (...) @fps_should_record_wav()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %18
5: ; preds = %0
%6 = call i64 (...) @mlv_snd_is_enabled()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 1, i32* %1
br label %18
9: ; preds = %5
%10 = call i64 (...) @is_movie_mode()
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = call i64 (...) @raw_lv_is_enabled()
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 0, i32* %1
br label %18
16: ; preds = %12, %9
%17 = call i32 (...) @sound_recording_enabled_canon()
store i32 %17, i32* %1
br label %18
18: ; preds = %16, %15, %8, %4
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @sound_recording_enabled() {
%1 = tail call i64 (...) @fps_should_record_wav()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %14
3: ; preds = %0
%4 = tail call i64 (...) @mlv_snd_is_enabled()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = tail call i64 (...) @is_movie_mode()
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = tail call i64 (...) @raw_lv_is_enabled()
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9, %6
%13 = tail call i32 (...) @sound_recording_enabled_canon()
br label %14
14: ; preds = %9, %3, %0, %12
%15 = phi i32 [ %13, %12 ], [ 1, %0 ], [ 1, %3 ], [ 0, %9 ]
ret i32 %15
}