int check_mixer_ioctls(int fd_mixer) {
  int nb_err, err = 0;
  int ret, val;
  ret = ioctl(
      fd_mixer,
      ((int)(0x20000000 | ((sizeof(int) & 0x1fff) << 16) | ('M' << 8) | 0xfe)),
      &val);
  if (ret != 0) {
    printf("%s: "
           "Returned Value Error with IOCTL SOUND_MIXER_READ_DEVMASK %d\n",
           __FUNCTION__, ret);
    err++;
  }
  if (val != ((1 << 0) | (1 << 4) | (1 << 5) | (1 << 21) | (1 << 6) |
              (1 << 20) | (1 << 7))) {
    printf("%s: "
           "Error with IOCTL SOUND_MIXER_READ_DEVMASK %x\n",
           __FUNCTION__, val);
    err++;
  }
  ret = ioctl(
      fd_mixer,
      ((int)(0x20000000 | ((sizeof(int) & 0x1fff) << 16) | ('M' << 8) | 0xfd)),
      &val);
  if (ret != 0) {
    printf("%s: "
           "Returned Value Error with IOCTL SOUND_MIXER_READ_RECMASK\n",
           __FUNCTION__);
    err++;
  }
  if (val != ((1 << 6) | (1 << 20) | (1 << 7))) {
    printf("%s: "
           "Error with IOCTL SOUND_MIXER_READ_RECMASK %x\n",
           __FUNCTION__, val);
    err++;
  }
  ret = ioctl(
      fd_mixer,
      ((int)(0x20000000 | ((sizeof(int) & 0x1fff) << 16) | ('M' << 8) | 0xf9)),
      &val);
  if (ret != 0) {
    printf("%s: "
           "Returned Value Error with IOCTL SOUND_MIXER_READ_OUTMASK\n",
           __FUNCTION__);
    err++;
  }
  if (val != ((1 << 0) | (1 << 4) | (1 << 5) | (1 << 21))) {
    printf("%s: "
           "Error with IOCTL SOUND_MIXER_READ_OUTMASK\n",
           __FUNCTION__);
    err++;
  }
  ret = ioctl(
      fd_mixer,
      ((int)(0x20000000 | ((sizeof(int) & 0x1fff) << 16) | ('M' << 8) | 0xfb)),
      &val);
  if (ret != 0) {
    printf("%s: "
           "Returned Value Error with IOCTL SOUND_MIXER_READ_STEREODEVS\n",
           __FUNCTION__);
    err++;
  }
  if (val != ((1 << 0) | (1 << 20) | (1 << 4))) {
    printf("%s: "
           "Error with IOCTL SOUND_MIXER_READ_STEREODEVS\n",
           __FUNCTION__);
    err++;
  }
  ret = ioctl(
      fd_mixer,
      ((int)(0x20000000 | ((sizeof(int) & 0x1fff) << 16) | ('M' << 8) | 0xfc)),
      &val);
  if (ret != 0) {
    printf("%s: "
           "Returned Value Error with IOCTL SOUND_MIXER_READ_CAPS\n",
           __FUNCTION__);
    err++;
  }
  if (val != 0x00000001) {
    printf("%s: "
           "Error with IOCTL SOUND_MIXER_READ_CAPS\n",
           __FUNCTION__);
    err++;
  }
  ret = ioctl(
      fd_mixer,
      ((int)(0x20000000 | ((sizeof(int) & 0x1fff) << 16) | ('M' << 8) | 0xff)),
      &val);
  if (ret != 0) {
    printf("%s: "
           "Returned Value Error with IOCTL SOUND_MIXER_READ_RECSRC\n",
           __FUNCTION__);
    err++;
  }
  if ((val != (1 << 6)) && (val != (1 << 20)) && (val != (1 << 7))) {
    printf("%s: "
           "Error with IOCTL SOUND_MIXER_READ_RECSRC\n",
           __FUNCTION__);
    err++;
  }
  nb_err = set_input_device(fd_mixer, (1 << 20));
  if (nb_err) {
    printf("%s: "
           "Error with IOCTL SOUND_MIXER_WRITE_RECSRC (SOUND_MASK_PHONEIN)\n",
           __FUNCTION__);
    err += nb_err;
  }
  nb_err = set_input_device(fd_mixer, (1 << 6));
  if (nb_err) {
    printf("%s: "
           "Error with IOCTL SOUND_MIXER_WRITE_RECSRC (SOUND_MASK_LINE)\n",
           __FUNCTION__);
    err += nb_err;
  }
  nb_err = set_input_device(fd_mixer, (1 << 7));
  if (nb_err) {
    printf("%s: "
           "Error with IOCTL SOUND_MIXER_WRITE_RECSRC (SOUND_MASK_MIC)\n",
           __FUNCTION__);
    err += nb_err;
  }
  nb_err = set_input_device(fd_mixer, (1 << 20));
  if (nb_err) {
    printf("%s: "
           "Error with IOCTL SOUND_MIXER_WRITE_RECSRC (SOUND_MASK_PHONEIN)\n",
           __FUNCTION__);
    err += nb_err;
  }
  nb_err = set_input_device(fd_mixer, (1 << 20));
  if (nb_err) {
    printf("%s: "
           "Error with IOCTL SOUND_MIXER_WRITE_RECSRC (SOUND_MASK_PHONEIN)\n",
           __FUNCTION__);
    err += nb_err;
  }
  nb_err = set_output_device(fd_mixer, (1 << 0));
  if (nb_err) {
    printf("%s: "
           "Error with IOCTL SOUND_MIXER_WRITE_OUTSRC (SOUND_MASK_VOLUME) \n",
           __FUNCTION__);
    err += nb_err;
  }
  nb_err = set_output_device(fd_mixer, (1 << 4));
  if (nb_err) {
    printf("%s: "
           "Error with IOCTL SOUND_MIXER_WRITE_OUTSRC (SOUND_MASK_PCM)\n",
           __FUNCTION__);
    err += nb_err;
  }
  nb_err = set_output_device(fd_mixer, (1 << 5));
  if (nb_err) {
    printf("%s: "
           "Error with IOCTL SOUND_MIXER_WRITE_OUTSRC (SOUND_MASK_SPEAKER)\n",
           __FUNCTION__);
    err += nb_err;
  }
  nb_err = set_output_device(fd_mixer, (1 << 21));
  if (nb_err) {
    printf("%s: "
           "Error with IOCTL SOUND_MIXER_WRITE_OUTSRC (SOUND_MASK_PHONEOUT)\n",
           __FUNCTION__);
    err += nb_err;
  }
  nb_err = set_output_device(fd_mixer, (1 << 0));
  if (nb_err) {
    printf("%s: "
           "Error with IOCTL SOUND_MIXER_WRITE_OUTSRC (SOUND_MASK_VOLUME)\n",
           __FUNCTION__);
    err += nb_err;
  }
  return err;
}


x86 assembly (clang, -O0):
<check_mixer_ioctls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20044dfe,%esi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1040 <ioctl@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1193 <check_mixer_ioctls+0x53>
mov    -0x10(%rbp),%edx
lea    0xe84(%rip),%rdi
lea    0xebe(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x3000f1,-0x14(%rbp)
je     11c1 <check_mixer_ioctls+0x81>
mov    -0x14(%rbp),%edx
lea    0xeaa(%rip),%rdi
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20044dfd,%esi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1040 <ioctl@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     11ff <check_mixer_ioctls+0xbf>
lea    0xe9e(%rip),%rdi
lea    0xe52(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1000c0,-0x14(%rbp)
je     122d <check_mixer_ioctls+0xed>
mov    -0x14(%rbp),%edx
lea    0xeae(%rip),%rdi
lea    0xe24(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20044df9,%esi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1040 <ioctl@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     126b <check_mixer_ioctls+0x12b>
lea    0xea2(%rip),%rdi
lea    0xde6(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x200031,-0x14(%rbp)
je     1296 <check_mixer_ioctls+0x156>
lea    0xeb5(%rip),%rdi
lea    0xdbb(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20044dfb,%esi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1040 <ioctl@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     12d4 <check_mixer_ioctls+0x194>
lea    0xea6(%rip),%rdi
lea    0xd7d(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x100011,-0x14(%rbp)
je     12ff <check_mixer_ioctls+0x1bf>
lea    0xebc(%rip),%rdi
lea    0xd52(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20044dfc,%esi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1040 <ioctl@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     133d <check_mixer_ioctls+0x1fd>
lea    0xeb0(%rip),%rdi
lea    0xd14(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0x14(%rbp)
je     1365 <check_mixer_ioctls+0x225>
lea    0xec3(%rip),%rdi
lea    0xcec(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20044dff,%esi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1040 <ioctl@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     13a3 <check_mixer_ioctls+0x263>
lea    0xeb1(%rip),%rdi
lea    0xcae(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x40,-0x14(%rbp)
je     13e5 <check_mixer_ioctls+0x2a5>
cmpl   $0x100000,-0x14(%rbp)
je     13e5 <check_mixer_ioctls+0x2a5>
cmpl   $0x80,-0x14(%rbp)
je     13e5 <check_mixer_ioctls+0x2a5>
lea    0xeac(%rip),%rdi
lea    0xc6c(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x100000,%esi
mov    $0x0,%al
call   1050 <set_input_device@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     141f <check_mixer_ioctls+0x2df>
lea    0xea0(%rip),%rdi
lea    0xc32(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x40,%esi
mov    $0x0,%al
call   1050 <set_input_device@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1459 <check_mixer_ioctls+0x319>
lea    0xeaa(%rip),%rdi
lea    0xbf8(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x80,%esi
mov    $0x0,%al
call   1050 <set_input_device@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1493 <check_mixer_ioctls+0x353>
lea    0xeb1(%rip),%rdi
lea    0xbbe(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x100000,%esi
mov    $0x0,%al
call   1050 <set_input_device@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     14cd <check_mixer_ioctls+0x38d>
lea    0xdf2(%rip),%rdi
lea    0xb84(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x100000,%esi
mov    $0x0,%al
call   1050 <set_input_device@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1507 <check_mixer_ioctls+0x3c7>
lea    0xdb8(%rip),%rdi
lea    0xb4a(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1060 <set_output_device@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1541 <check_mixer_ioctls+0x401>
lea    0xe43(%rip),%rdi
lea    0xb10(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x10,%esi
mov    $0x0,%al
call   1060 <set_output_device@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     157b <check_mixer_ioctls+0x43b>
lea    0xe4d(%rip),%rdi
lea    0xad6(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%esi
mov    $0x0,%al
call   1060 <set_output_device@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     15b5 <check_mixer_ioctls+0x475>
lea    0xe53(%rip),%rdi
lea    0xa9c(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x200000,%esi
mov    $0x0,%al
call   1060 <set_output_device@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     15ef <check_mixer_ioctls+0x4af>
lea    0xe5d(%rip),%rdi
lea    0xa62(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1060 <set_output_device@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1629 <check_mixer_ioctls+0x4e9>
lea    0xe68(%rip),%rdi
lea    0xa28(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_mixer_ioctls>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,%r14d
xor    %ebx,%ebx
lea    0xc(%rsp),%rdx
mov    $0x20044dfe,%esi
xor    %eax,%eax
call   1040 <ioctl@plt>
test   %eax,%eax
je     117e <check_mixer_ioctls+0x3e>
lea    0xe97(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%ebx
mov    0xc(%rsp),%edx
cmp    $0x3000f1,%edx
je     11a2 <check_mixer_ioctls+0x62>
lea    0xec3(%rip),%rdi
lea    0xea9(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
lea    0xc(%rsp),%rdx
mov    %r14d,%edi
mov    $0x20044dfd,%esi
xor    %eax,%eax
call   1040 <ioctl@plt>
test   %eax,%eax
je     11d2 <check_mixer_ioctls+0x92>
lea    0xec5(%rip),%rdi
lea    0xe79(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
mov    0xc(%rsp),%edx
cmp    $0x1000c0,%edx
je     11f6 <check_mixer_ioctls+0xb6>
lea    0xedf(%rip),%rdi
lea    0xe55(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
lea    0xc(%rsp),%rdx
mov    %r14d,%edi
mov    $0x20044df9,%esi
xor    %eax,%eax
call   1040 <ioctl@plt>
test   %eax,%eax
je     1226 <check_mixer_ioctls+0xe6>
lea    0xee1(%rip),%rdi
lea    0xe25(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
cmpl   $0x200031,0xc(%rsp)
je     1248 <check_mixer_ioctls+0x108>
lea    0xefd(%rip),%rdi
lea    0xe03(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
lea    0xc(%rsp),%rdx
mov    %r14d,%edi
mov    $0x20044dfb,%esi
xor    %eax,%eax
call   1040 <ioctl@plt>
test   %eax,%eax
je     1278 <check_mixer_ioctls+0x138>
lea    0xefc(%rip),%rdi
lea    0xdd3(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
cmpl   $0x100011,0xc(%rsp)
je     129a <check_mixer_ioctls+0x15a>
lea    0xf1b(%rip),%rdi
lea    0xdb1(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
lea    0xc(%rsp),%rdx
mov    %r14d,%edi
mov    $0x20044dfc,%esi
xor    %eax,%eax
call   1040 <ioctl@plt>
test   %eax,%eax
je     12ca <check_mixer_ioctls+0x18a>
lea    0xf1d(%rip),%rdi
lea    0xd81(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
cmpl   $0x1,0xc(%rsp)
je     12e9 <check_mixer_ioctls+0x1a9>
lea    0xf39(%rip),%rdi
lea    0xd62(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
lea    0xc(%rsp),%rdx
mov    %r14d,%edi
mov    $0x20044dff,%esi
xor    %eax,%eax
call   1040 <ioctl@plt>
test   %eax,%eax
je     1319 <check_mixer_ioctls+0x1d9>
lea    0xf35(%rip),%rdi
lea    0xd32(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
mov    0xc(%rsp),%eax
cmp    $0x40,%eax
je     1348 <check_mixer_ioctls+0x208>
cmp    $0x80,%eax
je     1348 <check_mixer_ioctls+0x208>
cmp    $0x100000,%eax
je     1348 <check_mixer_ioctls+0x208>
lea    0xf43(%rip),%rdi
lea    0xd03(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
mov    %r14d,%edi
mov    $0x100000,%esi
xor    %eax,%eax
call   1050 <set_input_device@plt>
test   %eax,%eax
je     1374 <check_mixer_ioctls+0x234>
mov    %eax,%ebp
lea    0xf44(%rip),%rdi
lea    0xcd6(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %r14d,%edi
mov    $0x40,%esi
xor    %eax,%eax
call   1050 <set_input_device@plt>
test   %eax,%eax
je     13a0 <check_mixer_ioctls+0x260>
mov    %eax,%ebp
lea    0xf5c(%rip),%rdi
lea    0xcaa(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %r14d,%edi
mov    $0x80,%esi
xor    %eax,%eax
call   1050 <set_input_device@plt>
test   %eax,%eax
je     13cc <check_mixer_ioctls+0x28c>
mov    %eax,%ebp
lea    0xf71(%rip),%rdi
lea    0xc7e(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %r14d,%edi
mov    $0x100000,%esi
xor    %eax,%eax
call   1050 <set_input_device@plt>
test   %eax,%eax
je     13f8 <check_mixer_ioctls+0x2b8>
mov    %eax,%ebp
lea    0xec0(%rip),%rdi
lea    0xc52(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %r14d,%edi
mov    $0x100000,%esi
xor    %eax,%eax
call   1050 <set_input_device@plt>
test   %eax,%eax
je     1424 <check_mixer_ioctls+0x2e4>
mov    %eax,%ebp
lea    0xe94(%rip),%rdi
lea    0xc26(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %r14d,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1060 <set_output_device@plt>
test   %eax,%eax
je     1450 <check_mixer_ioctls+0x310>
mov    %eax,%ebp
lea    0xf2d(%rip),%rdi
lea    0xbfa(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %r14d,%edi
mov    $0x10,%esi
xor    %eax,%eax
call   1060 <set_output_device@plt>
test   %eax,%eax
je     147c <check_mixer_ioctls+0x33c>
mov    %eax,%ebp
lea    0xf45(%rip),%rdi
lea    0xbce(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %r14d,%edi
mov    $0x20,%esi
xor    %eax,%eax
call   1060 <set_output_device@plt>
test   %eax,%eax
je     14a8 <check_mixer_ioctls+0x368>
mov    %eax,%ebp
lea    0xf59(%rip),%rdi
lea    0xba2(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %r14d,%edi
mov    $0x200000,%esi
xor    %eax,%eax
call   1060 <set_output_device@plt>
test   %eax,%eax
je     14d4 <check_mixer_ioctls+0x394>
mov    %eax,%ebp
lea    0xf71(%rip),%rdi
lea    0xb76(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %r14d,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1060 <set_output_device@plt>
test   %eax,%eax
je     1500 <check_mixer_ioctls+0x3c0>
mov    %eax,%ebp
lea    0xf8a(%rip),%rdi
lea    0xb4a(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [65 x i8] c"%s: Returned Value Error with IOCTL SOUND_MIXER_READ_DEVMASK %d\0A\00"
@__FUNCTION__.check_mixer_ioctls = [19 x i8] c"check_mixer_ioctls\00"
@.str.1 = [50 x i8] c"%s: Error with IOCTL SOUND_MIXER_READ_DEVMASK %x\0A\00"
@.str.2 = [62 x i8] c"%s: Returned Value Error with IOCTL SOUND_MIXER_READ_RECMASK\0A\00"
@.str.3 = [50 x i8] c"%s: Error with IOCTL SOUND_MIXER_READ_RECMASK %x\0A\00"
@.str.4 = [62 x i8] c"%s: Returned Value Error with IOCTL SOUND_MIXER_READ_OUTMASK\0A\00"
@.str.5 = [47 x i8] c"%s: Error with IOCTL SOUND_MIXER_READ_OUTMASK\0A\00"
@.str.6 = [65 x i8] c"%s: Returned Value Error with IOCTL SOUND_MIXER_READ_STEREODEVS\0A\00"
@.str.7 = [50 x i8] c"%s: Error with IOCTL SOUND_MIXER_READ_STEREODEVS\0A\00"
@.str.8 = [59 x i8] c"%s: Returned Value Error with IOCTL SOUND_MIXER_READ_CAPS\0A\00"
@.str.9 = [44 x i8] c"%s: Error with IOCTL SOUND_MIXER_READ_CAPS\0A\00"
@.str.10 = [61 x i8] c"%s: Returned Value Error with IOCTL SOUND_MIXER_READ_RECSRC\0A\00"
@.str.11 = [46 x i8] c"%s: Error with IOCTL SOUND_MIXER_READ_RECSRC\0A\00"
@.str.12 = [68 x i8] c"%s: Error with IOCTL SOUND_MIXER_WRITE_RECSRC (SOUND_MASK_PHONEIN)\0A\00"
@.str.13 = [65 x i8] c"%s: Error with IOCTL SOUND_MIXER_WRITE_RECSRC (SOUND_MASK_LINE)\0A\00"
@.str.14 = [64 x i8] c"%s: Error with IOCTL SOUND_MIXER_WRITE_RECSRC (SOUND_MASK_MIC)\0A\00"
@.str.15 = [68 x i8] c"%s: Error with IOCTL SOUND_MIXER_WRITE_OUTSRC (SOUND_MASK_VOLUME) \0A\00"
@.str.16 = [64 x i8] c"%s: Error with IOCTL SOUND_MIXER_WRITE_OUTSRC (SOUND_MASK_PCM)\0A\00"
@.str.17 = [68 x i8] c"%s: Error with IOCTL SOUND_MIXER_WRITE_OUTSRC (SOUND_MASK_SPEAKER)\0A\00"
@.str.18 = [69 x i8] c"%s: Error with IOCTL SOUND_MIXER_WRITE_OUTSRC (SOUND_MASK_PHONEOUT)\0A\00"
@.str.19 = [67 x i8] c"%s: Error with IOCTL SOUND_MIXER_WRITE_OUTSRC (SOUND_MASK_VOLUME)\0A\00"
define i32 @check_mixer_ioctls(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
%7 = load i32, i32* %2
%8 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32*, ...)*)(i32 %7, i32 537153022, i32* %6)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %1
%12 = load i32, i32* %5
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %16
16: ; preds = %11, %1
%17 = load i32, i32* %6
%18 = icmp ne i32 %17, 3145969
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i32, i32* %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %24
24: ; preds = %19, %16
%25 = load i32, i32* %2
%26 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32*, ...)*)(i32 %25, i32 537153021, i32* %6)
store i32 %26, i32* %5
%27 = load i32, i32* %5
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %33
29: ; preds = %24
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %33
33: ; preds = %29, %24
%34 = load i32, i32* %6
%35 = icmp ne i32 %34, 1048768
br i1 %35, label %36, label %41
36: ; preds = %33
%37 = load i32, i32* %6
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0), i32 %37)
%39 = load i32, i32* %4
%40 = add nsw i32 %39, 1
store i32 %40, i32* %4
br label %41
41: ; preds = %36, %33
%42 = load i32, i32* %2
%43 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32*, ...)*)(i32 %42, i32 537153017, i32* %6)
store i32 %43, i32* %5
%44 = load i32, i32* %5
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %50
46: ; preds = %41
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%48 = load i32, i32* %4
%49 = add nsw i32 %48, 1
store i32 %49, i32* %4
br label %50
50: ; preds = %46, %41
%51 = load i32, i32* %6
%52 = icmp ne i32 %51, 2097201
br i1 %52, label %53, label %57
53: ; preds = %50
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%55 = load i32, i32* %4
%56 = add nsw i32 %55, 1
store i32 %56, i32* %4
br label %57
57: ; preds = %53, %50
%58 = load i32, i32* %2
%59 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32*, ...)*)(i32 %58, i32 537153019, i32* %6)
store i32 %59, i32* %5
%60 = load i32, i32* %5
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %66
62: ; preds = %57
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%64 = load i32, i32* %4
%65 = add nsw i32 %64, 1
store i32 %65, i32* %4
br label %66
66: ; preds = %62, %57
%67 = load i32, i32* %6
%68 = icmp ne i32 %67, 1048593
br i1 %68, label %69, label %73
69: ; preds = %66
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%71 = load i32, i32* %4
%72 = add nsw i32 %71, 1
store i32 %72, i32* %4
br label %73
73: ; preds = %69, %66
%74 = load i32, i32* %2
%75 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32*, ...)*)(i32 %74, i32 537153020, i32* %6)
store i32 %75, i32* %5
%76 = load i32, i32* %5
%77 = icmp ne i32 %76, 0
br i1 %77, label %78, label %82
78: ; preds = %73
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%80 = load i32, i32* %4
%81 = add nsw i32 %80, 1
store i32 %81, i32* %4
br label %82
82: ; preds = %78, %73
%83 = load i32, i32* %6
%84 = icmp ne i32 %83, 1
br i1 %84, label %85, label %89
85: ; preds = %82
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%87 = load i32, i32* %4
%88 = add nsw i32 %87, 1
store i32 %88, i32* %4
br label %89
89: ; preds = %85, %82
%90 = load i32, i32* %2
%91 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32*, ...)*)(i32 %90, i32 537153023, i32* %6)
store i32 %91, i32* %5
%92 = load i32, i32* %5
%93 = icmp ne i32 %92, 0
br i1 %93, label %94, label %98
94: ; preds = %89
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%96 = load i32, i32* %4
%97 = add nsw i32 %96, 1
store i32 %97, i32* %4
br label %98
98: ; preds = %94, %89
%99 = load i32, i32* %6
%100 = icmp ne i32 %99, 64
br i1 %100, label %101, label %111
101: ; preds = %98
%102 = load i32, i32* %6
%103 = icmp ne i32 %102, 1048576
br i1 %103, label %104, label %111
104: ; preds = %101
%105 = load i32, i32* %6
%106 = icmp ne i32 %105, 128
br i1 %106, label %107, label %111
107: ; preds = %104
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%109 = load i32, i32* %4
%110 = add nsw i32 %109, 1
store i32 %110, i32* %4
br label %111
111: ; preds = %107, %104, %101, %98
%112 = load i32, i32* %2
%113 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_input_device to i32 (i32, i32, ...)*)(i32 %112, i32 1048576)
store i32 %113, i32* %3
%114 = load i32, i32* %3
%115 = icmp ne i32 %114, 0
br i1 %115, label %116, label %121
116: ; preds = %111
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%118 = load i32, i32* %3
%119 = load i32, i32* %4
%120 = add nsw i32 %119, %118
store i32 %120, i32* %4
br label %121
121: ; preds = %116, %111
%122 = load i32, i32* %2
%123 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_input_device to i32 (i32, i32, ...)*)(i32 %122, i32 64)
store i32 %123, i32* %3
%124 = load i32, i32* %3
%125 = icmp ne i32 %124, 0
br i1 %125, label %126, label %131
126: ; preds = %121
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%128 = load i32, i32* %3
%129 = load i32, i32* %4
%130 = add nsw i32 %129, %128
store i32 %130, i32* %4
br label %131
131: ; preds = %126, %121
%132 = load i32, i32* %2
%133 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_input_device to i32 (i32, i32, ...)*)(i32 %132, i32 128)
store i32 %133, i32* %3
%134 = load i32, i32* %3
%135 = icmp ne i32 %134, 0
br i1 %135, label %136, label %141
136: ; preds = %131
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%138 = load i32, i32* %3
%139 = load i32, i32* %4
%140 = add nsw i32 %139, %138
store i32 %140, i32* %4
br label %141
141: ; preds = %136, %131
%142 = load i32, i32* %2
%143 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_input_device to i32 (i32, i32, ...)*)(i32 %142, i32 1048576)
store i32 %143, i32* %3
%144 = load i32, i32* %3
%145 = icmp ne i32 %144, 0
br i1 %145, label %146, label %151
146: ; preds = %141
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%148 = load i32, i32* %3
%149 = load i32, i32* %4
%150 = add nsw i32 %149, %148
store i32 %150, i32* %4
br label %151
151: ; preds = %146, %141
%152 = load i32, i32* %2
%153 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_input_device to i32 (i32, i32, ...)*)(i32 %152, i32 1048576)
store i32 %153, i32* %3
%154 = load i32, i32* %3
%155 = icmp ne i32 %154, 0
br i1 %155, label %156, label %161
156: ; preds = %151
%157 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%158 = load i32, i32* %3
%159 = load i32, i32* %4
%160 = add nsw i32 %159, %158
store i32 %160, i32* %4
br label %161
161: ; preds = %156, %151
%162 = load i32, i32* %2
%163 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_output_device to i32 (i32, i32, ...)*)(i32 %162, i32 1)
store i32 %163, i32* %3
%164 = load i32, i32* %3
%165 = icmp ne i32 %164, 0
br i1 %165, label %166, label %171
166: ; preds = %161
%167 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%168 = load i32, i32* %3
%169 = load i32, i32* %4
%170 = add nsw i32 %169, %168
store i32 %170, i32* %4
br label %171
171: ; preds = %166, %161
%172 = load i32, i32* %2
%173 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_output_device to i32 (i32, i32, ...)*)(i32 %172, i32 16)
store i32 %173, i32* %3
%174 = load i32, i32* %3
%175 = icmp ne i32 %174, 0
br i1 %175, label %176, label %181
176: ; preds = %171
%177 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%178 = load i32, i32* %3
%179 = load i32, i32* %4
%180 = add nsw i32 %179, %178
store i32 %180, i32* %4
br label %181
181: ; preds = %176, %171
%182 = load i32, i32* %2
%183 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_output_device to i32 (i32, i32, ...)*)(i32 %182, i32 32)
store i32 %183, i32* %3
%184 = load i32, i32* %3
%185 = icmp ne i32 %184, 0
br i1 %185, label %186, label %191
186: ; preds = %181
%187 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%188 = load i32, i32* %3
%189 = load i32, i32* %4
%190 = add nsw i32 %189, %188
store i32 %190, i32* %4
br label %191
191: ; preds = %186, %181
%192 = load i32, i32* %2
%193 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_output_device to i32 (i32, i32, ...)*)(i32 %192, i32 2097152)
store i32 %193, i32* %3
%194 = load i32, i32* %3
%195 = icmp ne i32 %194, 0
br i1 %195, label %196, label %201
196: ; preds = %191
%197 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%198 = load i32, i32* %3
%199 = load i32, i32* %4
%200 = add nsw i32 %199, %198
store i32 %200, i32* %4
br label %201
201: ; preds = %196, %191
%202 = load i32, i32* %2
%203 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_output_device to i32 (i32, i32, ...)*)(i32 %202, i32 1)
store i32 %203, i32* %3
%204 = load i32, i32* %3
%205 = icmp ne i32 %204, 0
br i1 %205, label %206, label %211
206: ; preds = %201
%207 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%208 = load i32, i32* %3
%209 = load i32, i32* %4
%210 = add nsw i32 %209, %208
store i32 %210, i32* %4
br label %211
211: ; preds = %206, %201
%212 = load i32, i32* %4
ret i32 %212
}

LLVM IR (-O2):
@.str = [65 x i8] c"%s: Returned Value Error with IOCTL SOUND_MIXER_READ_DEVMASK %d\0A\00"
@__FUNCTION__.check_mixer_ioctls = [19 x i8] c"check_mixer_ioctls\00"
@.str.1 = [50 x i8] c"%s: Error with IOCTL SOUND_MIXER_READ_DEVMASK %x\0A\00"
@.str.2 = [62 x i8] c"%s: Returned Value Error with IOCTL SOUND_MIXER_READ_RECMASK\0A\00"
@.str.3 = [50 x i8] c"%s: Error with IOCTL SOUND_MIXER_READ_RECMASK %x\0A\00"
@.str.4 = [62 x i8] c"%s: Returned Value Error with IOCTL SOUND_MIXER_READ_OUTMASK\0A\00"
@.str.5 = [47 x i8] c"%s: Error with IOCTL SOUND_MIXER_READ_OUTMASK\0A\00"
@.str.6 = [65 x i8] c"%s: Returned Value Error with IOCTL SOUND_MIXER_READ_STEREODEVS\0A\00"
@.str.7 = [50 x i8] c"%s: Error with IOCTL SOUND_MIXER_READ_STEREODEVS\0A\00"
@.str.8 = [59 x i8] c"%s: Returned Value Error with IOCTL SOUND_MIXER_READ_CAPS\0A\00"
@.str.9 = [44 x i8] c"%s: Error with IOCTL SOUND_MIXER_READ_CAPS\0A\00"
@.str.10 = [61 x i8] c"%s: Returned Value Error with IOCTL SOUND_MIXER_READ_RECSRC\0A\00"
@.str.11 = [46 x i8] c"%s: Error with IOCTL SOUND_MIXER_READ_RECSRC\0A\00"
@.str.12 = [68 x i8] c"%s: Error with IOCTL SOUND_MIXER_WRITE_RECSRC (SOUND_MASK_PHONEIN)\0A\00"
@.str.13 = [65 x i8] c"%s: Error with IOCTL SOUND_MIXER_WRITE_RECSRC (SOUND_MASK_LINE)\0A\00"
@.str.14 = [64 x i8] c"%s: Error with IOCTL SOUND_MIXER_WRITE_RECSRC (SOUND_MASK_MIC)\0A\00"
@.str.15 = [68 x i8] c"%s: Error with IOCTL SOUND_MIXER_WRITE_OUTSRC (SOUND_MASK_VOLUME) \0A\00"
@.str.16 = [64 x i8] c"%s: Error with IOCTL SOUND_MIXER_WRITE_OUTSRC (SOUND_MASK_PCM)\0A\00"
@.str.17 = [68 x i8] c"%s: Error with IOCTL SOUND_MIXER_WRITE_OUTSRC (SOUND_MASK_SPEAKER)\0A\00"
@.str.18 = [69 x i8] c"%s: Error with IOCTL SOUND_MIXER_WRITE_OUTSRC (SOUND_MASK_PHONEOUT)\0A\00"
@.str.19 = [67 x i8] c"%s: Error with IOCTL SOUND_MIXER_WRITE_OUTSRC (SOUND_MASK_VOLUME)\0A\00"
define i32 @check_mixer_ioctls(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32*, ...)*)(i32 %0, i32 537153022, i32* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0), i32 %4)
br label %8
8: ; preds = %6, %1
%9 = phi i32 [ 1, %6 ], [ 0, %1 ]
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 3145969
br i1 %11, label %15, label %12
12: ; preds = %8
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0), i32 %10)
%14 = add nuw nsw i32 %9, 1
br label %15
15: ; preds = %12, %8
%16 = phi i32 [ %14, %12 ], [ %9, %8 ]
%17 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32*, ...)*)(i32 %0, i32 537153021, i32* %2)
%18 = icmp eq i32 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %15
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%21 = add nuw nsw i32 %16, 1
br label %22
22: ; preds = %19, %15
%23 = phi i32 [ %21, %19 ], [ %16, %15 ]
%24 = load i32, i32* %2
%25 = icmp eq i32 %24, 1048768
br i1 %25, label %29, label %26
26: ; preds = %22
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0), i32 %24)
%28 = add nuw nsw i32 %23, 1
br label %29
29: ; preds = %26, %22
%30 = phi i32 [ %28, %26 ], [ %23, %22 ]
%31 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32*, ...)*)(i32 %0, i32 537153017, i32* %2)
%32 = icmp eq i32 %31, 0
br i1 %32, label %36, label %33
33: ; preds = %29
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%35 = add nuw nsw i32 %30, 1
br label %36
36: ; preds = %33, %29
%37 = phi i32 [ %35, %33 ], [ %30, %29 ]
%38 = load i32, i32* %2
%39 = icmp eq i32 %38, 2097201
br i1 %39, label %43, label %40
40: ; preds = %36
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%42 = add nuw nsw i32 %37, 1
br label %43
43: ; preds = %40, %36
%44 = phi i32 [ %42, %40 ], [ %37, %36 ]
%45 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32*, ...)*)(i32 %0, i32 537153019, i32* %2)
%46 = icmp eq i32 %45, 0
br i1 %46, label %50, label %47
47: ; preds = %43
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%49 = add nuw nsw i32 %44, 1
br label %50
50: ; preds = %47, %43
%51 = phi i32 [ %49, %47 ], [ %44, %43 ]
%52 = load i32, i32* %2
%53 = icmp eq i32 %52, 1048593
br i1 %53, label %57, label %54
54: ; preds = %50
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%56 = add nuw nsw i32 %51, 1
br label %57
57: ; preds = %54, %50
%58 = phi i32 [ %56, %54 ], [ %51, %50 ]
%59 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32*, ...)*)(i32 %0, i32 537153020, i32* %2)
%60 = icmp eq i32 %59, 0
br i1 %60, label %64, label %61
61: ; preds = %57
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%63 = add nuw nsw i32 %58, 1
br label %64
64: ; preds = %61, %57
%65 = phi i32 [ %63, %61 ], [ %58, %57 ]
%66 = load i32, i32* %2
%67 = icmp eq i32 %66, 1
br i1 %67, label %71, label %68
68: ; preds = %64
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%70 = add nuw nsw i32 %65, 1
br label %71
71: ; preds = %68, %64
%72 = phi i32 [ %70, %68 ], [ %65, %64 ]
%73 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32*, ...)*)(i32 %0, i32 537153023, i32* %2)
%74 = icmp eq i32 %73, 0
br i1 %74, label %78, label %75
75: ; preds = %71
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%77 = add nuw nsw i32 %72, 1
br label %78
78: ; preds = %75, %71
%79 = phi i32 [ %77, %75 ], [ %72, %71 ]
%80 = load i32, i32* %2
switch i32 %80, label %81 [
i32 1048576, label %84
i32 128, label %84
i32 64, label %84
]
81: ; preds = %78
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%83 = add nuw nsw i32 %79, 1
br label %84
84: ; preds = %78, %78, %78, %81
%85 = phi i32 [ %83, %81 ], [ %79, %78 ], [ %79, %78 ], [ %79, %78 ]
%86 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_input_device to i32 (i32, i32, ...)*)(i32 %0, i32 1048576)
%87 = icmp eq i32 %86, 0
br i1 %87, label %91, label %88
88: ; preds = %84
%89 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%90 = add nsw i32 %86, %85
br label %91
91: ; preds = %88, %84
%92 = phi i32 [ %90, %88 ], [ %85, %84 ]
%93 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_input_device to i32 (i32, i32, ...)*)(i32 %0, i32 64)
%94 = icmp eq i32 %93, 0
br i1 %94, label %98, label %95
95: ; preds = %91
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%97 = add nsw i32 %93, %92
br label %98
98: ; preds = %95, %91
%99 = phi i32 [ %97, %95 ], [ %92, %91 ]
%100 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_input_device to i32 (i32, i32, ...)*)(i32 %0, i32 128)
%101 = icmp eq i32 %100, 0
br i1 %101, label %105, label %102
102: ; preds = %98
%103 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%104 = add nsw i32 %100, %99
br label %105
105: ; preds = %102, %98
%106 = phi i32 [ %104, %102 ], [ %99, %98 ]
%107 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_input_device to i32 (i32, i32, ...)*)(i32 %0, i32 1048576)
%108 = icmp eq i32 %107, 0
br i1 %108, label %112, label %109
109: ; preds = %105
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%111 = add nsw i32 %107, %106
br label %112
112: ; preds = %109, %105
%113 = phi i32 [ %111, %109 ], [ %106, %105 ]
%114 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_input_device to i32 (i32, i32, ...)*)(i32 %0, i32 1048576)
%115 = icmp eq i32 %114, 0
br i1 %115, label %119, label %116
116: ; preds = %112
%117 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%118 = add nsw i32 %114, %113
br label %119
119: ; preds = %116, %112
%120 = phi i32 [ %118, %116 ], [ %113, %112 ]
%121 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_output_device to i32 (i32, i32, ...)*)(i32 %0, i32 1)
%122 = icmp eq i32 %121, 0
br i1 %122, label %126, label %123
123: ; preds = %119
%124 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%125 = add nsw i32 %121, %120
br label %126
126: ; preds = %123, %119
%127 = phi i32 [ %125, %123 ], [ %120, %119 ]
%128 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_output_device to i32 (i32, i32, ...)*)(i32 %0, i32 16)
%129 = icmp eq i32 %128, 0
br i1 %129, label %133, label %130
130: ; preds = %126
%131 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%132 = add nsw i32 %128, %127
br label %133
133: ; preds = %130, %126
%134 = phi i32 [ %132, %130 ], [ %127, %126 ]
%135 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_output_device to i32 (i32, i32, ...)*)(i32 %0, i32 32)
%136 = icmp eq i32 %135, 0
br i1 %136, label %140, label %137
137: ; preds = %133
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%139 = add nsw i32 %135, %134
br label %140
140: ; preds = %137, %133
%141 = phi i32 [ %139, %137 ], [ %134, %133 ]
%142 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_output_device to i32 (i32, i32, ...)*)(i32 %0, i32 2097152)
%143 = icmp eq i32 %142, 0
br i1 %143, label %147, label %144
144: ; preds = %140
%145 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%146 = add nsw i32 %142, %141
br label %147
147: ; preds = %144, %140
%148 = phi i32 [ %146, %144 ], [ %141, %140 ]
%149 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_output_device to i32 (i32, i32, ...)*)(i32 %0, i32 1)
%150 = icmp eq i32 %149, 0
br i1 %150, label %154, label %151
151: ; preds = %147
%152 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.check_mixer_ioctls, i64 0, i64 0))
%153 = add nsw i32 %149, %148
br label %154
154: ; preds = %151, %147
%155 = phi i32 [ %153, %151 ], [ %148, %147 ]
ret i32 %155
}