#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 *);
int /*<<< orphan*/ pwmOff();
int /*<<< orphan*/ system(char *);
void initPwm() {
  printf("InitPwm\n\r");
  system("echo 0 > /sys/class/pwm/pwmchip0/export");
  system("echo 1 > /sys/class/pwm/pwmchip0/export");
  system("echo 20000000 > /sys/class/pwm/pwmchip0/pwm0/period");
  system("echo 20000000 > /sys/class/pwm/pwmchip0/pwm1/period");
  pwmOff();
}


x86 assembly (clang, -O0):
<initPwm>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
call   1030 <system@plt>
lea    0xedf(%rip),%rdi
call   1030 <system@plt>
lea    0xefb(%rip),%rdi
call   1030 <system@plt>
lea    0xf23(%rip),%rdi
call   1030 <system@plt>
mov    $0x0,%al
call   1050 <pwmOff@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initPwm>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
call   1030 <system@plt>
lea    0xee2(%rip),%rdi
call   1030 <system@plt>
lea    0xefe(%rip),%rdi
call   1030 <system@plt>
lea    0xf26(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <pwmOff@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"InitPwm\0A\0D\00"
@.str.1 = [40 x i8] c"echo 0 > /sys/class/pwm/pwmchip0/export\00"
@.str.2 = [40 x i8] c"echo 1 > /sys/class/pwm/pwmchip0/export\00"
@.str.3 = [52 x i8] c"echo 20000000 > /sys/class/pwm/pwmchip0/pwm0/period\00"
@.str.4 = [52 x i8] c"echo 20000000 > /sys/class/pwm/pwmchip0/pwm1/period\00"
define void @initPwm() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @system(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 (...) @pwmOff()
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"InitPwm\0A\0D\00"
@.str.1 = [40 x i8] c"echo 0 > /sys/class/pwm/pwmchip0/export\00"
@.str.2 = [40 x i8] c"echo 1 > /sys/class/pwm/pwmchip0/export\00"
@.str.3 = [52 x i8] c"echo 20000000 > /sys/class/pwm/pwmchip0/pwm0/period\00"
@.str.4 = [52 x i8] c"echo 20000000 > /sys/class/pwm/pwmchip0/pwm1/period\00"
define void @initPwm() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @system(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 (...) @pwmOff()
ret void
}