#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*/ motor_driver_standby(int);
int /*<<< orphan*/ system(char *);
void motor_driver_disable() {
  motor_driver_standby(1);
  system("echo 48 > /sys/class/gpio/unexport");
  system("echo 47 > /sys/class/gpio/unexport");
  system("echo 15 > /sys/class/gpio/unexport");
  system("echo 14 > /sys/class/gpio/unexport");
  system("echo 49 > /sys/class/gpio/unexport");
  system("echo 0 > /sys/class/pwm/pwmchip0/pwm0/enable");
  system("echo 0 > /sys/class/pwm/pwmchip0/pwm1/enable");
  system("echo 0 > /sys/class/pwm/pwmchip0/unexport");
  system("echo 1 > /sys/class/pwm/pwmchip0/unexport");
}


x86 assembly (clang, -O0):
<motor_driver_disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <motor_driver_standby@plt>
lea    0xecb(%rip),%rdi
call   1040 <system@plt>
lea    0xee2(%rip),%rdi
call   1040 <system@plt>
lea    0xef9(%rip),%rdi
call   1040 <system@plt>
lea    0xf10(%rip),%rdi
call   1040 <system@plt>
lea    0xf27(%rip),%rdi
call   1040 <system@plt>
lea    0xf3e(%rip),%rdi
call   1040 <system@plt>
lea    0xf5f(%rip),%rdi
call   1040 <system@plt>
lea    0xf80(%rip),%rdi
call   1040 <system@plt>
lea    0xf9e(%rip),%rdi
call   1040 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<motor_driver_disable>:
push   %rax
mov    $0x1,%edi
call   1030 <motor_driver_standby@plt>
lea    0xece(%rip),%rdi
call   1040 <system@plt>
lea    0xee5(%rip),%rdi
call   1040 <system@plt>
lea    0xefc(%rip),%rdi
call   1040 <system@plt>
lea    0xf13(%rip),%rdi
call   1040 <system@plt>
lea    0xf2a(%rip),%rdi
call   1040 <system@plt>
lea    0xf41(%rip),%rdi
call   1040 <system@plt>
lea    0xf62(%rip),%rdi
call   1040 <system@plt>
lea    0xf83(%rip),%rdi
call   1040 <system@plt>
lea    0xfa1(%rip),%rdi
pop    %rax
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"echo 48 > /sys/class/gpio/unexport\00"
@.str.1 = [35 x i8] c"echo 47 > /sys/class/gpio/unexport\00"
@.str.2 = [35 x i8] c"echo 15 > /sys/class/gpio/unexport\00"
@.str.3 = [35 x i8] c"echo 14 > /sys/class/gpio/unexport\00"
@.str.4 = [35 x i8] c"echo 49 > /sys/class/gpio/unexport\00"
@.str.5 = [45 x i8] c"echo 0 > /sys/class/pwm/pwmchip0/pwm0/enable\00"
@.str.6 = [45 x i8] c"echo 0 > /sys/class/pwm/pwmchip0/pwm1/enable\00"
@.str.7 = [42 x i8] c"echo 0 > /sys/class/pwm/pwmchip0/unexport\00"
@.str.8 = [42 x i8] c"echo 1 > /sys/class/pwm/pwmchip0/unexport\00"
define void @motor_driver_disable() {
%1 = call i32 @motor_driver_standby(i32 1)
%2 = call i32 @system(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @system(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @system(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @system(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 @system(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 @system(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.7, i64 0, i64 0))
%10 = call i32 @system(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"echo 48 > /sys/class/gpio/unexport\00"
@.str.1 = [35 x i8] c"echo 47 > /sys/class/gpio/unexport\00"
@.str.2 = [35 x i8] c"echo 15 > /sys/class/gpio/unexport\00"
@.str.3 = [35 x i8] c"echo 14 > /sys/class/gpio/unexport\00"
@.str.4 = [35 x i8] c"echo 49 > /sys/class/gpio/unexport\00"
@.str.5 = [45 x i8] c"echo 0 > /sys/class/pwm/pwmchip0/pwm0/enable\00"
@.str.6 = [45 x i8] c"echo 0 > /sys/class/pwm/pwmchip0/pwm1/enable\00"
@.str.7 = [42 x i8] c"echo 0 > /sys/class/pwm/pwmchip0/unexport\00"
@.str.8 = [42 x i8] c"echo 1 > /sys/class/pwm/pwmchip0/unexport\00"
define void @motor_driver_disable() {
%1 = tail call i32 @motor_driver_standby(i32 1)
%2 = tail call i32 @system(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @system(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @system(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 @system(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0))
%8 = tail call i32 @system(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0))
%9 = tail call i32 @system(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.7, i64 0, i64 0))
%10 = tail call i32 @system(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0))
ret void
}