#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*/ clear_pin(unsigned int volatile *, int);
scalar_t__ map_memory(int, int);
int /*<<< orphan*/ set_mode(unsigned int volatile *, int, int);
int /*<<< orphan*/ set_value(unsigned int volatile *, int, int);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  int index = 0;
  int size = argc - 1;
  volatile unsigned *gpio;
  gpio = (volatile unsigned *)map_memory((0x3F000000 + 0x200000), (4 * 1024));
  set_mode(gpio, 23, 1);
  while (1 == 1) {
    set_value(gpio, 23, 1);
    sleep(1);
    clear_pin(gpio, 23);
    sleep(1);
  }
  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)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    $0x3f200000,%edi
mov    $0x1000,%esi
call   1070 <map_memory@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x17,%esi
mov    $0x1,%edx
call   1030 <set_mode@plt>
mov    -0x20(%rbp),%rdi
mov    $0x17,%esi
mov    $0x1,%edx
call   1040 <set_value@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    -0x20(%rbp),%rdi
mov    $0x17,%esi
call   1060 <clear_pin@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    119c <main+0x4c>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3f200000,%edi
mov    $0x1000,%esi
call   1070 <map_memory@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x17,%esi
mov    $0x1,%edx
call   1030 <set_mode@plt>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    $0x17,%esi
mov    $0x1,%edx
call   1040 <set_value@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    %rbx,%rdi
mov    $0x17,%esi
call   1060 <clear_pin@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1180 <main+0x30>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
store i32 %10, i32* %7
%11 = call i64 @map_memory(i32 1059061760, i32 4096)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %8
%13 = load i32*, i32** %8
%14 = call i32 @set_mode(i32* %13, i32 23, i32 1)
br label %15
15: ; preds = %2, %15
%16 = load i32*, i32** %8
%17 = call i32 @set_value(i32* %16, i32 23, i32 1)
%18 = call i32 @sleep(i32 1)
%19 = load i32*, i32** %8
%20 = call i32 @clear_pin(i32* %19, i32 23)
%21 = call i32 @sleep(i32 1)
br label %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @map_memory(i32 1059061760, i32 4096)
%4 = inttoptr i64 %3 to i32*
%5 = tail call i32 @set_mode(i32* %4, i32 23, i32 1)
br label %6
6: ; preds = %6, %2
%7 = tail call i32 @set_value(i32* %4, i32 23, i32 1)
%8 = tail call i32 @sleep(i32 1)
%9 = tail call i32 @clear_pin(i32* %4, i32 23)
%10 = tail call i32 @sleep(i32 1)
br label %6
}