int set_adder(int fd_audio) {
  int err = 0;
  int ret, val;
  val = 0x1;
  ret = ioctl(fd_audio,
              ((int)((0x40000000 | 0x20000000) |
                     ((sizeof(int) & 0x1fff) << 16) | ('Z' << 8) | 7)),
              &val);
  if ((val != 0x1) || (ret != 0)) {
    printf("%s: "
           "Error with IOCTL SNDCTL_MC13783_WRITE_OUT_ADDER\n",
           __FUNCTION__);
    err++;
  }
  val = 0x8;
  ret = ioctl(fd_audio,
              ((int)((0x40000000 | 0x20000000) |
                     ((sizeof(int) & 0x1fff) << 16) | ('Z' << 8) | 7)),
              &val);
  if ((val != 0x8) || (ret != 0)) {
    printf("%s: "
           "Error with IOCTL SNDCTL_MC13783_WRITE_OUT_ADDER\n",
           __FUNCTION__);
    err++;
  }
  val = 0x4;
  ret = ioctl(fd_audio,
              ((int)((0x40000000 | 0x20000000) |
                     ((sizeof(int) & 0x1fff) << 16) | ('Z' << 8) | 7)),
              &val);
  if ((val != 0x4) || (ret != 0)) {
    printf("%s: "
           "Error with IOCTL SNDCTL_MC13783_WRITE_OUT_ADDER\n",
           __FUNCTION__);
    err++;
  }
  val = 0x2;
  ret = ioctl(fd_audio,
              ((int)((0x40000000 | 0x20000000) |
                     ((sizeof(int) & 0x1fff) << 16) | ('Z' << 8) | 7)),
              &val);
  if ((val != 0x2) || (ret != 0)) {
    printf("%s: "
           "Error with IOCTL SNDCTL_MC13783_WRITE_OUT_ADDER\n",
           __FUNCTION__);
    err++;
  }
  return err;
}


x86 assembly (clang, -O0):
<set_adder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x60045a07,%esi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <ioctl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0x10(%rbp)
jne    1163 <set_adder+0x43>
cmpl   $0x0,-0xc(%rbp)
je     1181 <set_adder+0x61>
lea    0xe96(%rip),%rdi
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
movl   $0x8,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x60045a07,%esi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <ioctl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x8,-0x10(%rbp)
jne    11b2 <set_adder+0x92>
cmpl   $0x0,-0xc(%rbp)
je     11d0 <set_adder+0xb0>
lea    0xe47(%rip),%rdi
lea    0xe75(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x60045a07,%esi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <ioctl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x4,-0x10(%rbp)
jne    1201 <set_adder+0xe1>
cmpl   $0x0,-0xc(%rbp)
je     121f <set_adder+0xff>
lea    0xdf8(%rip),%rdi
lea    0xe26(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x60045a07,%esi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <ioctl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0x10(%rbp)
jne    1250 <set_adder+0x130>
cmpl   $0x0,-0xc(%rbp)
je     126e <set_adder+0x14e>
lea    0xda9(%rip),%rdi
lea    0xdd7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_adder>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
movl   $0x1,0x4(%rsp)
xor    %ebx,%ebx
lea    0x4(%rsp),%rdx
mov    $0x60045a07,%esi
xor    %eax,%eax
call   1040 <ioctl@plt>
cmpl   $0x1,0x4(%rsp)
jne    114b <set_adder+0x2b>
test   %eax,%eax
je     1165 <set_adder+0x45>
lea    0xeae(%rip),%rdi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%ebx
movl   $0x8,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    %ebp,%edi
mov    $0x60045a07,%esi
xor    %eax,%eax
call   1040 <ioctl@plt>
cmpl   $0x8,0x4(%rsp)
jne    118b <set_adder+0x6b>
test   %eax,%eax
je     11a3 <set_adder+0x83>
lea    0xe6e(%rip),%rdi
lea    0xe9c(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
movl   $0x4,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    %ebp,%edi
mov    $0x60045a07,%esi
xor    %eax,%eax
call   1040 <ioctl@plt>
cmpl   $0x4,0x4(%rsp)
jne    11c9 <set_adder+0xa9>
test   %eax,%eax
je     11e1 <set_adder+0xc1>
lea    0xe30(%rip),%rdi
lea    0xe5e(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
movl   $0x2,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    %ebp,%edi
mov    $0x60045a07,%esi
xor    %eax,%eax
call   1040 <ioctl@plt>
cmpl   $0x2,0x4(%rsp)
jne    1207 <set_adder+0xe7>
test   %eax,%eax
je     121f <set_adder+0xff>
lea    0xdf2(%rip),%rdi
lea    0xe20(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [53 x i8] c"%s: Error with IOCTL SNDCTL_MC13783_WRITE_OUT_ADDER\0A\00"
@__FUNCTION__.set_adder = [10 x i8] c"set_adder\00"
define i32 @set_adder(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 1, i32* %5
%6 = load i32, i32* %2
%7 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32*, ...)*)(i32 %6, i32 1610897927, i32* %5)
store i32 %7, i32* %4
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 1
br i1 %9, label %13, label %10
10: ; preds = %1
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %10, %1
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.set_adder, i64 0, i64 0))
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %17
17: ; preds = %13, %10
store i32 8, i32* %5
%18 = load i32, i32* %2
%19 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32*, ...)*)(i32 %18, i32 1610897927, i32* %5)
store i32 %19, i32* %4
%20 = load i32, i32* %5
%21 = icmp ne i32 %20, 8
br i1 %21, label %25, label %22
22: ; preds = %17
%23 = load i32, i32* %4
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %29
25: ; preds = %22, %17
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.set_adder, i64 0, i64 0))
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %29
29: ; preds = %25, %22
store i32 4, i32* %5
%30 = load i32, i32* %2
%31 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32*, ...)*)(i32 %30, i32 1610897927, i32* %5)
store i32 %31, i32* %4
%32 = load i32, i32* %5
%33 = icmp ne i32 %32, 4
br i1 %33, label %37, label %34
34: ; preds = %29
%35 = load i32, i32* %4
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %41
37: ; preds = %34, %29
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.set_adder, i64 0, i64 0))
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %41
41: ; preds = %37, %34
store i32 2, i32* %5
%42 = load i32, i32* %2
%43 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32*, ...)*)(i32 %42, i32 1610897927, i32* %5)
store i32 %43, i32* %4
%44 = load i32, i32* %5
%45 = icmp ne i32 %44, 2
br i1 %45, label %49, label %46
46: ; preds = %41
%47 = load i32, i32* %4
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %53
49: ; preds = %46, %41
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.set_adder, i64 0, i64 0))
%51 = load i32, i32* %3
%52 = add nsw i32 %51, 1
store i32 %52, i32* %3
br label %53
53: ; preds = %49, %46
%54 = load i32, i32* %3
ret i32 %54
}

LLVM IR (-O2):
@.str = [53 x i8] c"%s: Error with IOCTL SNDCTL_MC13783_WRITE_OUT_ADDER\0A\00"
@__FUNCTION__.set_adder = [10 x i8] c"set_adder\00"
define i32 @set_adder(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32*, ...)*)(i32 %0, i32 1610897927, i32* %2)
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 1
%7 = icmp ne i32 %4, 0
%8 = select i1 %6, i1 true, i1 %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.set_adder, i64 0, i64 0))
br label %11
11: ; preds = %1, %9
%12 = phi i32 [ 1, %9 ], [ 0, %1 ]
store i32 8, i32* %2
%13 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32*, ...)*)(i32 %0, i32 1610897927, i32* %2)
%14 = load i32, i32* %2
%15 = icmp ne i32 %14, 8
%16 = icmp ne i32 %13, 0
%17 = select i1 %15, i1 true, i1 %16
br i1 %17, label %18, label %21
18: ; preds = %11
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.set_adder, i64 0, i64 0))
%20 = add nuw nsw i32 %12, 1
br label %21
21: ; preds = %11, %18
%22 = phi i32 [ %20, %18 ], [ %12, %11 ]
store i32 4, i32* %2
%23 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32*, ...)*)(i32 %0, i32 1610897927, i32* %2)
%24 = load i32, i32* %2
%25 = icmp ne i32 %24, 4
%26 = icmp ne i32 %23, 0
%27 = select i1 %25, i1 true, i1 %26
br i1 %27, label %28, label %31
28: ; preds = %21
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.set_adder, i64 0, i64 0))
%30 = add nuw nsw i32 %22, 1
br label %31
31: ; preds = %21, %28
%32 = phi i32 [ %30, %28 ], [ %22, %21 ]
store i32 2, i32* %2
%33 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32*, ...)*)(i32 %0, i32 1610897927, i32* %2)
%34 = load i32, i32* %2
%35 = icmp ne i32 %34, 2
%36 = icmp ne i32 %33, 0
%37 = select i1 %35, i1 true, i1 %36
br i1 %37, label %38, label %41
38: ; preds = %31
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.set_adder, i64 0, i64 0))
%40 = add nuw nsw i32 %32, 1
br label %41
41: ; preds = %31, %38
%42 = phi i32 [ %40, %38 ], [ %32, %31 ]
ret i32 %42
}