#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ intToChar(int, char *);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
void PIN_OFF(int n) {
  char command[100] = "echo low > /sys/class/gpio/gpio";
  char no_pin[3] = "";
  char comman_end[11] = "/direction";
  int j = n;
  intToChar(j, no_pin);
  strcat(command, no_pin);
  strcat(command, comman_end);
  FILE *TestConsole = popen(command, "w");
  fclose(TestConsole);
}


x86 assembly (clang, -O0):
<PIN_OFF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xe87(%rip),%rsi
mov    $0x64,%edx
call   1050 <memcpy@plt>
lea    -0x73(%rbp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1040 <memset@plt>
mov    0xeca(%rip),%rax
mov    %rax,-0x7e(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x76(%rbp)
mov    0xebf(%rip),%al
mov    %al,-0x74(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%edi
lea    -0x73(%rbp),%rsi
call   1070 <intToChar@plt>
lea    -0x70(%rbp),%rdi
lea    -0x73(%rbp),%rsi
call   1080 <strcat@plt>
lea    -0x70(%rbp),%rdi
lea    -0x7e(%rbp),%rsi
call   1080 <strcat@plt>
lea    -0x70(%rbp),%rdi
lea    0xe80(%rip),%rsi
call   1060 <popen@plt>
mov    %rax,-0x90(%rbp)
mov    -0x90(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIN_OFF>:
push   %r14
push   %rbx
sub    $0x88,%rsp
movaps 0xeff(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xee3(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xec7(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeab(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe8f(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe73(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movl   $0x0,0x80(%rsp)
movb   $0x0,0xe(%rsp)
movw   $0x0,0xc(%rsp)
movabs $0x697463657269642f,%rax
63 74 69
mov    %rax,0x10(%rsp)
movl   $0x6e6f69,0x17(%rsp)
lea    0xc(%rsp),%r14
mov    %r14,%rsi
call   1050 <intToChar@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
lea    0xe7e(%rip),%rsi
mov    %rbx,%rdi
call   1040 <popen@plt>
mov    %rax,%rdi
call   1030 <fclose@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.PIN_OFF.command = [100 x i8] c"echo low > /sys/class/gpio/gpio\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.PIN_OFF.comman_end = [11 x i8] c"/direction\00"
@.str = [2 x i8] c"w\00"
define void @PIN_OFF(i32 %0) {
%2 = alloca i32
%3 = alloca [100 x i8]
%4 = alloca [3 x i8]
%5 = alloca [11 x i8]
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %2
%8 = bitcast [100 x i8]* %3 to i8*
%9 = bitcast [3 x i8]* %4 to i8*
%10 = bitcast [11 x i8]* %5 to i8*
%11 = load i32, i32* %2
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%14 = call i32 @intToChar(i32 %12, i8* %13)
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%16 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%17 = call i32 @strcat(i8* %15, i8* %16)
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%19 = getelementptr inbounds [11 x i8], [11 x i8]* %5, i64 0, i64 0
%20 = call i32 @strcat(i8* %18, i8* %19)
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%22 = call i32* @popen(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %22, i32** %7
%23 = load i32*, i32** %7
%24 = call i32 @fclose(i32* %23)
ret void
}

LLVM IR (-O2):
@__const.PIN_OFF.command = [100 x i8] c"echo low > /sys/class/gpio/gpio\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.PIN_OFF.comman_end = [11 x i8] c"/direction\00"
@.str = [2 x i8] c"w\00"
define void @PIN_OFF(i32 %0) {
%2 = alloca [100 x i8]
%3 = alloca [3 x i8]
%4 = alloca [11 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 0
%8 = call i32 @intToChar(i32 %0, i8* %6)
%9 = call i32 @strcat(i8* %5, i8* %6)
%10 = call i32 @strcat(i8* %5, i8* %7)
%11 = call i32* @popen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @fclose(i32* %11)
ret void
}