#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*/ pwmOn();
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ usleep(int);
void forward() {
  printf("AVANTI\n\r");
  pwmOff();
  pwmOn();
  system("echo  1450000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle");
  system("echo  1550000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle");
  usleep(10000);
  system("echo  1300000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle");
  system("echo  1700000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle");
  usleep(10000);
  system("echo  1100000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle");
  system("echo  1900000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle");
  usleep(10000);
}


x86 assembly (clang, -O0):
<forward>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <pwmOff@plt>
mov    $0x0,%al
call   1050 <pwmOn@plt>
lea    0xe94(%rip),%rdi
call   1030 <system@plt>
lea    0xec0(%rip),%rdi
call   1030 <system@plt>
mov    $0x2710,%edi
call   1070 <usleep@plt>
lea    0xee2(%rip),%rdi
call   1030 <system@plt>
lea    0xf0e(%rip),%rdi
call   1030 <system@plt>
mov    $0x2710,%edi
call   1070 <usleep@plt>
lea    0xf30(%rip),%rdi
call   1030 <system@plt>
lea    0xf5c(%rip),%rdi
call   1030 <system@plt>
mov    $0x2710,%edi
call   1070 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<forward>:
push   %rax
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <pwmOff@plt>
xor    %eax,%eax
call   1050 <pwmOn@plt>
lea    0xe97(%rip),%rdi
call   1030 <system@plt>
lea    0xec3(%rip),%rdi
call   1030 <system@plt>
mov    $0x2710,%edi
call   1070 <usleep@plt>
lea    0xee5(%rip),%rdi
call   1030 <system@plt>
lea    0xf11(%rip),%rdi
call   1030 <system@plt>
mov    $0x2710,%edi
call   1070 <usleep@plt>
lea    0xf33(%rip),%rdi
call   1030 <system@plt>
lea    0xf5f(%rip),%rdi
call   1030 <system@plt>
mov    $0x2710,%edi
pop    %rax
jmp    1070 <usleep@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"AVANTI\0A\0D\00"
@.str.1 = [56 x i8] c"echo 1450000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle\00"
@.str.2 = [56 x i8] c"echo 1550000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle\00"
@.str.3 = [56 x i8] c"echo 1300000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle\00"
@.str.4 = [56 x i8] c"echo 1700000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle\00"
@.str.5 = [56 x i8] c"echo 1100000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle\00"
@.str.6 = [56 x i8] c"echo 1900000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle\00"
define void @forward() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @pwmOff()
%3 = call i32 (...) @pwmOn()
%4 = call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @usleep(i32 10000)
%7 = call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @usleep(i32 10000)
%10 = call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.6, i64 0, i64 0))
%12 = call i32 @usleep(i32 10000)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"AVANTI\0A\0D\00"
@.str.1 = [56 x i8] c"echo 1450000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle\00"
@.str.2 = [56 x i8] c"echo 1550000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle\00"
@.str.3 = [56 x i8] c"echo 1300000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle\00"
@.str.4 = [56 x i8] c"echo 1700000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle\00"
@.str.5 = [56 x i8] c"echo 1100000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle\00"
@.str.6 = [56 x i8] c"echo 1900000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle\00"
define void @forward() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @pwmOff()
%3 = tail call i32 (...) @pwmOn()
%4 = tail call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @usleep(i32 10000)
%7 = tail call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0))
%9 = tail call i32 @usleep(i32 10000)
%10 = tail call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.5, i64 0, i64 0))
%11 = tail call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.6, i64 0, i64 0))
%12 = tail call i32 @usleep(i32 10000)
ret void
}