#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__ adc(int /*<<< orphan*/, double, double *);
int /*<<< orphan*/ printf(char *, double);
int at_act_adc() {
  double u;
  int i;
  for (i = 0; i < 10; i++) {
    if (adc(0, 5.05, &u)) {
      printf("ADC result: U=%.2f\n", u);
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<at_act_adc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    117a <at_act_adc+0x5a>
xor    %edi,%edi
movsd  0xebd(%rip),%xmm0
lea    -0x8(%rbp),%rsi
call   1040 <adc@plt>
cmp    $0x0,%rax
je     1167 <at_act_adc+0x47>
movsd  -0x8(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
jmp    116c <at_act_adc+0x4c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <at_act_adc+0xf>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<at_act_adc>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    %rsp,%rsi
xor    %edi,%edi
call   1040 <adc@plt>
test   %rax,%rax
je     1149 <at_act_adc+0x29>
movsd  (%rsp),%xmm0
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
movsd  0xeaf(%rip),%xmm0
mov    %rsp,%rsi
xor    %edi,%edi
call   1040 <adc@plt>
test   %rax,%rax
je     1171 <at_act_adc+0x51>
movsd  (%rsp),%xmm0
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe87(%rip),%xmm0
mov    %rsp,%rsi
xor    %edi,%edi
call   1040 <adc@plt>
test   %rax,%rax
je     1199 <at_act_adc+0x79>
movsd  (%rsp),%xmm0
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe5f(%rip),%xmm0
mov    %rsp,%rsi
xor    %edi,%edi
call   1040 <adc@plt>
test   %rax,%rax
je     11c1 <at_act_adc+0xa1>
movsd  (%rsp),%xmm0
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe37(%rip),%xmm0
mov    %rsp,%rsi
xor    %edi,%edi
call   1040 <adc@plt>
test   %rax,%rax
je     11e9 <at_act_adc+0xc9>
movsd  (%rsp),%xmm0
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe0f(%rip),%xmm0
mov    %rsp,%rsi
xor    %edi,%edi
call   1040 <adc@plt>
test   %rax,%rax
je     1211 <at_act_adc+0xf1>
movsd  (%rsp),%xmm0
lea    0xdfc(%rip),%rdi
call   1030 <printf@plt>
movsd  0xde7(%rip),%xmm0
mov    %rsp,%rsi
xor    %edi,%edi
call   1040 <adc@plt>
test   %rax,%rax
je     1239 <at_act_adc+0x119>
movsd  (%rsp),%xmm0
lea    0xdd4(%rip),%rdi
call   1030 <printf@plt>
movsd  0xdbf(%rip),%xmm0
mov    %rsp,%rsi
xor    %edi,%edi
call   1040 <adc@plt>
test   %rax,%rax
je     1261 <at_act_adc+0x141>
movsd  (%rsp),%xmm0
lea    0xdac(%rip),%rdi
call   1030 <printf@plt>
movsd  0xd97(%rip),%xmm0
mov    %rsp,%rsi
xor    %edi,%edi
call   1040 <adc@plt>
test   %rax,%rax
je     1289 <at_act_adc+0x169>
movsd  (%rsp),%xmm0
lea    0xd84(%rip),%rdi
call   1030 <printf@plt>
movsd  0xd6f(%rip),%xmm0
mov    %rsp,%rsi
xor    %edi,%edi
call   1040 <adc@plt>
test   %rax,%rax
je     12b1 <at_act_adc+0x191>
movsd  (%rsp),%xmm0
lea    0xd5c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"ADC result: U=%.2f\0A\00"
define i32 @at_act_adc() {
%1 = alloca double
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = call i64 @adc(i32 0, double 5.050000e+00, double* %1)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load double, double* %1
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %10)
br label %12
12: ; preds = %9, %6
br label %13
13: ; preds = %12
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %3
16: ; preds = %3
ret i32 1
}

LLVM IR (-O2):
@.str = [20 x i8] c"ADC result: U=%.2f\0A\00"
define i32 @at_act_adc() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i64 @adc(i32 0, double 5.050000e+00, double* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load double, double* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %6)
br label %8
8: ; preds = %0, %5
%9 = call i64 @adc(i32 0, double 5.050000e+00, double* %1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load double, double* %1
%13 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %12)
br label %14
14: ; preds = %11, %8
%15 = call i64 @adc(i32 0, double 5.050000e+00, double* %1)
%16 = icmp eq i64 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load double, double* %1
%19 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %18)
br label %20
20: ; preds = %17, %14
%21 = call i64 @adc(i32 0, double 5.050000e+00, double* %1)
%22 = icmp eq i64 %21, 0
br i1 %22, label %26, label %23
23: ; preds = %20
%24 = load double, double* %1
%25 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %24)
br label %26
26: ; preds = %23, %20
%27 = call i64 @adc(i32 0, double 5.050000e+00, double* %1)
%28 = icmp eq i64 %27, 0
br i1 %28, label %32, label %29
29: ; preds = %26
%30 = load double, double* %1
%31 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %30)
br label %32
32: ; preds = %29, %26
%33 = call i64 @adc(i32 0, double 5.050000e+00, double* %1)
%34 = icmp eq i64 %33, 0
br i1 %34, label %38, label %35
35: ; preds = %32
%36 = load double, double* %1
%37 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %36)
br label %38
38: ; preds = %35, %32
%39 = call i64 @adc(i32 0, double 5.050000e+00, double* %1)
%40 = icmp eq i64 %39, 0
br i1 %40, label %44, label %41
41: ; preds = %38
%42 = load double, double* %1
%43 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %42)
br label %44
44: ; preds = %41, %38
%45 = call i64 @adc(i32 0, double 5.050000e+00, double* %1)
%46 = icmp eq i64 %45, 0
br i1 %46, label %50, label %47
47: ; preds = %44
%48 = load double, double* %1
%49 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %48)
br label %50
50: ; preds = %47, %44
%51 = call i64 @adc(i32 0, double 5.050000e+00, double* %1)
%52 = icmp eq i64 %51, 0
br i1 %52, label %56, label %53
53: ; preds = %50
%54 = load double, double* %1
%55 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %54)
br label %56
56: ; preds = %53, %50
%57 = call i64 @adc(i32 0, double 5.050000e+00, double* %1)
%58 = icmp eq i64 %57, 0
br i1 %58, label %62, label %59
59: ; preds = %56
%60 = load double, double* %1
%61 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %60)
br label %62
62: ; preds = %59, %56
ret i32 1
}