#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*/ ltr_int_finish_usb(int /*<<< orphan*/);
int /*<<< orphan*/ ltr_int_log_message(char *);
int /*<<< orphan*/ ltr_int_usleep(int);
int /*<<< orphan*/ stop_camera_tir();
int /*<<< orphan*/ turn_led_off_tir(int);
bool close_camera_tir2() {
  ltr_int_log_message("Closing TIR2 camera!\n");
  stop_camera_tir();
  ltr_int_usleep(25000);
  turn_led_off_tir(0x10);
  ltr_int_usleep(2000);
  turn_led_off_tir(0x20);
  ltr_int_usleep(2000);
  turn_led_off_tir(0x40);
  ltr_int_usleep(2000);
  turn_led_off_tir(0x80);
  ltr_int_usleep(2000);
  ltr_int_finish_usb(0);
  ltr_int_log_message("TIR2 camera closed.\n");
  return true;
}


x86 assembly (clang, -O0):
<close_camera_tir2>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1040 <ltr_int_log_message@plt>
mov    $0x0,%al
call   1030 <stop_camera_tir@plt>
mov    $0x61a8,%edi
call   1060 <ltr_int_usleep@plt>
mov    $0x10,%edi
call   1070 <turn_led_off_tir@plt>
mov    $0x7d0,%edi
call   1060 <ltr_int_usleep@plt>
mov    $0x20,%edi
call   1070 <turn_led_off_tir@plt>
mov    $0x7d0,%edi
call   1060 <ltr_int_usleep@plt>
mov    $0x40,%edi
call   1070 <turn_led_off_tir@plt>
mov    $0x7d0,%edi
call   1060 <ltr_int_usleep@plt>
mov    $0x80,%edi
call   1070 <turn_led_off_tir@plt>
mov    $0x7d0,%edi
call   1060 <ltr_int_usleep@plt>
xor    %edi,%edi
call   1050 <ltr_int_finish_usb@plt>
lea    0xe47(%rip),%rdi
call   1040 <ltr_int_log_message@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_camera_tir2>:
push   %rax
lea    0xea8(%rip),%rdi
call   1040 <ltr_int_log_message@plt>
xor    %eax,%eax
call   1030 <stop_camera_tir@plt>
mov    $0x61a8,%edi
call   1060 <ltr_int_usleep@plt>
mov    $0x10,%edi
call   1070 <turn_led_off_tir@plt>
mov    $0x7d0,%edi
call   1060 <ltr_int_usleep@plt>
mov    $0x20,%edi
call   1070 <turn_led_off_tir@plt>
mov    $0x7d0,%edi
call   1060 <ltr_int_usleep@plt>
mov    $0x40,%edi
call   1070 <turn_led_off_tir@plt>
mov    $0x7d0,%edi
call   1060 <ltr_int_usleep@plt>
mov    $0x80,%edi
call   1070 <turn_led_off_tir@plt>
mov    $0x7d0,%edi
call   1060 <ltr_int_usleep@plt>
xor    %edi,%edi
call   1050 <ltr_int_finish_usb@plt>
lea    0xe4a(%rip),%rdi
call   1040 <ltr_int_log_message@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Closing TIR2 camera!\0A\00"
@.str.1 = [21 x i8] c"TIR2 camera closed.\0A\00"
define i32 @close_camera_tir2() {
%1 = call i32 @ltr_int_log_message(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @stop_camera_tir()
%3 = call i32 @ltr_int_usleep(i32 25000)
%4 = call i32 @turn_led_off_tir(i32 16)
%5 = call i32 @ltr_int_usleep(i32 2000)
%6 = call i32 @turn_led_off_tir(i32 32)
%7 = call i32 @ltr_int_usleep(i32 2000)
%8 = call i32 @turn_led_off_tir(i32 64)
%9 = call i32 @ltr_int_usleep(i32 2000)
%10 = call i32 @turn_led_off_tir(i32 128)
%11 = call i32 @ltr_int_usleep(i32 2000)
%12 = call i32 @ltr_int_finish_usb(i32 0)
%13 = call i32 @ltr_int_log_message(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [22 x i8] c"Closing TIR2 camera!\0A\00"
@.str.1 = [21 x i8] c"TIR2 camera closed.\0A\00"
define i32 @close_camera_tir2() {
%1 = tail call i32 @ltr_int_log_message(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @stop_camera_tir()
%3 = tail call i32 @ltr_int_usleep(i32 25000)
%4 = tail call i32 @turn_led_off_tir(i32 16)
%5 = tail call i32 @ltr_int_usleep(i32 2000)
%6 = tail call i32 @turn_led_off_tir(i32 32)
%7 = tail call i32 @ltr_int_usleep(i32 2000)
%8 = tail call i32 @turn_led_off_tir(i32 64)
%9 = tail call i32 @ltr_int_usleep(i32 2000)
%10 = tail call i32 @turn_led_off_tir(i32 128)
%11 = tail call i32 @ltr_int_usleep(i32 2000)
%12 = tail call i32 @ltr_int_finish_usb(i32 0)
%13 = tail call i32 @ltr_int_log_message(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}