#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*/ ADC_escribeCommandRAM();
int /*<<< orphan*/ ADC_escribeTxRAM();
int ADC_leeRxRAM();
int ADC_dato() {
  int datoLeido;
  *((volatile unsigned short *)(0x10000000 + 0x00A0)) =
      0x8000 | 66000000 / (2 * 2000000);
  ADC_escribeTxRAM();
  ADC_escribeCommandRAM();
  *((volatile unsigned short *)(0x10000000 + 0x00A8)) = 0x1000 | ((3 - 1) << 8);
  *((volatile unsigned short *)(0x10000000 + 0x00A4)) =
      *((volatile unsigned short *)(0x10000000 + 0x00A4)) | 0x8000;
  while (!(*((volatile unsigned short *)(0x10000000 + 0x00aC)) & 0x0001)) {
  }
  *((volatile unsigned short *)(0x10000000 + 0x00aC)) =
      *((volatile unsigned short *)(0x10000000 + 0x00aC)) | 0x0001;
  datoLeido = ADC_leeRxRAM();
  return datoLeido;
}


x86 assembly (clang, -O0):
<ADC_dato>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x100000a0,%eax
movw   $0x8010,(%rax)
mov    $0x0,%al
call   1040 <ADC_escribeTxRAM@plt>
mov    $0x0,%al
call   1050 <ADC_escribeCommandRAM@plt>
mov    $0x100000a8,%eax
movw   $0x1200,(%rax)
mov    $0x100000a4,%eax
mov    (%rax),%ax
movzwl %ax,%eax
or     $0x8000,%eax
mov    %ax,%cx
mov    $0x100000a4,%eax
mov    %cx,(%rax)
mov    $0x100000ac,%eax
mov    (%rax),%ax
movzwl %ax,%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1198 <ADC_dato+0x68>
jmp    119d <ADC_dato+0x6d>
jmp    1175 <ADC_dato+0x45>
mov    $0x100000ac,%eax
mov    (%rax),%ax
movzwl %ax,%eax
or     $0x1,%eax
mov    %ax,%cx
mov    $0x100000ac,%eax
mov    %cx,(%rax)
mov    $0x0,%al
call   1030 <ADC_leeRxRAM@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADC_dato>:
push   %rax
movw   $0x8010,0x100000a0
10 10 80
xor    %eax,%eax
call   1040 <ADC_escribeTxRAM@plt>
xor    %eax,%eax
call   1050 <ADC_escribeCommandRAM@plt>
movw   $0x1200,0x100000a8
orw    $0x8000,0x100000a4
nopl   (%rax)
movzwl 0x100000ac,%eax
10
test   $0x1,%al
je     1160 <ADC_dato+0x30>
orw    $0x1,0x100000ac
10 01
xor    %eax,%eax
pop    %rcx
jmp    1030 <ADC_leeRxRAM@plt>

LLVM IR (-O0):
define i32 @ADC_dato() {
%1 = alloca i32
store volatile i16 -32752, i16* inttoptr (i64 268435616 to i16*)
%2 = call i32 (...) @ADC_escribeTxRAM()
%3 = call i32 (...) @ADC_escribeCommandRAM()
store volatile i16 4608, i16* inttoptr (i64 268435624 to i16*)
%4 = load volatile i16, i16* inttoptr (i64 268435620 to i16*)
%5 = zext i16 %4 to i32
%6 = or i32 %5, 32768
%7 = trunc i32 %6 to i16
store volatile i16 %7, i16* inttoptr (i64 268435620 to i16*)
br label %8
8: ; preds = %14, %0
%9 = load volatile i16, i16* inttoptr (i64 268435628 to i16*)
%10 = zext i16 %9 to i32
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br i1 %13, label %14, label %15
14: ; preds = %8
br label %8
15: ; preds = %8
%16 = load volatile i16, i16* inttoptr (i64 268435628 to i16*)
%17 = zext i16 %16 to i32
%18 = or i32 %17, 1
%19 = trunc i32 %18 to i16
store volatile i16 %19, i16* inttoptr (i64 268435628 to i16*)
%20 = call i32 (...) @ADC_leeRxRAM()
store i32 %20, i32* %1
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
define i32 @ADC_dato() {
store volatile i16 -32752, i16* inttoptr (i64 268435616 to i16*)
%1 = tail call i32 (...) @ADC_escribeTxRAM()
%2 = tail call i32 (...) @ADC_escribeCommandRAM()
store volatile i16 4608, i16* inttoptr (i64 268435624 to i16*)
%3 = load volatile i16, i16* inttoptr (i64 268435620 to i16*)
%4 = or i16 %3, -32768
store volatile i16 %4, i16* inttoptr (i64 268435620 to i16*)
br label %5
5: ; preds = %5, %0
%6 = load volatile i16, i16* inttoptr (i64 268435628 to i16*)
%7 = and i16 %6, 1
%8 = icmp eq i16 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5
%10 = load volatile i16, i16* inttoptr (i64 268435628 to i16*)
%11 = or i16 %10, 1
store volatile i16 %11, i16* inttoptr (i64 268435628 to i16*)
%12 = tail call i32 (...) @ADC_leeRxRAM()
ret i32 %12
}