#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*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ system(char *);
void pinMode(int portNumber, char portType[6]) {
  char command[50];
  char portString[2];
  sprintf(portString, "%d", portNumber);
  strcpy(command, "gpio mode ");
  strcat(command, portString);
  strcat(command, " ");
  strcat(command, portType);
  system(command);
}


x86 assembly (clang, -O0):
<pinMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x52(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xea3(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x50(%rbp),%rdi
lea    0xe96(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x50(%rbp),%rdi
lea    -0x52(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x50(%rbp),%rdi
lea    0xe82(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x50(%rbp),%rdi
call   1040 <system@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pinMode>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %rsi,%r14
mov    %edi,%edx
lea    0xeab(%rip),%rsi
lea    0xe(%rsp),%r15
mov    %r15,%rdi
call   1060 <sprintf@plt>
lea    0xe9a(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <strcat@plt>
lea    0xe84(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"gpio mode \00"
@.str.2 = [2 x i8] c" \00"
define void @pinMode(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [50 x i8]
%6 = alloca [2 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%12 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%14 = call i32 @strcat(i8* %12, i8* %13)
%15 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%16 = call i32 @strcat(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%17 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%18 = load i8*, i8** %4
%19 = call i32 @strcat(i8* %17, i8* %18)
%20 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%21 = call i32 @system(i8* %20)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"gpio mode \00"
@.str.2 = [2 x i8] c" \00"
define void @pinMode(i32 %0, i8* %1) {
%3 = alloca [50 x i8]
%4 = alloca [2 x i8]
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%8 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @strcat(i8* %5, i8* %6)
%10 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @strcat(i8* %5, i8* %1)
%12 = call i32 @system(i8* %5)
ret void
}