#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 */
struct lcd_screen_info {
  int dummy;
};

/* Variables and functions */
unsigned short get_clkval(struct lcd_screen_info *, unsigned short,
                          unsigned long);
unsigned short get_framerate(struct lcd_screen_info *, int /*<<< orphan*/,
                             unsigned long);
int /*<<< orphan*/ set_clkval(struct lcd_screen_info *, unsigned short);
unsigned short set_framerate(struct lcd_screen_info *screeninfo,
                             unsigned short framerate,
                             unsigned long hclk_rate) {
  unsigned short clkval;
  clkval = get_clkval(screeninfo, framerate, hclk_rate);
  return get_framerate(screeninfo, set_clkval(screeninfo, clkval), hclk_rate);
}


x86 assembly (clang, -O0):
<set_framerate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    -0x18(%rbp),%rdx
movzwl %ax,%esi
call   1030 <get_clkval@plt>
mov    %ax,-0x1a(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
movzwl -0x1a(%rbp),%esi
call   1040 <set_clkval@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
mov    -0x18(%rbp),%rdx
call   1050 <get_framerate@plt>
movzwl %ax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_framerate>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <get_clkval@plt>
movzwl %ax,%esi
mov    %rbx,%rdi
call   1040 <set_clkval@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <get_framerate@plt>

LLVM IR (-O0):
%struct.lcd_screen_info = type { i32 }
define zeroext i16 @set_framerate(%struct.lcd_screen_info* %0, i16 zeroext %1, i64 %2) {
%4 = alloca %struct.lcd_screen_info*
%5 = alloca i16
%6 = alloca i64
%7 = alloca i16
store %struct.lcd_screen_info* %0, %struct.lcd_screen_info** %4
store i16 %1, i16* %5
store i64 %2, i64* %6
%8 = load %struct.lcd_screen_info*, %struct.lcd_screen_info** %4
%9 = load i16, i16* %5
%10 = load i64, i64* %6
%11 = call zeroext i16 @get_clkval(%struct.lcd_screen_info* %8, i16 zeroext %9, i64 %10)
store i16 %11, i16* %7
%12 = load %struct.lcd_screen_info*, %struct.lcd_screen_info** %4
%13 = load %struct.lcd_screen_info*, %struct.lcd_screen_info** %4
%14 = load i16, i16* %7
%15 = call i32 @set_clkval(%struct.lcd_screen_info* %13, i16 zeroext %14)
%16 = load i64, i64* %6
%17 = call zeroext i16 @get_framerate(%struct.lcd_screen_info* %12, i32 %15, i64 %16)
ret i16 %17
}

LLVM IR (-O2):
%struct.lcd_screen_info = type { i32 }
define zeroext i16 @set_framerate(%struct.lcd_screen_info* %0, i16 zeroext %1, i64 %2) {
%4 = tail call zeroext i16 @get_clkval(%struct.lcd_screen_info* %0, i16 zeroext %1, i64 %2)
%5 = tail call i32 @set_clkval(%struct.lcd_screen_info* %0, i16 zeroext %4)
%6 = tail call zeroext i16 @get_framerate(%struct.lcd_screen_info* %0, i32 %5, i64 %2)
ret i16 %6
}