#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*/ __tcu_disable_pwm_output(int);
int /*<<< orphan*/ __tcu_enable_pwm_output(int);
int /*<<< orphan*/ __tcu_set_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ __tcu_set_full_data(int, int);
int /*<<< orphan*/ __tcu_set_half_data(int, int);
int /*<<< orphan*/ __tcu_set_pwm_output_shutdown_abrupt(int);
int /*<<< orphan*/ __tcu_start_counter(int);
int /*<<< orphan*/ __tcu_stop_counter(int);
void __lcd_pwm_set_backlight_level(int n) {
  __tcu_stop_counter(2);
  __tcu_set_pwm_output_shutdown_abrupt(2);
  __tcu_disable_pwm_output(2);
  __tcu_set_count(2, 0);
  __tcu_set_full_data(2, 100 + 1);
  __tcu_set_half_data(2, n);
  __tcu_enable_pwm_output(2);
  __tcu_start_counter(2);
  return;
}


x86 assembly (clang, -O0):
<__lcd_pwm_set_backlight_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2,%edi
call   1090 <__tcu_stop_counter@plt>
mov    $0x2,%edi
call   1030 <__tcu_set_pwm_output_shutdown_abrupt@plt>
mov    $0x2,%edi
call   1070 <__tcu_disable_pwm_output@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1060 <__tcu_set_count@plt>
mov    $0x2,%edi
mov    $0x65,%esi
call   10a0 <__tcu_set_full_data@plt>
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1080 <__tcu_set_half_data@plt>
mov    $0x2,%edi
call   1050 <__tcu_enable_pwm_output@plt>
mov    $0x2,%edi
call   1040 <__tcu_start_counter@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lcd_pwm_set_backlight_level>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%edi
call   1090 <__tcu_stop_counter@plt>
mov    $0x2,%edi
call   1030 <__tcu_set_pwm_output_shutdown_abrupt@plt>
mov    $0x2,%edi
call   1070 <__tcu_disable_pwm_output@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1060 <__tcu_set_count@plt>
mov    $0x2,%edi
mov    $0x65,%esi
call   10a0 <__tcu_set_full_data@plt>
mov    $0x2,%edi
mov    %ebx,%esi
call   1080 <__tcu_set_half_data@plt>
mov    $0x2,%edi
call   1050 <__tcu_enable_pwm_output@plt>
mov    $0x2,%edi
pop    %rbx
jmp    1040 <__tcu_start_counter@plt>

LLVM IR (-O0):
define void @__lcd_pwm_set_backlight_level(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @__tcu_stop_counter(i32 2)
%4 = call i32 @__tcu_set_pwm_output_shutdown_abrupt(i32 2)
%5 = call i32 @__tcu_disable_pwm_output(i32 2)
%6 = call i32 @__tcu_set_count(i32 2, i32 0)
%7 = call i32 @__tcu_set_full_data(i32 2, i32 101)
%8 = load i32, i32* %2
%9 = call i32 @__tcu_set_half_data(i32 2, i32 %8)
%10 = call i32 @__tcu_enable_pwm_output(i32 2)
%11 = call i32 @__tcu_start_counter(i32 2)
ret void
}

LLVM IR (-O2):
define void @__lcd_pwm_set_backlight_level(i32 %0) {
%2 = tail call i32 @__tcu_stop_counter(i32 2)
%3 = tail call i32 @__tcu_set_pwm_output_shutdown_abrupt(i32 2)
%4 = tail call i32 @__tcu_disable_pwm_output(i32 2)
%5 = tail call i32 @__tcu_set_count(i32 2, i32 0)
%6 = tail call i32 @__tcu_set_full_data(i32 2, i32 101)
%7 = tail call i32 @__tcu_set_half_data(i32 2, i32 %0)
%8 = tail call i32 @__tcu_enable_pwm_output(i32 2)
%9 = tail call i32 @__tcu_start_counter(i32 2)
ret void
}