#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*/ input_is_joystick_ignored();
int /*<<< orphan*/ preferences_set_fullscreen(int /*<<< orphan*/);
int /*<<< orphan*/ preferences_set_showfps(int /*<<< orphan*/);
int /*<<< orphan*/ preferences_set_smooth(int /*<<< orphan*/);
int /*<<< orphan*/ preferences_set_usegamepad(int);
int /*<<< orphan*/ preferences_set_videoresolution(int /*<<< orphan*/);
int /*<<< orphan*/ video_get_resolution();
int /*<<< orphan*/ video_is_fps_visible();
int /*<<< orphan*/ video_is_fullscreen();
int /*<<< orphan*/ video_is_smooth();
void save_preferences() {
  preferences_set_videoresolution(video_get_resolution());
  preferences_set_fullscreen(video_is_fullscreen());
  preferences_set_smooth(video_is_smooth());
  preferences_set_showfps(video_is_fps_visible());
  preferences_set_usegamepad(!input_is_joystick_ignored());
}


x86 assembly (clang, -O0):
<save_preferences>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <video_get_resolution@plt>
mov    %eax,%edi
call   1090 <preferences_set_videoresolution@plt>
mov    $0x0,%al
call   10c0 <video_is_fullscreen@plt>
mov    %eax,%edi
call   1080 <preferences_set_fullscreen@plt>
mov    $0x0,%al
call   1050 <video_is_smooth@plt>
mov    %eax,%edi
call   1040 <preferences_set_smooth@plt>
mov    $0x0,%al
call   10b0 <video_is_fps_visible@plt>
mov    %eax,%edi
call   10a0 <preferences_set_showfps@plt>
mov    $0x0,%al
call   1030 <input_is_joystick_ignored@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <preferences_set_usegamepad@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_preferences>:
push   %rax
xor    %eax,%eax
call   1060 <video_get_resolution@plt>
mov    %eax,%edi
call   1090 <preferences_set_videoresolution@plt>
xor    %eax,%eax
call   10c0 <video_is_fullscreen@plt>
mov    %eax,%edi
call   1080 <preferences_set_fullscreen@plt>
xor    %eax,%eax
call   1050 <video_is_smooth@plt>
mov    %eax,%edi
call   1040 <preferences_set_smooth@plt>
xor    %eax,%eax
call   10b0 <video_is_fps_visible@plt>
mov    %eax,%edi
call   10a0 <preferences_set_showfps@plt>
xor    %eax,%eax
call   1030 <input_is_joystick_ignored@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rax
jmp    1070 <preferences_set_usegamepad@plt>

LLVM IR (-O0):
define void @save_preferences() {
%1 = call i32 (...) @video_get_resolution()
%2 = call i32 @preferences_set_videoresolution(i32 %1)
%3 = call i32 (...) @video_is_fullscreen()
%4 = call i32 @preferences_set_fullscreen(i32 %3)
%5 = call i32 (...) @video_is_smooth()
%6 = call i32 @preferences_set_smooth(i32 %5)
%7 = call i32 (...) @video_is_fps_visible()
%8 = call i32 @preferences_set_showfps(i32 %7)
%9 = call i32 (...) @input_is_joystick_ignored()
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
%13 = call i32 @preferences_set_usegamepad(i32 %12)
ret void
}

LLVM IR (-O2):
define void @save_preferences() {
%1 = tail call i32 (...) @video_get_resolution()
%2 = tail call i32 @preferences_set_videoresolution(i32 %1)
%3 = tail call i32 (...) @video_is_fullscreen()
%4 = tail call i32 @preferences_set_fullscreen(i32 %3)
%5 = tail call i32 (...) @video_is_smooth()
%6 = tail call i32 @preferences_set_smooth(i32 %5)
%7 = tail call i32 (...) @video_is_fps_visible()
%8 = tail call i32 @preferences_set_showfps(i32 %7)
%9 = tail call i32 (...) @input_is_joystick_ignored()
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @preferences_set_usegamepad(i32 %11)
ret void
}