#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*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int wiringXAnalogRead(int);
int /*<<< orphan*/ wiringXGC();
int wiringXSetup(char *, int /*<<< orphan*/ *);
int main(void) {
  int data = 0;
  if (wiringXSetup("pcduino1", NULL) == -1) {
    wiringXGC();
    return -1;
  }
  while (1) {
    data = wiringXAnalogRead(0);
    printf("result:%d\n", data);
    data = wiringXAnalogRead(1);
    printf("result:%d\n", data);
    data = wiringXAnalogRead(2);
    printf("result:%d\n", data);
    sleep(2);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xe93(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <wiringXSetup@plt>
cmp    $0xffffffff,%eax
jne    1191 <main+0x41>
mov    $0x0,%al
call   1040 <wiringXGC@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1196 <main+0x46>
xor    %edi,%edi
call   1060 <wiringXAnalogRead@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe5f(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1060 <wiringXAnalogRead@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe43(%rip),%rdi
call   1050 <printf@plt>
mov    $0x2,%edi
call   1060 <wiringXAnalogRead@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe27(%rip),%rdi
call   1050 <printf@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
jmp    1196 <main+0x46>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xea8(%rip),%rdi
xor    %esi,%esi
call   1030 <wiringXSetup@plt>
cmp    $0xffffffff,%eax
je     11b5 <main+0x65>
lea    0xe9e(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1060 <wiringXAnalogRead@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1060 <wiringXAnalogRead@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    $0x2,%edi
call   1060 <wiringXAnalogRead@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
jmp    1170 <main+0x20>
xor    %eax,%eax
call   1040 <wiringXGC@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"pcduino1\00"
@.str.1 = [11 x i8] c"result:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @wiringXSetup(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* null)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @wiringXGC()
ret i32 -1
7: ; preds = %0
br label %8
8: ; preds = %7, %8
%9 = call i32 @wiringXAnalogRead(i32 0)
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i32 @wiringXAnalogRead(i32 1)
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = call i32 @wiringXAnalogRead(i32 2)
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = call i32 @sleep(i32 2)
br label %8
}

LLVM IR (-O2):
@.str = [9 x i8] c"pcduino1\00"
@.str.1 = [11 x i8] c"result:%d\0A\00"
define i32 @main() {
%1 = tail call i32 @wiringXSetup(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* null)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @wiringXGC()
ret i32 -1
5: ; preds = %0, %5
%6 = tail call i32 @wiringXAnalogRead(i32 0)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = tail call i32 @wiringXAnalogRead(i32 1)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = tail call i32 @wiringXAnalogRead(i32 2)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = tail call i32 @sleep(i32 2)
br label %5
}