void get_settings(void) {
  int err;
  unsigned long mode;
  int setting;
  int left, top, width, height;
  unsigned int yc_filter;
  printf("Videoparameters:\n");
  printf("  output:\n");
  err = FS460_get_tv_standard(&mode);
  if (err)
    printf("    std=<err %u>, ", err);
  else
    printf("    std=%s, ", str_TVStandard(mode));
  err = FS460_get_available_tv_standards(&mode);
  if (err)
    printf("avail stds=<err %u>\n", err);
  else
    printf("avail stds=0x%08lx\n", mode);
  err = FS460_get_vga_mode(&mode);
  if (err)
    printf("    vgamode=<err %u>, ", err);
  else
    printf("    vgamode=%s, ", str_VgaMode(mode));
  err = FS460_get_available_vga_modes(&mode);
  if (err)
    printf("avail vgamodes=<err %u>\n", err);
  else
    printf("avail vgamodes=0x%04lx\n", mode);
  err = FS460_get_tvout_mode(&mode);
  if (err)
    printf("    tvout mode=<err %u>\n", err);
  else {
    switch (mode) {
    case 1:
      printf("    tvout mode=CVBS + Y/C\n");
      break;
    case 2:
      printf("    tvout mode=RGB\n");
      break;
    default:
      printf("    tvout mode=0x%04lx\n", mode);
      break;
    }
  }
  printf("  VGA position:\n");
  err = FS460_get_vga_position(&left, &top, &width, &height);
  if (err)
    printf("  VGA position=<err %u>\n", err);
  else
    printf("  VGA position=(%d,%d,%d,%d)\n", left, top, width, height);
  printf("  filters:\n");
  err = FS460_get_sharpness(&setting);
  if (err)
    printf("    sharpness=<err %u> ", err);
  else
    printf("    sharpness=%d ", setting);
  err = FS460_get_flicker_filter(&setting);
  if (err)
    printf("flicker=<err %u>\n", err);
  else
    printf("flicker=%d\n", setting);
  err = FS460_get_yc_filter(&yc_filter);
  if (err)
    printf("    yc_filter <err %u>\n", err);
  else {
    if (0x0001 & yc_filter)
      printf("    notch=on ");
    else
      printf("    notch=off");
    if (0x0002 & yc_filter)
      printf(" chroma=on\n");
    else
      printf(" chroma=off\n");
  }
  printf("  encoder:\n");
  err = FS460_get_color(&setting);
  if (err)
    printf("    color=<err %u>, ", err);
  else
    printf("    color=%d, ", setting);
  err = FS460_get_brightness(&setting);
  if (err)
    printf("brightness=<err %u>, ", err);
  else
    printf("brightness=%d, ", setting);
  err = FS460_get_contrast(&setting);
  if (err)
    printf("contrast=<err %u>\n", err);
  else
    printf("contrast=%d\n", setting);
}


x86 assembly (clang, -O0):
<get_settings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   10c0 <FS460_get_tv_standard@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1242 <get_settings+0x52>
mov    -0x4(%rbp),%esi
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
jmp    125d <get_settings+0x6d>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   10e0 <str_TVStandard@plt>
mov    %eax,%esi
lea    0xdda(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <FS460_get_available_tv_standards@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     128b <get_settings+0x9b>
mov    -0x4(%rbp),%esi
lea    0xdbe(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
jmp    129d <get_settings+0xad>
mov    -0x10(%rbp),%rsi
lea    0xdbc(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   10b0 <FS460_get_vga_mode@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     12cb <get_settings+0xdb>
mov    -0x4(%rbp),%esi
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
jmp    12e6 <get_settings+0xf6>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   10a0 <str_VgaMode@plt>
mov    %eax,%esi
lea    0xd9e(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <FS460_get_available_vga_modes@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1314 <get_settings+0x124>
mov    -0x4(%rbp),%esi
lea    0xd86(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
jmp    1326 <get_settings+0x136>
mov    -0x10(%rbp),%rsi
lea    0xd88(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1090 <FS460_get_tvout_mode@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1354 <get_settings+0x164>
mov    -0x4(%rbp),%esi
lea    0xd77(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
jmp    13bb <get_settings+0x1cb>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
sub    $0x1,%rax
je     137e <get_settings+0x18e>
jmp    136b <get_settings+0x17b>
mov    -0x30(%rbp),%rax
sub    $0x2,%rax
je     1391 <get_settings+0x1a1>
jmp    13a4 <get_settings+0x1b4>
lea    0xd53(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
jmp    13b6 <get_settings+0x1c6>
lea    0xd5b(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
jmp    13b6 <get_settings+0x1c6>
mov    -0x10(%rbp),%rsi
lea    0xd58(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
jmp    13bb <get_settings+0x1cb>
lea    0xd5d(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
lea    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
mov    $0x0,%al
call   1110 <FS460_get_vga_position@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1403 <get_settings+0x213>
mov    -0x4(%rbp),%esi
lea    0xd39(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
jmp    141e <get_settings+0x22e>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x24(%rbp),%r8d
lea    0xd32(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
lea    0xd42(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
lea    -0x14(%rbp),%rdi
mov    $0x0,%al
call   1100 <FS460_get_sharpness@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     145a <get_settings+0x26a>
mov    -0x4(%rbp),%esi
lea    0xd25(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
jmp    146b <get_settings+0x27b>
mov    -0x14(%rbp),%esi
lea    0xd27(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
lea    -0x14(%rbp),%rdi
mov    $0x0,%al
call   1080 <FS460_get_flicker_filter@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1499 <get_settings+0x2a9>
mov    -0x4(%rbp),%esi
lea    0xd10(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
jmp    14aa <get_settings+0x2ba>
mov    -0x14(%rbp),%esi
lea    0xd0c(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
lea    -0x28(%rbp),%rdi
mov    $0x0,%al
call   10f0 <FS460_get_yc_filter@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     14d8 <get_settings+0x2e8>
mov    -0x4(%rbp),%esi
lea    0xcef(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
jmp    153d <get_settings+0x34d>
mov    -0x28(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     14fa <get_settings+0x30a>
lea    0xce5(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
jmp    1508 <get_settings+0x318>
lea    0xce0(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
mov    -0x28(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     152a <get_settings+0x33a>
lea    0xcd1(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
jmp    1538 <get_settings+0x348>
lea    0xcca(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
jmp    153d <get_settings+0x34d>
lea    0xcc4(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
lea    -0x14(%rbp),%rdi
mov    $0x0,%al
call   1040 <FS460_get_color@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1579 <get_settings+0x389>
mov    -0x4(%rbp),%esi
lea    0xca7(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
jmp    158a <get_settings+0x39a>
mov    -0x14(%rbp),%esi
lea    0xca6(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
lea    -0x14(%rbp),%rdi
mov    $0x0,%al
call   1060 <FS460_get_brightness@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     15b8 <get_settings+0x3c8>
mov    -0x4(%rbp),%esi
lea    0xc8c(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
jmp    15c9 <get_settings+0x3d9>
mov    -0x14(%rbp),%esi
lea    0xc8c(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
lea    -0x14(%rbp),%rdi
mov    $0x0,%al
call   1070 <FS460_get_contrast@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     15f7 <get_settings+0x407>
mov    -0x4(%rbp),%esi
lea    0xc73(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
jmp    1608 <get_settings+0x418>
mov    -0x14(%rbp),%esi
lea    0xc70(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_settings>:
sub    $0x28,%rsp
lea    0xfe5(%rip),%rdi
call   1070 <puts@plt>
lea    0xfea(%rip),%rdi
call   1070 <puts@plt>
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   10d0 <FS460_get_tv_standard@plt>
test   %eax,%eax
je     1235 <get_settings+0x35>
lea    0xdcd(%rip),%rdi
jmp    1248 <get_settings+0x48>
mov    0x8(%rsp),%rdi
xor    %eax,%eax
call   10f0 <str_TVStandard@plt>
lea    0xdcb(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10e0 <printf@plt>
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   1030 <FS460_get_available_tv_standards@plt>
test   %eax,%eax
je     1273 <get_settings+0x73>
lea    0xdb8(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10e0 <printf@plt>
jmp    1286 <get_settings+0x86>
mov    0x8(%rsp),%rsi
lea    0xdb6(%rip),%rdi
xor    %eax,%eax
call   10e0 <printf@plt>
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   10c0 <FS460_get_vga_mode@plt>
test   %eax,%eax
je     129f <get_settings+0x9f>
lea    0xdac(%rip),%rdi
jmp    12b2 <get_settings+0xb2>
mov    0x8(%rsp),%rdi
xor    %eax,%eax
call   10b0 <str_VgaMode@plt>
lea    0xdae(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10e0 <printf@plt>
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   1050 <FS460_get_available_vga_modes@plt>
test   %eax,%eax
je     12dd <get_settings+0xdd>
lea    0xd9f(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10e0 <printf@plt>
jmp    12f0 <get_settings+0xf0>
mov    0x8(%rsp),%rsi
lea    0xda1(%rip),%rdi
xor    %eax,%eax
call   10e0 <printf@plt>
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   10a0 <FS460_get_tvout_mode@plt>
test   %eax,%eax
je     134d <get_settings+0x14d>
lea    0xd9b(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10e0 <printf@plt>
lea    0xf07(%rip),%rdi
call   1070 <puts@plt>
lea    0x24(%rsp),%rdi
lea    0x20(%rsp),%rsi
lea    0x1c(%rsp),%rdx
lea    0x18(%rsp),%rcx
xor    %eax,%eax
call   1120 <FS460_get_vga_position@plt>
test   %eax,%eax
je     1374 <get_settings+0x174>
lea    0xd91(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10e0 <printf@plt>
jmp    1393 <get_settings+0x193>
mov    0x8(%rsp),%rsi
cmp    $0x2,%rsi
je     14ed <get_settings+0x2ed>
cmp    $0x1,%rsi
jne    14fe <get_settings+0x2fe>
lea    0xeee(%rip),%rdi
call   1070 <puts@plt>
jmp    1310 <get_settings+0x110>
mov    0x24(%rsp),%esi
mov    0x20(%rsp),%edx
mov    0x1c(%rsp),%ecx
mov    0x18(%rsp),%r8d
lea    0xd60(%rip),%rdi
xor    %eax,%eax
call   10e0 <printf@plt>
lea    0xe94(%rip),%rdi
call   1070 <puts@plt>
lea    0x4(%rsp),%rdi
xor    %eax,%eax
call   1110 <FS460_get_sharpness@plt>
test   %eax,%eax
je     13ba <get_settings+0x1ba>
lea    0xd54(%rip),%rdi
mov    %eax,%esi
jmp    13c5 <get_settings+0x1c5>
mov    0x4(%rsp),%esi
lea    0xd5d(%rip),%rdi
xor    %eax,%eax
call   10e0 <printf@plt>
lea    0x4(%rsp),%rdi
xor    %eax,%eax
call   1090 <FS460_get_flicker_filter@plt>
test   %eax,%eax
je     13e7 <get_settings+0x1e7>
lea    0xd51(%rip),%rdi
mov    %eax,%esi
jmp    13f2 <get_settings+0x1f2>
mov    0x4(%rsp),%esi
lea    0xd54(%rip),%rdi
xor    %eax,%eax
call   10e0 <printf@plt>
lea    0x14(%rsp),%rdi
xor    %eax,%eax
call   1100 <FS460_get_yc_filter@plt>
test   %eax,%eax
je     141b <get_settings+0x21b>
lea    0xd42(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10e0 <printf@plt>
jmp    1455 <get_settings+0x255>
testb  $0x1,0x14(%rsp)
lea    0xd51(%rip),%rax
lea    0xd3c(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   10e0 <printf@plt>
testb  $0x2,0x14(%rsp)
jne    1449 <get_settings+0x249>
lea    0xdf2(%rip),%rdi
jmp    1450 <get_settings+0x250>
lea    0xe00(%rip),%rdi
call   1070 <puts@plt>
lea    0xde9(%rip),%rdi
call   1070 <puts@plt>
lea    0x4(%rsp),%rdi
xor    %eax,%eax
call   1040 <FS460_get_color@plt>
test   %eax,%eax
je     147c <get_settings+0x27c>
lea    0xd0e(%rip),%rdi
mov    %eax,%esi
jmp    1487 <get_settings+0x287>
mov    0x4(%rsp),%esi
lea    0xd14(%rip),%rdi
xor    %eax,%eax
call   10e0 <printf@plt>
lea    0x4(%rsp),%rdi
xor    %eax,%eax
call   1060 <FS460_get_brightness@plt>
test   %eax,%eax
je     14a9 <get_settings+0x2a9>
lea    0xd05(%rip),%rdi
mov    %eax,%esi
jmp    14b4 <get_settings+0x2b4>
mov    0x4(%rsp),%esi
lea    0xd0c(%rip),%rdi
xor    %eax,%eax
call   10e0 <printf@plt>
lea    0x4(%rsp),%rdi
xor    %eax,%eax
call   1080 <FS460_get_contrast@plt>
test   %eax,%eax
je     14d6 <get_settings+0x2d6>
lea    0xcfe(%rip),%rdi
mov    %eax,%esi
jmp    14e1 <get_settings+0x2e1>
mov    0x4(%rsp),%esi
lea    0xd02(%rip),%rdi
xor    %eax,%eax
call   10e0 <printf@plt>
add    $0x28,%rsp
ret
lea    0xd17(%rip),%rdi
call   1070 <puts@plt>
jmp    1310 <get_settings+0x110>
lea    0xbb6(%rip),%rdi
xor    %eax,%eax
call   10e0 <printf@plt>
jmp    1310 <get_settings+0x110>

LLVM IR (-O0):
@.str = [18 x i8] c"Videoparameters:\0A\00"
@.str.1 = [11 x i8] c" output:\0A\00"
@.str.2 = [19 x i8] c" std=<err %u>, \00"
@.str.3 = [13 x i8] c" std=%s, \00"
@.str.4 = [21 x i8] c"avail stds=<err %u>\0A\00"
@.str.5 = [20 x i8] c"avail stds=0x%08lx\0A\00"
@.str.6 = [23 x i8] c" vgamode=<err %u>, \00"
@.str.7 = [17 x i8] c" vgamode=%s, \00"
@.str.8 = [25 x i8] c"avail vgamodes=<err %u>\0A\00"
@.str.9 = [24 x i8] c"avail vgamodes=0x%04lx\0A\00"
@.str.10 = [25 x i8] c" tvout mode=<err %u>\0A\00"
@.str.11 = [27 x i8] c" tvout mode=CVBS + Y/C\0A\00"
@.str.12 = [20 x i8] c" tvout mode=RGB\0A\00"
@.str.13 = [24 x i8] c" tvout mode=0x%04lx\0A\00"
@.str.14 = [17 x i8] c" VGA position:\0A\00"
@.str.15 = [25 x i8] c" VGA position=<err %u>\0A\00"
@.str.16 = [30 x i8] c" VGA position=(%d,%d,%d,%d)\0A\00"
@.str.17 = [12 x i8] c" filters:\0A\00"
@.str.18 = [24 x i8] c" sharpness=<err %u> \00"
@.str.19 = [18 x i8] c" sharpness=%d \00"
@.str.20 = [18 x i8] c"flicker=<err %u>\0A\00"
@.str.21 = [12 x i8] c"flicker=%d\0A\00"
@.str.22 = [24 x i8] c" yc_filter <err %u>\0A\00"
@.str.23 = [14 x i8] c" notch=on \00"
@.str.24 = [14 x i8] c" notch=off\00"
@.str.25 = [12 x i8] c" chroma=on\0A\00"
@.str.26 = [13 x i8] c" chroma=off\0A\00"
@.str.27 = [12 x i8] c" encoder:\0A\00"
@.str.28 = [21 x i8] c" color=<err %u>, \00"
@.str.29 = [15 x i8] c" color=%d, \00"
@.str.30 = [22 x i8] c"brightness=<err %u>, \00"
@.str.31 = [16 x i8] c"brightness=%d, \00"
@.str.32 = [19 x i8] c"contrast=<err %u>\0A\00"
@.str.33 = [13 x i8] c"contrast=%d\0A\00"
define void @get_settings() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (i64*, ...) bitcast (i32 (...)* @FS460_get_tv_standard to i32 (i64*, ...)*)(i64* %2)
store i32 %11, i32* %1
%12 = load i32, i32* %1
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %0
%15 = load i32, i32* %1
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %15)
br label %21
17: ; preds = %0
%18 = load i64, i64* %2
%19 = call i32 (i64, ...) bitcast (i32 (...)* @str_TVStandard to i32 (i64, ...)*)(i64 %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %17, %14
%22 = call i32 (i64*, ...) bitcast (i32 (...)* @FS460_get_available_tv_standards to i32 (i64*, ...)*)(i64* %2)
store i32 %22, i32* %1
%23 = load i32, i32* %1
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = load i32, i32* %1
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 %26)
br label %31
28: ; preds = %21
%29 = load i64, i64* %2
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i64 %29)
br label %31
31: ; preds = %28, %25
%32 = call i32 (i64*, ...) bitcast (i32 (...)* @FS460_get_vga_mode to i32 (i64*, ...)*)(i64* %2)
store i32 %32, i32* %1
%33 = load i32, i32* %1
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %31
%36 = load i32, i32* %1
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %36)
br label %42
38: ; preds = %31
%39 = load i64, i64* %2
%40 = call i32 (i64, ...) bitcast (i32 (...)* @str_VgaMode to i32 (i64, ...)*)(i64 %39)
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i32 %40)
br label %42
42: ; preds = %38, %35
%43 = call i32 (i64*, ...) bitcast (i32 (...)* @FS460_get_available_vga_modes to i32 (i64*, ...)*)(i64* %2)
store i32 %43, i32* %1
%44 = load i32, i32* %1
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %42
%47 = load i32, i32* %1
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i32 %47)
br label %52
49: ; preds = %42
%50 = load i64, i64* %2
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i64 %50)
br label %52
52: ; preds = %49, %46
%53 = call i32 (i64*, ...) bitcast (i32 (...)* @FS460_get_tvout_mode to i32 (i64*, ...)*)(i64* %2)
store i32 %53, i32* %1
%54 = load i32, i32* %1
%55 = icmp ne i32 %54, 0
br i1 %55, label %56, label %59
56: ; preds = %52
%57 = load i32, i32* %1
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i32 %57)
br label %69
59: ; preds = %52
%60 = load i64, i64* %2
switch i64 %60, label %65 [
i64 1, label %61
i64 2, label %63
]
61: ; preds = %59
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0))
br label %68
63: ; preds = %59
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0))
br label %68
65: ; preds = %59
%66 = load i64, i64* %2
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0), i64 %66)
br label %68
68: ; preds = %65, %63, %61
br label %69
69: ; preds = %68, %56
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0))
%71 = call i32 (i32*, i32*, i32*, i32*, ...) bitcast (i32 (...)* @FS460_get_vga_position to i32 (i32*, i32*, i32*, i32*, ...)*)(i32* %4, i32* %5, i32* %6, i32* %7)
store i32 %71, i32* %1
%72 = load i32, i32* %1
%73 = icmp ne i32 %72, 0
br i1 %73, label %74, label %77
74: ; preds = %69
%75 = load i32, i32* %1
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.15, i64 0, i64 0), i32 %75)
br label %83
77: ; preds = %69
%78 = load i32, i32* %4
%79 = load i32, i32* %5
%80 = load i32, i32* %6
%81 = load i32, i32* %7
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0), i32 %78, i32 %79, i32 %80, i32 %81)
br label %83
83: ; preds = %77, %74
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0))
%85 = call i32 (i32*, ...) bitcast (i32 (...)* @FS460_get_sharpness to i32 (i32*, ...)*)(i32* %3)
store i32 %85, i32* %1
%86 = load i32, i32* %1
%87 = icmp ne i32 %86, 0
br i1 %87, label %88, label %91
88: ; preds = %83
%89 = load i32, i32* %1
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.18, i64 0, i64 0), i32 %89)
br label %94
91: ; preds = %83
%92 = load i32, i32* %3
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.19, i64 0, i64 0), i32 %92)
br label %94
94: ; preds = %91, %88
%95 = call i32 (i32*, ...) bitcast (i32 (...)* @FS460_get_flicker_filter to i32 (i32*, ...)*)(i32* %3)
store i32 %95, i32* %1
%96 = load i32, i32* %1
%97 = icmp ne i32 %96, 0
br i1 %97, label %98, label %101
98: ; preds = %94
%99 = load i32, i32* %1
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.20, i64 0, i64 0), i32 %99)
br label %104
101: ; preds = %94
%102 = load i32, i32* %3
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.21, i64 0, i64 0), i32 %102)
br label %104
104: ; preds = %101, %98
%105 = call i32 (i32*, ...) bitcast (i32 (...)* @FS460_get_yc_filter to i32 (i32*, ...)*)(i32* %8)
store i32 %105, i32* %1
%106 = load i32, i32* %1
%107 = icmp ne i32 %106, 0
br i1 %107, label %108, label %111
108: ; preds = %104
%109 = load i32, i32* %1
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.22, i64 0, i64 0), i32 %109)
br label %128
111: ; preds = %104
%112 = load i32, i32* %8
%113 = and i32 1, %112
%114 = icmp ne i32 %113, 0
br i1 %114, label %115, label %117
115: ; preds = %111
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.23, i64 0, i64 0))
br label %119
117: ; preds = %111
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.24, i64 0, i64 0))
br label %119
119: ; preds = %117, %115
%120 = load i32, i32* %8
%121 = and i32 2, %120
%122 = icmp ne i32 %121, 0
br i1 %122, label %123, label %125
123: ; preds = %119
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.25, i64 0, i64 0))
br label %127
125: ; preds = %119
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.26, i64 0, i64 0))
br label %127
127: ; preds = %125, %123
br label %128
128: ; preds = %127, %108
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.27, i64 0, i64 0))
%130 = call i32 (i32*, ...) bitcast (i32 (...)* @FS460_get_color to i32 (i32*, ...)*)(i32* %3)
store i32 %130, i32* %1
%131 = load i32, i32* %1
%132 = icmp ne i32 %131, 0
br i1 %132, label %133, label %136
133: ; preds = %128
%134 = load i32, i32* %1
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.28, i64 0, i64 0), i32 %134)
br label %139
136: ; preds = %128
%137 = load i32, i32* %3
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.29, i64 0, i64 0), i32 %137)
br label %139
139: ; preds = %136, %133
%140 = call i32 (i32*, ...) bitcast (i32 (...)* @FS460_get_brightness to i32 (i32*, ...)*)(i32* %3)
store i32 %140, i32* %1
%141 = load i32, i32* %1
%142 = icmp ne i32 %141, 0
br i1 %142, label %143, label %146
143: ; preds = %139
%144 = load i32, i32* %1
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.30, i64 0, i64 0), i32 %144)
br label %149
146: ; preds = %139
%147 = load i32, i32* %3
%148 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.31, i64 0, i64 0), i32 %147)
br label %149
149: ; preds = %146, %143
%150 = call i32 (i32*, ...) bitcast (i32 (...)* @FS460_get_contrast to i32 (i32*, ...)*)(i32* %3)
store i32 %150, i32* %1
%151 = load i32, i32* %1
%152 = icmp ne i32 %151, 0
br i1 %152, label %153, label %156
153: ; preds = %149
%154 = load i32, i32* %1
%155 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.32, i64 0, i64 0), i32 %154)
br label %159
156: ; preds = %149
%157 = load i32, i32* %3
%158 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.33, i64 0, i64 0), i32 %157)
br label %159
159: ; preds = %156, %153
ret void
}

LLVM IR (-O2):
@.str.2 = [19 x i8] c" std=<err %u>, \00"
@.str.3 = [13 x i8] c" std=%s, \00"
@.str.4 = [21 x i8] c"avail stds=<err %u>\0A\00"
@.str.5 = [20 x i8] c"avail stds=0x%08lx\0A\00"
@.str.6 = [23 x i8] c" vgamode=<err %u>, \00"
@.str.7 = [17 x i8] c" vgamode=%s, \00"
@.str.8 = [25 x i8] c"avail vgamodes=<err %u>\0A\00"
@.str.9 = [24 x i8] c"avail vgamodes=0x%04lx\0A\00"
@.str.10 = [25 x i8] c" tvout mode=<err %u>\0A\00"
@.str.13 = [24 x i8] c" tvout mode=0x%04lx\0A\00"
@.str.15 = [25 x i8] c" VGA position=<err %u>\0A\00"
@.str.16 = [30 x i8] c" VGA position=(%d,%d,%d,%d)\0A\00"
@.str.18 = [24 x i8] c" sharpness=<err %u> \00"
@.str.19 = [18 x i8] c" sharpness=%d \00"
@.str.20 = [18 x i8] c"flicker=<err %u>\0A\00"
@.str.21 = [12 x i8] c"flicker=%d\0A\00"
@.str.22 = [24 x i8] c" yc_filter <err %u>\0A\00"
@.str.23 = [14 x i8] c" notch=on \00"
@.str.24 = [14 x i8] c" notch=off\00"
@.str.28 = [21 x i8] c" color=<err %u>, \00"
@.str.29 = [15 x i8] c" color=%d, \00"
@.str.30 = [22 x i8] c"brightness=<err %u>, \00"
@.str.31 = [16 x i8] c"brightness=%d, \00"
@.str.32 = [19 x i8] c"contrast=<err %u>\0A\00"
@.str.33 = [13 x i8] c"contrast=%d\0A\00"
@str = [17 x i8] c"Videoparameters:\00"
@str.34 = [10 x i8] c" output:\00"
@str.35 = [19 x i8] c" tvout mode=RGB\00"
@str.36 = [16 x i8] c" VGA position:\00"
@str.37 = [11 x i8] c" filters:\00"
@str.38 = [12 x i8] c" chroma=off\00"
@str.39 = [11 x i8] c" encoder:\00"
@str.40 = [11 x i8] c" chroma=on\00"
@str.41 = [26 x i8] c" tvout mode=CVBS + Y/C\00"
define void @get_settings() {
%1 = alloca i64
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = bitcast i64* %1 to i8*
%9 = bitcast i32* %2 to i8*
%10 = bitcast i32* %3 to i8*
%11 = bitcast i32* %4 to i8*
%12 = bitcast i32* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = bitcast i32* %7 to i8*
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.34, i64 0, i64 0))
%17 = call i32 (i64*, ...) bitcast (i32 (...)* @FS460_get_tv_standard to i32 (i64*, ...)*)(i64* %1)
%18 = icmp eq i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %0
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %17)
br label %25
21: ; preds = %0
%22 = load i64, i64* %1
%23 = call i32 (i64, ...) bitcast (i32 (...)* @str_TVStandard to i32 (i64, ...)*)(i64 %22)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %21, %19
%26 = call i32 (i64*, ...) bitcast (i32 (...)* @FS460_get_available_tv_standards to i32 (i64*, ...)*)(i64* %1)
%27 = icmp eq i32 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %25
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 %26)
br label %33
30: ; preds = %25
%31 = load i64, i64* %1
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i64 %31)
br label %33
33: ; preds = %30, %28
%34 = call i32 (i64*, ...) bitcast (i32 (...)* @FS460_get_vga_mode to i32 (i64*, ...)*)(i64* %1)
%35 = icmp eq i32 %34, 0
br i1 %35, label %38, label %36
36: ; preds = %33
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %34)
br label %42
38: ; preds = %33
%39 = load i64, i64* %1
%40 = call i32 (i64, ...) bitcast (i32 (...)* @str_VgaMode to i32 (i64, ...)*)(i64 %39)
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i32 %40)
br label %42
42: ; preds = %38, %36
%43 = call i32 (i64*, ...) bitcast (i32 (...)* @FS460_get_available_vga_modes to i32 (i64*, ...)*)(i64* %1)
%44 = icmp eq i32 %43, 0
br i1 %44, label %47, label %45
45: ; preds = %42
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i32 %43)
br label %50
47: ; preds = %42
%48 = load i64, i64* %1
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i64 %48)
br label %50
50: ; preds = %47, %45
%51 = call i32 (i64*, ...) bitcast (i32 (...)* @FS460_get_tvout_mode to i32 (i64*, ...)*)(i64* %1)
%52 = icmp eq i32 %51, 0
br i1 %52, label %55, label %53
53: ; preds = %50
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i32 %51)
br label %63
55: ; preds = %50
%56 = load i64, i64* %1
switch i64 %56, label %61 [
i64 1, label %57
i64 2, label %59
]
57: ; preds = %55
%58 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.41, i64 0, i64 0))
br label %63
59: ; preds = %55
%60 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.35, i64 0, i64 0))
br label %63
61: ; preds = %55
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0), i64 %56)
br label %63
63: ; preds = %57, %59, %61, %53
%64 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.36, i64 0, i64 0))
%65 = call i32 (i32*, i32*, i32*, i32*, ...) bitcast (i32 (...)* @FS460_get_vga_position to i32 (i32*, i32*, i32*, i32*, ...)*)(i32* %3, i32* %4, i32* %5, i32* %6)
%66 = icmp eq i32 %65, 0
br i1 %66, label %69, label %67
67: ; preds = %63
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.15, i64 0, i64 0), i32 %65)
br label %75
69: ; preds = %63
%70 = load i32, i32* %3
%71 = load i32, i32* %4
%72 = load i32, i32* %5
%73 = load i32, i32* %6
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0), i32 %70, i32 %71, i32 %72, i32 %73)
br label %75
75: ; preds = %69, %67
%76 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.37, i64 0, i64 0))
%77 = call i32 (i32*, ...) bitcast (i32 (...)* @FS460_get_sharpness to i32 (i32*, ...)*)(i32* %2)
%78 = icmp eq i32 %77, 0
br i1 %78, label %81, label %79
79: ; preds = %75
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.18, i64 0, i64 0), i32 %77)
br label %84
81: ; preds = %75
%82 = load i32, i32* %2
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.19, i64 0, i64 0), i32 %82)
br label %84
84: ; preds = %81, %79
%85 = call i32 (i32*, ...) bitcast (i32 (...)* @FS460_get_flicker_filter to i32 (i32*, ...)*)(i32* %2)
%86 = icmp eq i32 %85, 0
br i1 %86, label %89, label %87
87: ; preds = %84
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.20, i64 0, i64 0), i32 %85)
br label %92
89: ; preds = %84
%90 = load i32, i32* %2
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.21, i64 0, i64 0), i32 %90)
br label %92
92: ; preds = %89, %87
%93 = call i32 (i32*, ...) bitcast (i32 (...)* @FS460_get_yc_filter to i32 (i32*, ...)*)(i32* %7)
%94 = icmp eq i32 %93, 0
br i1 %94, label %97, label %95
95: ; preds = %92
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.22, i64 0, i64 0), i32 %93)
br label %110
97: ; preds = %92
%98 = load i32, i32* %7
%99 = and i32 %98, 1
%100 = icmp eq i32 %99, 0
%101 = select i1 %100, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.23, i64 0, i64 0)
%102 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %101)
%103 = load i32, i32* %7
%104 = and i32 %103, 2
%105 = icmp eq i32 %104, 0
br i1 %105, label %108, label %106
106: ; preds = %97
%107 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.40, i64 0, i64 0))
br label %110
108: ; preds = %97
%109 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.38, i64 0, i64 0))
br label %110
110: ; preds = %106, %108, %95
%111 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.39, i64 0, i64 0))
%112 = call i32 (i32*, ...) bitcast (i32 (...)* @FS460_get_color to i32 (i32*, ...)*)(i32* %2)
%113 = icmp eq i32 %112, 0
br i1 %113, label %116, label %114
114: ; preds = %110
%115 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.28, i64 0, i64 0), i32 %112)
br label %119
116: ; preds = %110
%117 = load i32, i32* %2
%118 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.29, i64 0, i64 0), i32 %117)
br label %119
119: ; preds = %116, %114
%120 = call i32 (i32*, ...) bitcast (i32 (...)* @FS460_get_brightness to i32 (i32*, ...)*)(i32* %2)
%121 = icmp eq i32 %120, 0
br i1 %121, label %124, label %122
122: ; preds = %119
%123 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.30, i64 0, i64 0), i32 %120)
br label %127
124: ; preds = %119
%125 = load i32, i32* %2
%126 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.31, i64 0, i64 0), i32 %125)
br label %127
127: ; preds = %124, %122
%128 = call i32 (i32*, ...) bitcast (i32 (...)* @FS460_get_contrast to i32 (i32*, ...)*)(i32* %2)
%129 = icmp eq i32 %128, 0
br i1 %129, label %132, label %130
130: ; preds = %127
%131 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.32, i64 0, i64 0), i32 %128)
br label %135
132: ; preds = %127
%133 = load i32, i32* %2
%134 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.33, i64 0, i64 0), i32 %133)
br label %135
135: ; preds = %132, %130
ret void
}