#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*/ _soundinit();
int /*<<< orphan*/ _soundrec(int);
int /*<<< orphan*/ melpe_i();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ soundinit();
int /*<<< orphan*/ soundrec(int);
int audio_init(void) {
  if (!_soundinit()) {
    printf("Error of 'Line' audio device initialization, application "
           "terminated\r\n");
    return 1;
  }
  if (!soundinit()) {
    return 2;
    printf("Error of 'Headset' audio device initialization, application "
           "terminated\r\n");
  }
  printf("\r\n");
  _soundrec(1);
  soundrec(1);
  melpe_i();
  return 0;
}


x86 assembly (clang, -O0):
<audio_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <_soundinit@plt>
cmp    $0x0,%eax
jne    1190 <audio_init+0x30>
lea    0xe81(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11da <audio_init+0x7a>
mov    $0x0,%al
call   1080 <soundinit@plt>
cmp    $0x0,%eax
jne    11ac <audio_init+0x4c>
movl   $0x2,-0x4(%rbp)
jmp    11da <audio_init+0x7a>
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1030 <_soundrec@plt>
mov    $0x1,%edi
call   1050 <soundrec@plt>
mov    $0x0,%al
call   1070 <melpe_i@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audio_init>:
push   %rbx
xor    %eax,%eax
call   1060 <_soundinit@plt>
test   %eax,%eax
je     11a2 <audio_init+0x42>
xor    %ebx,%ebx
xor    %eax,%eax
call   1080 <soundinit@plt>
test   %eax,%eax
je     11b5 <audio_init+0x55>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <_soundrec@plt>
mov    $0x1,%edi
call   1050 <soundrec@plt>
xor    %eax,%eax
call   1070 <melpe_i@plt>
jmp    11ba <audio_init+0x5a>
lea    0xe57(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
jmp    11ba <audio_init+0x5a>
mov    $0x2,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [70 x i8] c"Error of 'Line' audio device initialization, application terminated\0D\0A\00"
@.str.1 = [3 x i8] c"\0D\0A\00"
define i32 @audio_init() {
%1 = alloca i32
%2 = call i32 (...) @_soundinit()
%3 = icmp ne i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %15
6: ; preds = %0
%7 = call i32 (...) @soundinit()
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %6
store i32 2, i32* %1
br label %15
10: ; preds = %6
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @_soundrec(i32 1)
%13 = call i32 @soundrec(i32 1)
%14 = call i32 (...) @melpe_i()
store i32 0, i32* %1
br label %15
15: ; preds = %10, %9, %4
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@str = [69 x i8] c"Error of 'Line' audio device initialization, application terminated\0D\00"
@str.2 = [2 x i8] c"\0D\00"
define i32 @audio_init() {
%1 = tail call i32 (...) @_soundinit()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str, i64 0, i64 0))
br label %13
5: ; preds = %0
%6 = tail call i32 (...) @soundinit()
%7 = icmp eq i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %5
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0))
%10 = tail call i32 @_soundrec(i32 1)
%11 = tail call i32 @soundrec(i32 1)
%12 = tail call i32 (...) @melpe_i()
br label %13
13: ; preds = %5, %8, %3
%14 = phi i32 [ 0, %8 ], [ 1, %3 ], [ 2, %5 ]
ret i32 %14
}