#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void *atol(char *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int init_soundcard(long, int, int);
int read(int, unsigned char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdout;
scalar_t__ strcmp(char *, char *);
char *strerror(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int sample_size = 8;
  long sample_rate = 8000;
  int channels = 1;
  FILE *fp;
  char *filename;
  int snd;
  int to_quit, recordig;
  int records;
  int rd;
  int at;
  unsigned char buf[1024];
  if (argc < 2) {
    fprintf(stderr, "usage: %s filename [sample_rate] [sample_size]\n",
            argv[0]);
    exit(1);
  }
  filename = argv[1];
  if (strcmp(filename, "-") == 0)
    fp = stdout;
  else if ((fp = fopen(filename, "wb")) == NULL) {
    fprintf(stderr, "%s: Could not open `%s', %s\n", argv[0], filename,
            strerror(errno));
    exit(1);
  }
  if (argc > 2) {
    sample_rate = atol(argv[2]);
    if (sample_rate < 4000 || sample_rate > 41000) {
      fprintf(stderr, "%s: Illegal sample rate: %s\n", argv[0], argv[2]);
      exit(1);
    }
  }
  if (argc > 3) {
    sample_size = atol(argv[3]);
    if (sample_size != 8 && sample_size != 16) {
      fprintf(stderr, "%s: Illegal sample size: %s\n", argv[0], argv[3]);
      exit(1);
    }
  }
  snd = init_soundcard(sample_rate, sample_size, channels);
  to_quit = 0;
  recordig = 1;
  records = 0;
  do {
    for (at = 0; at < 1024; at += rd) {
      rd = read(snd, buf + at, 1024 - at);
      if (rd < 0) {
        fprintf(stderr, "\nError on soundcard: %s\n", strerror(errno));
        exit(1);
      }
    }
    fwrite(buf, 1, 1024, fp);
    records++;
  } while (!to_quit);
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x470,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x8,-0x14(%rbp)
movq   $0x1f40,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1201 <main+0x61>
mov    0x2e00(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe10(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xe18(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    123a <main+0x9a>
mov    0x2da2(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    12c2 <main+0x122>
mov    -0x38(%rbp),%rdi
lea    0xded(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    12bd <main+0x11d>
mov    0x2d81(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x464(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x460(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x458(%rbp)
mov    0x2d51(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x464(%rbp),%edi
mov    -0x460(%rbp),%rdx
mov    -0x458(%rbp),%rcx
mov    %rax,%r8
lea    0xd89(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
jmp    12c2 <main+0x122>
cmpl   $0x2,-0x8(%rbp)
jle    132e <main+0x18e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1080 <atol@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0xfa0,-0x20(%rbp)
jl     12f9 <main+0x159>
cmpq   $0xa028,-0x20(%rbp)
jle    1329 <main+0x189>
mov    0x2ce0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xd3a(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
jmp    132e <main+0x18e>
cmpl   $0x3,-0x8(%rbp)
jle    1391 <main+0x1f1>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1080 <atol@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
je     138c <main+0x1ec>
cmpl   $0x10,-0x14(%rbp)
je     138c <main+0x1ec>
mov    0x2c7d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rcx
lea    0xcf4(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
jmp    1391 <main+0x1f1>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x24(%rbp),%edx
call   1030 <init_soundcard@plt>
mov    %eax,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x1,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x50(%rbp)
cmpl   $0x400,-0x50(%rbp)
jge    1448 <main+0x2a8>
mov    -0x3c(%rbp),%edi
lea    -0x450(%rbp),%rsi
movslq -0x50(%rbp),%rax
add    %rax,%rsi
mov    $0x400,%edx
sub    -0x50(%rbp),%edx
call   1050 <read@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
jge    1435 <main+0x295>
mov    0x2be2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x468(%rbp)
mov    0x2bcb(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x468(%rbp),%edi
mov    %rax,%rdx
lea    0xc68(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
jmp    143a <main+0x29a>
mov    -0x4c(%rbp),%eax
add    -0x50(%rbp),%eax
mov    %eax,-0x50(%rbp)
jmp    13bf <main+0x21f>
lea    -0x450(%rbp),%rdi
mov    -0x30(%rbp),%rcx
mov    $0x1,%esi
mov    $0x400,%edx
call   10b0 <fwrite@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
cmpl   $0x0,-0x40(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    13b8 <main+0x218>
mov    -0x30(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x470,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x408,%rsp
mov    %rsi,%r14
cmp    $0x1,%edi
jg     11c1 <main+0x31>
mov    0x2e30(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
lea    0xe44(%rip),%rsi
jmp    130f <main+0x17f>
mov    %edi,%ebp
mov    0x8(%r14),%r15
lea    0xe62(%rip),%rsi
mov    %r15,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    11e7 <main+0x57>
mov    0x2dee(%rip),%rax
mov    (%rax),%r13
jmp    123b <main+0xab>
lea    0xe44(%rip),%rsi
mov    %r15,%rdi
call   1080 <fopen@plt>
mov    %rax,%r13
test   %rax,%rax
jne    123b <main+0xab>
mov    0x2ddb(%rip),%rax
mov    (%rax),%ebx
mov    (%r14),%rbp
mov    0x2dc7(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
lea    0xe16(%rip),%rsi
mov    %ebx,%edi
mov    %rbp,%rdx
mov    %r15,%rcx
mov    %rax,%r8
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    $0x8,%r15d
mov    $0x1f40,%r12d
cmp    $0x3,%ebp
jb     1297 <main+0x107>
mov    0x10(%r14),%rbx
mov    %rbx,%rdi
call   1070 <atol@plt>
cmp    $0xfa0,%rax
jl     1320 <main+0x190>
mov    %rax,%r12
cmp    $0xa029,%rax
jge    1320 <main+0x190>
cmp    $0x4,%ebp
jb     1297 <main+0x107>
mov    0x18(%r14),%rbx
mov    %rbx,%rdi
call   1070 <atol@plt>
mov    %rax,%r15
cmp    $0x8,%r15d
je     1297 <main+0x107>
cmp    $0x10,%r15d
jne    1347 <main+0x1b7>
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x1,%edx
call   1030 <init_soundcard@plt>
mov    %eax,%ebp
xor    %ebx,%ebx
mov    %rsp,%r14
xchg   %ax,%ax
movslq %ebx,%rax
lea    (%rsp,%rax,1),%rsi
mov    $0x400,%edx
sub    %eax,%edx
mov    %ebp,%edi
call   1040 <read@plt>
test   %eax,%eax
js     12ec <main+0x15c>
add    %eax,%ebx
cmp    $0x3ff,%ebx
jle    12b0 <main+0x120>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x400,%edx
mov    %r13,%rcx
call   10a0 <fwrite@plt>
xor    %ebx,%ebx
jmp    12b0 <main+0x120>
mov    0x2ced(%rip),%rax
mov    (%rax),%ebx
mov    0x2cdc(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
lea    0xd82(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    0x2cb9(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
lea    0xd1f(%rip),%rsi
mov    %rbx,%rcx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    0x2c92(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
lea    0xd15(%rip),%rsi
jmp    1333 <main+0x1a3>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"usage: %s filename [sample_rate] [sample_size]\0A\00"
@.str.1 = [2 x i8] c"-\00"
@stdout = global i32* null
@.str.2 = [3 x i8] c"wb\00"
@.str.3 = [29 x i8] c"%s: Could not open `%s', %s\0A\00"
@errno = global i32 0
@.str.4 = [29 x i8] c"%s: Illegal sample rate: %s\0A\00"
@.str.5 = [29 x i8] c"%s: Illegal sample size: %s\0A\00"
@.str.6 = [25 x i8] c"\0AError on soundcard: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca [1024 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 8, i32* %6
store i64 8000, i64* %7
store i32 1, i32* %8
%18 = load i32, i32* %4
%19 = icmp slt i32 %18, 2
br i1 %19, label %20, label %27
20: ; preds = %2
%21 = load i32, i32* @stderr
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = call i32 @exit(i32 1)
unreachable
27: ; preds = %2
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
store i8* %30, i8** %10
%31 = load i8*, i8** %10
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %27
%35 = load i32*, i32** @stdout
store i32* %35, i32** %9
br label %51
36: ; preds = %27
%37 = load i8*, i8** %10
%38 = call i32* @fopen(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %38, i32** %9
%39 = icmp eq i32* %38, null
br i1 %39, label %40, label %50
40: ; preds = %36
%41 = load i32, i32* @stderr
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 0
%44 = load i8*, i8** %43
%45 = load i8*, i8** %10
%46 = load i32, i32* @errno
%47 = call i8* @strerror(i32 %46)
%48 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* %44, i8* %45, i8* %47)
%49 = call i32 @exit(i32 1)
unreachable
50: ; preds = %36
br label %51
51: ; preds = %50, %34
%52 = load i32, i32* %4
%53 = icmp sgt i32 %52, 2
br i1 %53, label %54, label %76
54: ; preds = %51
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 2
%57 = load i8*, i8** %56
%58 = call i8* @atol(i8* %57)
%59 = ptrtoint i8* %58 to i64
store i64 %59, i64* %7
%60 = load i64, i64* %7
%61 = icmp slt i64 %60, 4000
br i1 %61, label %65, label %62
62: ; preds = %54
%63 = load i64, i64* %7
%64 = icmp sgt i64 %63, 41000
br i1 %64, label %65, label %75
65: ; preds = %62, %54
%66 = load i32, i32* @stderr
%67 = load i8**, i8*** %5
%68 = getelementptr inbounds i8*, i8** %67, i64 0
%69 = load i8*, i8** %68
%70 = load i8**, i8*** %5
%71 = getelementptr inbounds i8*, i8** %70, i64 2
%72 = load i8*, i8** %71
%73 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %69, i8* %72)
%74 = call i32 @exit(i32 1)
unreachable
75: ; preds = %62
br label %76
76: ; preds = %75, %51
%77 = load i32, i32* %4
%78 = icmp sgt i32 %77, 3
br i1 %78, label %79, label %101
79: ; preds = %76
%80 = load i8**, i8*** %5
%81 = getelementptr inbounds i8*, i8** %80, i64 3
%82 = load i8*, i8** %81
%83 = call i8* @atol(i8* %82)
%84 = ptrtoint i8* %83 to i32
store i32 %84, i32* %6
%85 = load i32, i32* %6
%86 = icmp ne i32 %85, 8
br i1 %86, label %87, label %100
87: ; preds = %79
%88 = load i32, i32* %6
%89 = icmp ne i32 %88, 16
br i1 %89, label %90, label %100
90: ; preds = %87
%91 = load i32, i32* @stderr
%92 = load i8**, i8*** %5
%93 = getelementptr inbounds i8*, i8** %92, i64 0
%94 = load i8*, i8** %93
%95 = load i8**, i8*** %5
%96 = getelementptr inbounds i8*, i8** %95, i64 3
%97 = load i8*, i8** %96
%98 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %91, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i8* %94, i8* %97)
%99 = call i32 @exit(i32 1)
unreachable
100: ; preds = %87, %79
br label %101
101: ; preds = %100, %76
%102 = load i64, i64* %7
%103 = load i32, i32* %6
%104 = load i32, i32* %8
%105 = call i32 @init_soundcard(i64 %102, i32 %103, i32 %104)
store i32 %105, i32* %11
store i32 0, i32* %12
store i32 1, i32* %13
store i32 0, i32* %14
br label %106
106: ; preds = %138, %101
store i32 0, i32* %16
br label %107
107: ; preds = %128, %106
%108 = load i32, i32* %16
%109 = icmp slt i32 %108, 1024
br i1 %109, label %110, label %132
110: ; preds = %107
%111 = load i32, i32* %11
%112 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%113 = load i32, i32* %16
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds i8, i8* %112, i64 %114
%116 = load i32, i32* %16
%117 = sub nsw i32 1024, %116
%118 = call i32 @read(i32 %111, i8* %115, i32 %117)
store i32 %118, i32* %15
%119 = load i32, i32* %15
%120 = icmp slt i32 %119, 0
br i1 %120, label %121, label %127
121: ; preds = %110
%122 = load i32, i32* @stderr
%123 = load i32, i32* @errno
%124 = call i8* @strerror(i32 %123)
%125 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %122, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i8* %124)
%126 = call i32 @exit(i32 1)
unreachable
127: ; preds = %110
br label %128
128: ; preds = %127
%129 = load i32, i32* %15
%130 = load i32, i32* %16
%131 = add nsw i32 %130, %129
store i32 %131, i32* %16
br label %107
132: ; preds = %107
%133 = getelementptr inbounds [1024 x i8], [1024 x i8]* %17, i64 0, i64 0
%134 = load i32*, i32** %9
%135 = call i32 @fwrite(i8* %133, i32 1, i32 1024, i32* %134)
%136 = load i32, i32* %14
%137 = add nsw i32 %136, 1
store i32 %137, i32* %14
br label %138
138: ; preds = %132
%139 = load i32, i32* %12
%140 = icmp ne i32 %139, 0
%141 = xor i1 %140, true
br i1 %141, label %106, label %142
142: ; preds = %138
%143 = load i32*, i32** %9
%144 = call i32 @fclose(i32* %143)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"usage: %s filename [sample_rate] [sample_size]\0A\00"
@.str.1 = [2 x i8] c"-\00"
@stdout = global i32* null
@.str.2 = [3 x i8] c"wb\00"
@.str.3 = [29 x i8] c"%s: Could not open `%s', %s\0A\00"
@errno = global i32 0
@.str.4 = [29 x i8] c"%s: Illegal sample rate: %s\0A\00"
@.str.5 = [29 x i8] c"%s: Illegal sample size: %s\0A\00"
@.str.6 = [25 x i8] c"\0AError on soundcard: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = load i32*, i32** @stdout
br label %28
18: ; preds = %11
%19 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %28
21: ; preds = %18
%22 = load i32, i32* @stderr
%23 = load i8*, i8** %1
%24 = load i32, i32* @errno
%25 = tail call i8* @strerror(i32 %24)
%26 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* %23, i8* %13, i8* %25)
%27 = tail call i32 @exit(i32 1)
unreachable
28: ; preds = %18, %16
%29 = phi i32* [ %17, %16 ], [ %19, %18 ]
%30 = icmp ugt i32 %0, 2
br i1 %30, label %31, label %57
31: ; preds = %28
%32 = getelementptr inbounds i8*, i8** %1, i64 2
%33 = load i8*, i8** %32
%34 = tail call i8* @atol(i8* %33)
%35 = ptrtoint i8* %34 to i64
%36 = icmp slt i8* %34, inttoptr (i64 4000 to i8*)
%37 = icmp sgt i8* %34, inttoptr (i64 41000 to i8*)
%38 = or i1 %36, %37
br i1 %38, label %39, label %44
39: ; preds = %31
%40 = load i32, i32* @stderr
%41 = load i8*, i8** %1
%42 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %41, i8* %33)
%43 = tail call i32 @exit(i32 1)
unreachable
44: ; preds = %31
%45 = icmp ugt i32 %0, 3
br i1 %45, label %46, label %57
46: ; preds = %44
%47 = getelementptr inbounds i8*, i8** %1, i64 3
%48 = load i8*, i8** %47
%49 = tail call i8* @atol(i8* %48)
%50 = ptrtoint i8* %49 to i64
%51 = trunc i64 %50 to i32
switch i32 %51, label %52 [
i32 16, label %57
i32 8, label %57
]
52: ; preds = %46
%53 = load i32, i32* @stderr
%54 = load i8*, i8** %1
%55 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i8* %54, i8* %48)
%56 = tail call i32 @exit(i32 1)
unreachable
57: ; preds = %28, %46, %46, %44
%58 = phi i64 [ %35, %46 ], [ %35, %44 ], [ %35, %46 ], [ 8000, %28 ]
%59 = phi i32 [ %51, %46 ], [ 8, %44 ], [ %51, %46 ], [ 8, %28 ]
%60 = tail call i32 @init_soundcard(i64 %58, i32 %59, i32 1)
br label %65
61: ; preds = %65
%62 = icmp slt i32 %72, 1024
br i1 %62, label %63, label %79
63: ; preds = %61, %79
%64 = phi i32 [ %72, %61 ], [ 0, %79 ]
br label %65
65: ; preds = %63, %57
%66 = phi i32 [ 0, %57 ], [ %64, %63 ]
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %67
%69 = sub nsw i32 1024, %66
%70 = call i32 @read(i32 %60, i8* %68, i32 %69)
%71 = icmp slt i32 %70, 0
%72 = add nsw i32 %70, %66
br i1 %71, label %73, label %61
73: ; preds = %65
%74 = load i32, i32* @stderr
%75 = load i32, i32* @errno
%76 = tail call i8* @strerror(i32 %75)
%77 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i8* %76)
%78 = tail call i32 @exit(i32 1)
unreachable
79: ; preds = %61
%80 = call i32 @fwrite(i8* %4, i32 1, i32 1024, i32* %29)
br label %63
}