#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*/ COLOR_PAIR(int);
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ mvprintw(int, int, char *, unsigned char);
int /*<<< orphan*/ mvscanw(int, int, char *, int *);
int /*<<< orphan*/ refresh_screen();
int analogRead(unsigned char t) {
  int a;
  attron(COLOR_PAIR(3));
  mvprintw(5, 1, "Digite valor para porta A%d: __________", t);
  mvscanw(5, 29, "%d", &a);
  attroff(COLOR_PAIR(3));
  refresh_screen();
  return a;
}


x86 assembly (clang, -O0):
<analogRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1050 <attron@plt>
mov    $0x5,%edi
mov    $0x1,%esi
lea    0xe70(%rip),%rdx
movzbl -0x1(%rbp),%ecx
call   1080 <mvprintw@plt>
mov    $0x5,%edi
mov    $0x1d,%esi
lea    0xe7e(%rip),%rdx
lea    -0x8(%rbp),%rcx
call   1040 <mvscanw@plt>
mov    $0x3,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
mov    $0x0,%al
call   1070 <refresh_screen@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<analogRead>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    $0x3,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1050 <attron@plt>
lea    0xe81(%rip),%rdx
mov    $0x5,%edi
mov    $0x1,%esi
mov    %ebx,%ecx
call   1080 <mvprintw@plt>
lea    0xe91(%rip),%rdx
lea    0xc(%rsp),%rcx
mov    $0x5,%edi
mov    $0x1d,%esi
call   1040 <mvscanw@plt>
mov    $0x3,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
xor    %eax,%eax
call   1070 <refresh_screen@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Digite valor para porta A%d: __________\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @analogRead(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = call i32 @COLOR_PAIR(i32 3)
%5 = call i32 @attron(i32 %4)
%6 = load i8, i8* %2
%7 = call i32 @mvprintw(i32 5, i32 1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
%8 = call i32 @mvscanw(i32 5, i32 29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = call i32 @COLOR_PAIR(i32 3)
%10 = call i32 @attroff(i32 %9)
%11 = call i32 (...) @refresh_screen()
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [40 x i8] c"Digite valor para porta A%d: __________\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @analogRead(i8 zeroext %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @COLOR_PAIR(i32 3)
%5 = tail call i32 @attron(i32 %4)
%6 = tail call i32 @mvprintw(i32 5, i32 1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8 zeroext %0)
%7 = call i32 @mvscanw(i32 5, i32 29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = call i32 @COLOR_PAIR(i32 3)
%9 = call i32 @attroff(i32 %8)
%10 = call i32 (...) @refresh_screen()
%11 = load i32, i32* %2
ret i32 %11
}