#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*/ sendUartData(unsigned int);
int /*<<< orphan*/ uart_send(char *);
void adcISR(void) {
  uart_send("get x and y!\n");
  unsigned int x = ((*(volatile unsigned int *)(0x7E00B00C)) & 0x3FF);
  unsigned int y = ((*(volatile unsigned int *)(0x7E00B010)) & 0x3FF);
  uart_send("x = ");
  sendUartData(x);
  uart_send("y = ");
  sendUartData(y);
  (*(volatile unsigned int *)(0x7E00B004)) = 0xD3;
  (*(volatile unsigned int *)(0x7E00B004)) |= (1 << 8);
  (*(volatile unsigned int *)(0x7E00B018)) = 0;
  (*(volatile unsigned int *)(0x71300F00)) = 0;
  return;
}


x86 assembly (clang, -O0):
<adcISR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <uart_send@plt>
mov    $0x7e00b00c,%eax
mov    (%rax),%eax
and    $0x3ff,%eax
mov    %eax,-0x4(%rbp)
mov    $0x7e00b010,%eax
mov    (%rax),%eax
and    $0x3ff,%eax
mov    %eax,-0x8(%rbp)
lea    0xeb5(%rip),%rdi
call   1040 <uart_send@plt>
mov    -0x4(%rbp),%edi
call   1030 <sendUartData@plt>
lea    0xea6(%rip),%rdi
call   1040 <uart_send@plt>
mov    -0x8(%rbp),%edi
call   1030 <sendUartData@plt>
mov    $0x7e00b004,%eax
movl   $0xd3,(%rax)
mov    $0x7e00b004,%eax
mov    (%rax),%ecx
or     $0x100,%ecx
mov    $0x7e00b004,%eax
mov    %ecx,(%rax)
mov    $0x7e00b018,%eax
movl   $0x0,(%rax)
mov    $0x71300f00,%eax
movl   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcISR>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
call   1040 <uart_send@plt>
mov    $0x3ff,%ebx
mov    0x7e00b00c,%ebp
and    %ebx,%ebp
and    0x7e00b010,%ebx
lea    0xec3(%rip),%rdi
call   1040 <uart_send@plt>
mov    %ebp,%edi
call   1030 <sendUartData@plt>
lea    0xeb5(%rip),%rdi
call   1040 <uart_send@plt>
mov    %ebx,%edi
call   1030 <sendUartData@plt>
movl   $0xd3,0x7e00b004
orl    $0x100,0x7e00b004
movl   $0x0,0x7e00b018
movl   $0x0,0x71300f00
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"get x and y!\0A\00"
@.str.1 = [5 x i8] c"x = \00"
@.str.2 = [5 x i8] c"y = \00"
define void @adcISR() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @uart_send(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = load volatile i32, i32* inttoptr (i64 2113974284 to i32*)
%5 = and i32 %4, 1023
store i32 %5, i32* %1
%6 = load volatile i32, i32* inttoptr (i64 2113974288 to i32*)
%7 = and i32 %6, 1023
store i32 %7, i32* %2
%8 = call i32 @uart_send(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %1
%10 = call i32 @sendUartData(i32 %9)
%11 = call i32 @uart_send(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%12 = load i32, i32* %2
%13 = call i32 @sendUartData(i32 %12)
store volatile i32 211, i32* inttoptr (i64 2113974276 to i32*)
%14 = load volatile i32, i32* inttoptr (i64 2113974276 to i32*)
%15 = or i32 %14, 256
store volatile i32 %15, i32* inttoptr (i64 2113974276 to i32*)
store volatile i32 0, i32* inttoptr (i64 2113974296 to i32*)
store volatile i32 0, i32* inttoptr (i64 1898974976 to i32*)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"get x and y!\0A\00"
@.str.1 = [5 x i8] c"x = \00"
@.str.2 = [5 x i8] c"y = \00"
define void @adcISR() {
%1 = tail call i32 @uart_send(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = load volatile i32, i32* inttoptr (i64 2113974284 to i32*)
%3 = and i32 %2, 1023
%4 = load volatile i32, i32* inttoptr (i64 2113974288 to i32*)
%5 = and i32 %4, 1023
%6 = tail call i32 @uart_send(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @sendUartData(i32 %3)
%8 = tail call i32 @uart_send(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 @sendUartData(i32 %5)
store volatile i32 211, i32* inttoptr (i64 2113974276 to i32*)
%10 = load volatile i32, i32* inttoptr (i64 2113974276 to i32*)
%11 = or i32 %10, 256
store volatile i32 %11, i32* inttoptr (i64 2113974276 to i32*)
store volatile i32 0, i32* inttoptr (i64 2113974296 to i32*)
store volatile i32 0, i32* inttoptr (i64 1898974976 to i32*)
ret void
}