#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 *, long);
int /*<<< orphan*/ readUI(int, int, int /*<<< orphan*/, long *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ writeDO(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ writeUO(int, int, int, int);
int main(int argc, char *argv[]) {
  signed long retvalue;
  int i;
  readUI(2, 1, 0, &retvalue);
  printf("Resistance Input 1 : %i\n", retvalue);
  sleep(2);
  writeDO(1, 1, 0);
  sleep(2);
  writeDO(1, 1, 0);
  sleep(2);
  writeUO(3, 1, 0, 0);
  sleep(2);
  writeUO(3, 1, 0, 1);
  sleep(2);
  writeUO(3, 1, 1, 50);
  sleep(2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%edi
mov    $0x1,%esi
xor    %edx,%edx
lea    -0x18(%rbp),%rcx
call   1040 <readUI@plt>
mov    -0x18(%rbp),%rsi
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
mov    $0x1,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1060 <writeDO@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
mov    $0x1,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1060 <writeDO@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
mov    $0x3,%edi
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1050 <writeUO@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
mov    $0x3,%edi
mov    $0x1,%ecx
xor    %edx,%edx
mov    %ecx,%esi
call   1050 <writeUO@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
mov    $0x3,%edi
mov    $0x1,%edx
mov    $0x32,%ecx
mov    %edx,%esi
call   1050 <writeUO@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rcx
mov    $0x2,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <readUI@plt>
mov    (%rsp),%rsi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
mov    $0x1,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1060 <writeDO@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
mov    $0x1,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1060 <writeDO@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
mov    $0x3,%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1050 <writeUO@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
mov    $0x3,%edi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1050 <writeUO@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x32,%ecx
call   1050 <writeUO@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Resistance Input 1 : %i\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @readUI(i32 2, i32 1, i32 0, i64* %6)
%9 = load i64, i64* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = call i32 @sleep(i32 2)
%12 = call i32 @writeDO(i32 1, i32 1, i32 0)
%13 = call i32 @sleep(i32 2)
%14 = call i32 @writeDO(i32 1, i32 1, i32 0)
%15 = call i32 @sleep(i32 2)
%16 = call i32 @writeUO(i32 3, i32 1, i32 0, i32 0)
%17 = call i32 @sleep(i32 2)
%18 = call i32 @writeUO(i32 3, i32 1, i32 0, i32 1)
%19 = call i32 @sleep(i32 2)
%20 = call i32 @writeUO(i32 3, i32 1, i32 1, i32 50)
%21 = call i32 @sleep(i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Resistance Input 1 : %i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @readUI(i32 2, i32 1, i32 0, i64* %3)
%6 = load i64, i64* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i64 %6)
%8 = call i32 @sleep(i32 2)
%9 = call i32 @writeDO(i32 1, i32 1, i32 0)
%10 = call i32 @sleep(i32 2)
%11 = call i32 @writeDO(i32 1, i32 1, i32 0)
%12 = call i32 @sleep(i32 2)
%13 = call i32 @writeUO(i32 3, i32 1, i32 0, i32 0)
%14 = call i32 @sleep(i32 2)
%15 = call i32 @writeUO(i32 3, i32 1, i32 0, i32 1)
%16 = call i32 @sleep(i32 2)
%17 = call i32 @writeUO(i32 3, i32 1, i32 1, i32 50)
%18 = call i32 @sleep(i32 2)
ret i32 0
}