; LLVM IR from dmalyuta/FlyARocket_GNC :: master (main)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.bcm2835_peripheral = type { i64, i32, ptr, ptr }
%struct.timeval = type { i64, i64 }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct.SPI_data = type { i8, i8, i64, i8, i32, i32, float, float, i32, i32 }
%struct.spi_ioc_transfer = type { i64, i64, i32, i32, i16, i8, i8, i8, i8, i8, i8 }
%struct.termios = type { i32, i32, i32, i32, i8, [32 x i8], i32, i32 }
%struct.MATRIX = type { i64, i64, ptr }
%struct.Control_loop = type { double, double, double, double }

@ENGINE__BURN_TIME = external dso_local global i64, align 8
@ACTIVE__CONTROL_TIME = external dso_local global i64, align 8
@DESCENT__TIME = external dso_local global i64, align 8
@CONTROL__TIME_STEP = external dso_local global i64, align 8
@SPI__READ_TIMESTEP = external dso_local global i64, align 8
@IMU__READ_TIMESTEP = external dso_local global i64, align 8
@CALIB__TIME = external dso_local global i64, align 8
@SPI_quit = external dso_local global i8, align 1
@IMU_quit = external dso_local global i8, align 1
@PWM1 = external dso_local global i32, align 4
@PWM2 = external dso_local global i32, align 4
@PWM3 = external dso_local global i32, align 4
@PWM4 = external dso_local global i32, align 4
@R1 = external dso_local global double, align 8
@R2 = external dso_local global double, align 8
@R3 = external dso_local global double, align 8
@R4 = external dso_local global double, align 8
@d = external dso_local global double, align 8
@Fpitch = external dso_local global double, align 8
@Fyaw = external dso_local global double, align 8
@Mroll = external dso_local global double, align 8
@N = external dso_local global i32, align 4
@M1 = external dso_local global i32, align 4
@M2 = external dso_local global i32, align 4
@M3 = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@psi_cont = external dso_local global float, align 4
@psidot_cont = external dso_local global float, align 4
@theta_cont = external dso_local global float, align 4
@thetadot_cont = external dso_local global float, align 4
@phi_cont = external dso_local global float, align 4
@wx_cont = external dso_local global float, align 4
@psi_ref = external dso_local global float, align 4
@theta_ref = external dso_local global float, align 4
@wx_ref = external dso_local global float, align 4
@flight_type = external dso_local global i8, align 1
@error_log = external dso_local global ptr, align 8
@pressure_log = external dso_local global ptr, align 8
@imu_log = external dso_local global ptr, align 8
@control_log = external dso_local global ptr, align 8
@gpio = external dso_local global %struct.bcm2835_peripheral, align 8
@launch_detect_gpio = external dso_local global i8, align 1
@GLOBAL__TIME_STARTPOINT = external dso_local global %struct.timeval, align 8
@error_log_write_lock = external dso_local global %union.pthread_mutex_t, align 8
@.str = external hidden unnamed_addr constant [44 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [74 x i8], align 1
@SPI_config = external dso_local global %struct.SPI_data, align 8
@data = external dso_local global [4 x i8], align 1
@transfer = external dso_local global [4 x %struct.spi_ioc_transfer], align 16
@.str.13 = external hidden unnamed_addr constant [36 x i8], align 1
@RADIAL_SENSOR = external constant [0 x i8], align 1
@AXIAL_SENSOR = external constant [0 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [12 x i8], align 1
@MESSAGE = external dso_local global [700 x i8], align 16
@.str.15 = external hidden unnamed_addr constant [125 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [45 x i8], align 1
@before_loop = external dso_local global %struct.timeval, align 8
@before_control = external dso_local global %struct.timeval, align 8
@now_loop = external dso_local global %struct.timeval, align 8
@elapsed_loop = external dso_local global %struct.timeval, align 8
@time_loop = external dso_local global i64, align 8
@now_control = external dso_local global %struct.timeval, align 8
@elapsed_control = external dso_local global %struct.timeval, align 8
@time_control = external dso_local global i64, align 8
@.str.19 = external hidden unnamed_addr constant [103 x i8], align 1
@radial_status = external dso_local global i8, align 1
@radial_pressure = external dso_local global float, align 4
@radial_temperature = external dso_local global float, align 4
@axial_status = external dso_local global i8, align 1
@axial_pressure = external dso_local global float, align 4
@axial_temperature = external dso_local global float, align 4
@.str.20 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [8 x i8], align 1
@new_razor_uart_options = external dso_local global %struct.termios, align 4
@.str.24 = external hidden unnamed_addr constant [38 x i8], align 1
@RAZOR_UART = external dso_local global i32, align 4
@.str.25 = external hidden unnamed_addr constant [13 x i8], align 1
@stdout = external global ptr, align 8
@old_razor_uart_options = external dso_local global %struct.termios, align 4
@R_MATRIX = external dso_local global %struct.MATRIX, align 8
@DCM_MATRIX = external dso_local global %struct.MATRIX, align 8
@.str.26 = external hidden unnamed_addr constant [37 x i8], align 1
@IMU_SYNCHED = external global i8, align 1
@psi_save = external dso_local global float, align 4
@psi_save_last = external global float, align 4
@theta_save = external dso_local global float, align 4
@theta_save_last = external global float, align 4
@phi_save = external dso_local global float, align 4
@phi_save_last = external global float, align 4
@.str.27 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [7 x i8], align 1
@P_psi = external dso_local global %struct.MATRIX, align 8
@P_psidot = external dso_local global %struct.MATRIX, align 8
@x_psi = external dso_local global %struct.MATRIX, align 8
@x_psidot = external dso_local global %struct.MATRIX, align 8
@Q_psi = external dso_local global %struct.MATRIX, align 8
@Q_psidot = external dso_local global %struct.MATRIX, align 8
@R_psi = external dso_local global %struct.MATRIX, align 8
@R_psidot = external dso_local global %struct.MATRIX, align 8
@P_theta = external dso_local global %struct.MATRIX, align 8
@x_theta = external dso_local global %struct.MATRIX, align 8
@Q_theta = external dso_local global %struct.MATRIX, align 8
@R_theta = external dso_local global %struct.MATRIX, align 8
@P_thetadot = external dso_local global %struct.MATRIX, align 8
@x_thetadot = external dso_local global %struct.MATRIX, align 8
@Q_thetadot = external dso_local global %struct.MATRIX, align 8
@R_thetadot = external dso_local global %struct.MATRIX, align 8
@P_phi = external dso_local global %struct.MATRIX, align 8
@x_phi = external dso_local global %struct.MATRIX, align 8
@Q_phi = external dso_local global %struct.MATRIX, align 8
@R_phi = external dso_local global %struct.MATRIX, align 8
@P_phidot = external dso_local global %struct.MATRIX, align 8
@x_phidot = external dso_local global %struct.MATRIX, align 8
@Q_phidot = external dso_local global %struct.MATRIX, align 8
@R_phidot = external dso_local global %struct.MATRIX, align 8
@EYE2 = external dso_local global %struct.MATRIX, align 8
@A_kalman = external dso_local global %struct.MATRIX, align 8
@C_kalman = external dso_local global %struct.MATRIX, align 8
@z_temp = external dso_local global %struct.MATRIX, align 8
@inn = external dso_local global %struct.MATRIX, align 8
@S = external dso_local global %struct.MATRIX, align 8
@K = external dso_local global %struct.MATRIX, align 8
@.str.32 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [128 x i8], align 1
@dt = external global float, align 4
@psi_filt = external dso_local global float, align 4
@psi_dot_filt = external dso_local global float, align 4
@theta_filt = external dso_local global float, align 4
@theta_dot_filt = external dso_local global float, align 4
@phi_filt = external dso_local global float, align 4
@phi_dot_filt = external dso_local global float, align 4
@.str.35 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [93 x i8], align 1
@reply = external dso_local global [30 x i8], align 16
@.str.39 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [42 x i8], align 1
@new_msp430_uart_options = external dso_local global %struct.termios, align 4
@.str.42 = external hidden unnamed_addr constant [35 x i8], align 1
@MSP430_UART = external dso_local global i32, align 4
@.str.43 = external hidden unnamed_addr constant [13 x i8], align 1
@old_msp430_uart_options = external dso_local global %struct.termios, align 4
@.str.44 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [106 x i8], align 1
@now_control_glob = external dso_local global %struct.timeval, align 8
@elapsed_control_glob = external dso_local global %struct.timeval, align 8
@time_control_glob = external dso_local global i64, align 8
@wx = external dso_local global float, align 4
@Fpitch_loop = external dso_local global %struct.Control_loop, align 8
@Fyaw_loop = external dso_local global %struct.Control_loop, align 8
@Mroll_loop = external dso_local global %struct.Control_loop, align 8
@A = external dso_local global [5 x [6 x double]], align 16
@ICASE = external dso_local global i32, align 4
@IZROV = external dso_local global [6 x i32], align 16
@IPOSV = external dso_local global [5 x i32], align 16
@VALVE__MAX_THRUST = external global double, align 8
@.str.56 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [37 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca %struct.MATRIX, align 8
  %5 = alloca %struct.MATRIX, align 8
  %6 = alloca i64, align 8
  %7 = alloca %struct.MATRIX, align 8
  %8 = alloca %struct.MATRIX, align 8
  %9 = alloca %struct.MATRIX, align 8
  %10 = alloca %struct.MATRIX, align 8
  %11 = alloca %struct.MATRIX, align 8
  %12 = alloca %struct.MATRIX, align 8
  %13 = alloca %struct.MATRIX, align 8
  %14 = alloca %struct.MATRIX, align 8
  %15 = alloca %struct.MATRIX, align 8
  %16 = alloca %struct.MATRIX, align 8
  %17 = alloca %struct.MATRIX, align 8
  %18 = alloca %struct.MATRIX, align 8
  %19 = alloca %struct.MATRIX, align 8
  %20 = alloca %struct.MATRIX, align 8
  %21 = alloca %struct.MATRIX, align 8
  %22 = alloca i64, align 8
  %23 = alloca i8, align 1
  %24 = alloca [200 x i8], align 16
  store i32 0, ptr %1, align 4
  %25 = call i32 @gettimeofday(ptr noundef @GLOBAL__TIME_STARTPOINT, ptr noundef null) #10
  %26 = call i32 @pthread_mutex_init(ptr noundef @error_log_write_lock, ptr noundef null) #10
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %0
  call void @perror(ptr noundef @.str)
  call void @exit(i32 noundef -2) #11
  unreachable

29:                                               ; preds = %0
  %30 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  call void @open_error_file(ptr noundef @error_log, ptr noundef @.str.2, ptr noundef @.str.3)
  %31 = load ptr, ptr @error_log, align 8, !tbaa !5
  call void @open_file(ptr noundef @pressure_log, ptr noundef @.str.4, ptr noundef @.str.3, ptr noundef %31)
  %32 = load ptr, ptr @error_log, align 8, !tbaa !5
  call void @open_file(ptr noundef @imu_log, ptr noundef @.str.5, ptr noundef @.str.3, ptr noundef %32)
  %33 = load ptr, ptr @error_log, align 8, !tbaa !5
  call void @open_file(ptr noundef @control_log, ptr noundef @.str.6, ptr noundef @.str.3, ptr noundef %33)
  %34 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  call void @stopVideo()
  %35 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  call void @startVideo(ptr noundef @.str.9, ptr noundef @.str.10)
  %36 = call i32 @usleep(i32 noundef 1000000)
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  %38 = call i32 @map_peripheral(ptr noundef @gpio)
  %39 = icmp eq i32 %38, -1
  br i1 %39, label %40, label %42

40:                                               ; preds = %29
  %41 = call i32 (ptr, ...) @printf(ptr noundef @.str.12)
  call void @stopVideo()
  call void @exit(i32 noundef -2) #11
  unreachable

42:                                               ; preds = %29
  %43 = load i8, ptr @launch_detect_gpio, align 1, !tbaa !9
  %44 = zext i8 %43 to i32
  %45 = srem i32 %44, 10
  %46 = mul nsw i32 %45, 3
  %47 = shl i32 7, %46
  %48 = xor i32 %47, -1
  %49 = load ptr, ptr getelementptr inbounds (%struct.bcm2835_peripheral, ptr @gpio, i32 0, i32 3), align 8, !tbaa !10
  %50 = load i8, ptr @launch_detect_gpio, align 1, !tbaa !9
  %51 = zext i8 %50 to i32
  %52 = sdiv i32 %51, 10
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i32, ptr %49, i64 %53
  %55 = load volatile i32, ptr %54, align 4, !tbaa !14
  %56 = and i32 %55, %48
  store volatile i32 %56, ptr %54, align 4, !tbaa !14
  store i8 0, ptr @SPI_config, align 8, !tbaa !15
  store i8 8, ptr getelementptr inbounds (%struct.SPI_data, ptr @SPI_config, i32 0, i32 1), align 1, !tbaa !18
  store i64 800000, ptr getelementptr inbounds (%struct.SPI_data, ptr @SPI_config, i32 0, i32 2), align 8, !tbaa !19
  store i8 4, ptr getelementptr inbounds (%struct.SPI_data, ptr @SPI_config, i32 0, i32 3), align 8, !tbaa !20
  store i32 14745, ptr getelementptr inbounds (%struct.SPI_data, ptr @SPI_config, i32 0, i32 4), align 4, !tbaa !21
  store i32 1638, ptr getelementptr inbounds (%struct.SPI_data, ptr @SPI_config, i32 0, i32 5), align 8, !tbaa !22
  store float 1.000000e+02, ptr getelementptr inbounds (%struct.SPI_data, ptr @SPI_config, i32 0, i32 6), align 4, !tbaa !23
  store float -1.000000e+02, ptr getelementptr inbounds (%struct.SPI_data, ptr @SPI_config, i32 0, i32 7), align 8, !tbaa !24
  store i32 0, ptr getelementptr inbounds (%struct.SPI_data, ptr @SPI_config, i32 0, i32 8), align 4, !tbaa !25
  store i32 0, ptr getelementptr inbounds (%struct.SPI_data, ptr @SPI_config, i32 0, i32 9), align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #10
  store i32 0, ptr %2, align 4, !tbaa !14
  br label %57

57:                                               ; preds = %108, %42
  %58 = load i32, ptr %2, align 4, !tbaa !14
  %59 = load i8, ptr getelementptr inbounds (%struct.SPI_data, ptr @SPI_config, i32 0, i32 3), align 8, !tbaa !20
  %60 = zext i8 %59 to i32
  %61 = icmp slt i32 %58, %60
  br i1 %61, label %62, label %111

62:                                               ; preds = %57
  %63 = load i32, ptr %2, align 4, !tbaa !14
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [4 x i8], ptr @data, i64 0, i64 %64
  store i8 0, ptr %65, align 1, !tbaa !9
  %66 = load i32, ptr %2, align 4, !tbaa !14
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds %struct.spi_ioc_transfer, ptr @transfer, i64 %67
  call void @llvm.memset.p0.i64(ptr align 8 %68, i8 0, i64 32, i1 false)
  %69 = load i32, ptr %2, align 4, !tbaa !14
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds i8, ptr @data, i64 %70
  %72 = ptrtoint ptr %71 to i64
  %73 = load i32, ptr %2, align 4, !tbaa !14
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [4 x %struct.spi_ioc_transfer], ptr @transfer, i64 0, i64 %74
  %76 = getelementptr inbounds %struct.spi_ioc_transfer, ptr %75, i32 0, i32 0
  store i64 %72, ptr %76, align 16, !tbaa !27
  %77 = load i32, ptr %2, align 4, !tbaa !14
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i8, ptr @data, i64 %78
  %80 = ptrtoint ptr %79 to i64
  %81 = load i32, ptr %2, align 4, !tbaa !14
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [4 x %struct.spi_ioc_transfer], ptr @transfer, i64 0, i64 %82
  %84 = getelementptr inbounds %struct.spi_ioc_transfer, ptr %83, i32 0, i32 1
  store i64 %80, ptr %84, align 8, !tbaa !31
  %85 = load i32, ptr %2, align 4, !tbaa !14
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [4 x %struct.spi_ioc_transfer], ptr @transfer, i64 0, i64 %86
  %88 = getelementptr inbounds %struct.spi_ioc_transfer, ptr %87, i32 0, i32 2
  store i32 1, ptr %88, align 16, !tbaa !32
  %89 = load i64, ptr getelementptr inbounds (%struct.SPI_data, ptr @SPI_config, i32 0, i32 2), align 8, !tbaa !19
  %90 = trunc i64 %89 to i32
  %91 = load i32, ptr %2, align 4, !tbaa !14
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [4 x %struct.spi_ioc_transfer], ptr @transfer, i64 0, i64 %92
  %94 = getelementptr inbounds %struct.spi_ioc_transfer, ptr %93, i32 0, i32 3
  store i32 %90, ptr %94, align 4, !tbaa !33
  %95 = load i8, ptr getelementptr inbounds (%struct.SPI_data, ptr @SPI_config, i32 0, i32 1), align 1, !tbaa !18
  %96 = load i32, ptr %2, align 4, !tbaa !14
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [4 x %struct.spi_ioc_transfer], ptr @transfer, i64 0, i64 %97
  %99 = getelementptr inbounds %struct.spi_ioc_transfer, ptr %98, i32 0, i32 5
  store i8 %95, ptr %99, align 2, !tbaa !34
  %100 = load i32, ptr %2, align 4, !tbaa !14
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [4 x %struct.spi_ioc_transfer], ptr @transfer, i64 0, i64 %101
  %103 = getelementptr inbounds %struct.spi_ioc_transfer, ptr %102, i32 0, i32 4
  store i16 100, ptr %103, align 8, !tbaa !35
  %104 = load i32, ptr %2, align 4, !tbaa !14
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [4 x %struct.spi_ioc_transfer], ptr @transfer, i64 0, i64 %105
  %107 = getelementptr inbounds %struct.spi_ioc_transfer, ptr %106, i32 0, i32 6
  store i8 0, ptr %107, align 1, !tbaa !36
  br label %108

108:                                              ; preds = %62
  %109 = load i32, ptr %2, align 4, !tbaa !14
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %2, align 4, !tbaa !14
  br label %57, !llvm.loop !37

111:                                              ; preds = %57
  %112 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  %113 = load i8, ptr @SPI_config, align 8, !tbaa !15
  %114 = load i8, ptr getelementptr inbounds (%struct.SPI_data, ptr @SPI_config, i32 0, i32 1), align 1, !tbaa !18
  %115 = load i64, ptr getelementptr inbounds (%struct.SPI_data, ptr @SPI_config, i32 0, i32 2), align 8, !tbaa !19
  call void @pressure_sensor_SPI_connect(ptr noundef @RADIAL_SENSOR, ptr noundef getelementptr inbounds (%struct.SPI_data, ptr @SPI_config, i32 0, i32 8), i8 noundef zeroext %113, i8 noundef zeroext %114, i64 noundef %115)
  %116 = load i8, ptr @SPI_config, align 8, !tbaa !15
  %117 = load i8, ptr getelementptr inbounds (%struct.SPI_data, ptr @SPI_config, i32 0, i32 1), align 1, !tbaa !18
  %118 = load i64, ptr getelementptr inbounds (%struct.SPI_data, ptr @SPI_config, i32 0, i32 2), align 8, !tbaa !19
  call void @pressure_sensor_SPI_connect(ptr noundef @AXIAL_SENSOR, ptr noundef getelementptr inbounds (%struct.SPI_data, ptr @SPI_config, i32 0, i32 9), i8 noundef zeroext %116, i8 noundef zeroext %117, i64 noundef %118)
  %119 = call i32 (ptr, ...) @printf(ptr noundef @.str.14)
  %120 = load i8, ptr @SPI_config, align 8, !tbaa !15
  %121 = zext i8 %120 to i32
  %122 = load i8, ptr getelementptr inbounds (%struct.SPI_data, ptr @SPI_config, i32 0, i32 1), align 1, !tbaa !18
  %123 = zext i8 %122 to i32
  %124 = load i64, ptr getelementptr inbounds (%struct.SPI_data, ptr @SPI_config, i32 0, i32 2), align 8, !tbaa !19
  %125 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef @MESSAGE, ptr noundef @.str.15, i32 noundef %121, i32 noundef %123, i64 noundef %124) #10
  %126 = call i32 (ptr, ...) @printf(ptr noundef @MESSAGE)
  %127 = call i32 (ptr, ...) @printf(ptr noundef @.str.16)
  call void @Treat_reply(ptr noundef @.str.17)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #10
  %128 = call i32 @pthread_create(ptr noundef %3, ptr noundef null, ptr noundef @get_readings_SPI_parallel, ptr noundef @SPI_config) #10
  %129 = icmp ne i32 %128, 0
  br i1 %129, label %130, label %131

130:                                              ; preds = %111
  call void @perror(ptr noundef @.str.18)
  call void @stopVideo()
  call void @exit(i32 noundef -2) #11
  unreachable

131:                                              ; preds = %111
  %132 = call i32 @gettimeofday(ptr noundef @before_loop, ptr noundef null) #10
  %133 = call i32 @gettimeofday(ptr noundef @before_control, ptr noundef null) #10
  br label %134

134:                                              ; preds = %153, %131
  %135 = load i64, ptr @before_loop, align 8
  %136 = load i64, ptr getelementptr inbounds ({ i64, i64 }, ptr @before_loop, i32 0, i32 1), align 8
  %137 = load i64, ptr @elapsed_loop, align 8
  %138 = load i64, ptr getelementptr inbounds ({ i64, i64 }, ptr @elapsed_loop, i32 0, i32 1), align 8
  call void @check_time(ptr noundef @now_loop, i64 %135, i64 %136, i64 %137, i64 %138, ptr noundef @time_loop)
  %139 = load i64, ptr @SPI__READ_TIMESTEP, align 8, !tbaa !39
  call void @passive_wait(ptr noundef @now_control, ptr noundef @before_control, ptr noundef @elapsed_control, ptr noundef @time_control, i64 noundef %139)
  %140 = load i8, ptr @radial_status, align 1, !tbaa !9
  %141 = zext i8 %140 to i32
  %142 = load float, ptr @radial_pressure, align 4, !tbaa !40
  %143 = fpext float %142 to double
  %144 = load float, ptr @radial_temperature, align 4, !tbaa !40
  %145 = fpext float %144 to double
  %146 = load i8, ptr @axial_status, align 1, !tbaa !9
  %147 = sext i8 %146 to i32
  %148 = load float, ptr @axial_pressure, align 4, !tbaa !40
  %149 = fpext float %148 to double
  %150 = load float, ptr @axial_temperature, align 4, !tbaa !40
  %151 = fpext float %150 to double
  %152 = call i32 (ptr, ...) @printf(ptr noundef @.str.19, i32 noundef %141, double noundef %143, double noundef %145, i32 noundef %147, double noundef %149, double noundef %151)
  br label %153

153:                                              ; preds = %134
  %154 = load i64, ptr @time_loop, align 8, !tbaa !39
  %155 = load i64, ptr @CALIB__TIME, align 8, !tbaa !41
  %156 = icmp ule i64 %154, %155
  br i1 %156, label %134, label %157, !llvm.loop !42

157:                                              ; preds = %153
  %158 = call i32 (ptr, ...) @printf(ptr noundef @.str.20)
  call void @Treat_reply(ptr noundef @.str.21)
  %159 = call i32 (ptr, ...) @printf(ptr noundef @.str.22)
  call void (...) @Fpitch_loop_control_setup()
  call void (...) @Fyaw_loop_control_setup()
  call void (...) @Mroll_loop_control_setup()
  %160 = call i32 (ptr, ...) @printf(ptr noundef @.str.23)
  call void @llvm.memset.p0.i64(ptr align 4 @new_razor_uart_options, i8 0, i64 60, i1 false)
  store i32 0, ptr @new_razor_uart_options, align 4, !tbaa !43
  store i32 0, ptr getelementptr inbounds (%struct.termios, ptr @new_razor_uart_options, i32 0, i32 1), align 4, !tbaa !45
  store i32 6321, ptr getelementptr inbounds (%struct.termios, ptr @new_razor_uart_options, i32 0, i32 2), align 4, !tbaa !46
  store i32 0, ptr getelementptr inbounds (%struct.termios, ptr @new_razor_uart_options, i32 0, i32 3), align 4, !tbaa !47
  store i8 0, ptr getelementptr inbounds ([32 x i8], ptr getelementptr inbounds (%struct.termios, ptr @new_razor_uart_options, i32 0, i32 5), i64 0, i64 6), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([32 x i8], ptr getelementptr inbounds (%struct.termios, ptr @new_razor_uart_options, i32 0, i32 5), i64 0, i64 5), align 1, !tbaa !9
  %161 = call i32 (ptr, ...) @printf(ptr noundef @.str.24)
  call void @open_serial_port(ptr noundef @RAZOR_UART, ptr noundef @.str.25)
  %162 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  %163 = load ptr, ptr @stdout, align 8, !tbaa !5
  %164 = call i32 @fflush(ptr noundef %163)
  %165 = load i32, ptr @RAZOR_UART, align 4, !tbaa !14
  call void @get_old_attr(i32 noundef %165, ptr noundef @old_razor_uart_options)
  %166 = load i32, ptr @RAZOR_UART, align 4, !tbaa !14
  call void @set_to_blocking(i32 noundef %166)
  %167 = load i32, ptr @RAZOR_UART, align 4, !tbaa !14
  call void @set_new_attr(i32 noundef %167, ptr noundef @old_razor_uart_options, ptr noundef @new_razor_uart_options)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #10
  call void @initMatrix(ptr dead_on_unwind writable sret(%struct.MATRIX) align 8 %4, i64 noundef 3, i64 noundef 3)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @R_MATRIX, ptr align 8 %4, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #10
  call void @initMatrix(ptr dead_on_unwind writable sret(%struct.MATRIX) align 8 %5, i64 noundef 3, i64 noundef 3)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @DCM_MATRIX, ptr align 8 %5, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #10
  %168 = call i32 @pthread_create(ptr noundef %6, ptr noundef null, ptr noundef @read_IMU_parallel, ptr noundef null) #10
  %169 = icmp ne i32 %168, 0
  br i1 %169, label %170, label %171

170:                                              ; preds = %157
  call void @perror(ptr noundef @.str.26)
  call void @stopVideo()
  call void @exit(i32 noundef -2) #11
  unreachable

171:                                              ; preds = %157
  br label %172

172:                                              ; preds = %176, %171
  %173 = load i8, ptr @IMU_SYNCHED, align 1, !tbaa !9
  %174 = icmp ne i8 %173, 0
  %175 = xor i1 %174, true
  br i1 %175, label %176, label %177

176:                                              ; preds = %172
  br label %172, !llvm.loop !49

177:                                              ; preds = %172
  %178 = load i64, ptr @IMU__READ_TIMESTEP, align 8, !tbaa !39
  %179 = trunc i64 %178 to i32
  %180 = call i32 @usleep(i32 noundef %179)
  call void (...) @Calibrate_IMU()
  call void (...) @construct_zeroed_DCM()
  call void (...) @zero_Euler_angles()
  %181 = load float, ptr @psi_save, align 4, !tbaa !40
  store float %181, ptr @psi_save_last, align 4, !tbaa !40
  %182 = load float, ptr @theta_save, align 4, !tbaa !40
  store float %182, ptr @theta_save_last, align 4, !tbaa !40
  %183 = load float, ptr @phi_save, align 4, !tbaa !40
  store float %183, ptr @phi_save_last, align 4, !tbaa !40
  %184 = call i32 (ptr, ...) @printf(ptr noundef @.str.27)
  %185 = load float, ptr @psi_save, align 4, !tbaa !40
  %186 = call float @TO_DEG(float noundef %185)
  %187 = fpext float %186 to double
  %188 = load float, ptr @theta_save, align 4, !tbaa !40
  %189 = call float @TO_DEG(float noundef %188)
  %190 = fpext float %189 to double
  %191 = load float, ptr @phi_save, align 4, !tbaa !40
  %192 = call float @TO_DEG(float noundef %191)
  %193 = fpext float %192 to double
  %194 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef @MESSAGE, ptr noundef @.str.28, double noundef %187, double noundef %190, double noundef %193) #10
  %195 = call i32 (ptr, ...) @printf(ptr noundef @.str.29, ptr noundef @MESSAGE)
  %196 = call i32 (ptr, ...) @printf(ptr noundef @.str.30)
  call void @Treat_reply(ptr noundef @.str.31)
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #10
  call void @initMatrix(ptr dead_on_unwind writable sret(%struct.MATRIX) align 8 %7, i64 noundef 2, i64 noundef 2)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @P_psi, ptr align 8 %7, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #10
  call void @initMatrix(ptr dead_on_unwind writable sret(%struct.MATRIX) align 8 %8, i64 noundef 2, i64 noundef 2)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @P_psidot, ptr align 8 %8, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #10
  call void @initMatrix(ptr dead_on_unwind writable sret(%struct.MATRIX) align 8 %9, i64 noundef 2, i64 noundef 1)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @x_psi, ptr align 8 %9, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #10
  call void @initMatrix(ptr dead_on_unwind writable sret(%struct.MATRIX) align 8 %10, i64 noundef 2, i64 noundef 1)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @x_psidot, ptr align 8 %10, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #10
  call void @initMatrix(ptr dead_on_unwind writable sret(%struct.MATRIX) align 8 %11, i64 noundef 2, i64 noundef 2)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @Q_psi, ptr align 8 %11, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #10
  call void @initMatrix(ptr dead_on_unwind writable sret(%struct.MATRIX) align 8 %12, i64 noundef 2, i64 noundef 2)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @Q_psidot, ptr align 8 %12, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #10
  call void @initMatrix(ptr dead_on_unwind writable sret(%struct.MATRIX) align 8 %13, i64 noundef 1, i64 noundef 1)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @R_psi, ptr align 8 %13, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #10
  call void @initMatrix(ptr dead_on_unwind writable sret(%struct.MATRIX) align 8 %14, i64 noundef 1, i64 noundef 1)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @R_psidot, ptr align 8 %14, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #10
  %197 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @P_psi, i32 0, i32 2), align 8, !tbaa !50
  %198 = getelementptr inbounds ptr, ptr %197, i64 0
  %199 = load ptr, ptr %198, align 8, !tbaa !5
  %200 = getelementptr inbounds float, ptr %199, i64 0
  store float 1.000000e+00, ptr %200, align 4, !tbaa !40
  %201 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @P_psi, i32 0, i32 2), align 8, !tbaa !50
  %202 = getelementptr inbounds ptr, ptr %201, i64 0
  %203 = load ptr, ptr %202, align 8, !tbaa !5
  %204 = getelementptr inbounds float, ptr %203, i64 1
  store float 0.000000e+00, ptr %204, align 4, !tbaa !40
  %205 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @P_psi, i32 0, i32 2), align 8, !tbaa !50
  %206 = getelementptr inbounds ptr, ptr %205, i64 0
  %207 = load ptr, ptr %206, align 8, !tbaa !5
  %208 = getelementptr inbounds float, ptr %207, i64 1
  store float 0.000000e+00, ptr %208, align 4, !tbaa !40
  %209 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @P_psi, i32 0, i32 2), align 8, !tbaa !50
  %210 = getelementptr inbounds ptr, ptr %209, i64 1
  %211 = load ptr, ptr %210, align 8, !tbaa !5
  %212 = getelementptr inbounds float, ptr %211, i64 1
  store float 1.000000e+00, ptr %212, align 4, !tbaa !40
  %213 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @P_psidot, i32 0, i32 2), align 8, !tbaa !50
  %214 = getelementptr inbounds ptr, ptr %213, i64 0
  %215 = load ptr, ptr %214, align 8, !tbaa !5
  %216 = getelementptr inbounds float, ptr %215, i64 0
  store float 1.000000e+00, ptr %216, align 4, !tbaa !40
  %217 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @P_psidot, i32 0, i32 2), align 8, !tbaa !50
  %218 = getelementptr inbounds ptr, ptr %217, i64 0
  %219 = load ptr, ptr %218, align 8, !tbaa !5
  %220 = getelementptr inbounds float, ptr %219, i64 1
  store float 0.000000e+00, ptr %220, align 4, !tbaa !40
  %221 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @P_psidot, i32 0, i32 2), align 8, !tbaa !50
  %222 = getelementptr inbounds ptr, ptr %221, i64 0
  %223 = load ptr, ptr %222, align 8, !tbaa !5
  %224 = getelementptr inbounds float, ptr %223, i64 1
  store float 0.000000e+00, ptr %224, align 4, !tbaa !40
  %225 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @P_psidot, i32 0, i32 2), align 8, !tbaa !50
  %226 = getelementptr inbounds ptr, ptr %225, i64 1
  %227 = load ptr, ptr %226, align 8, !tbaa !5
  %228 = getelementptr inbounds float, ptr %227, i64 1
  store float 1.000000e+00, ptr %228, align 4, !tbaa !40
  %229 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @x_psi, i32 0, i32 2), align 8, !tbaa !50
  %230 = getelementptr inbounds ptr, ptr %229, i64 0
  %231 = load ptr, ptr %230, align 8, !tbaa !5
  %232 = getelementptr inbounds float, ptr %231, i64 0
  store float 0.000000e+00, ptr %232, align 4, !tbaa !40
  %233 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @x_psi, i32 0, i32 2), align 8, !tbaa !50
  %234 = getelementptr inbounds ptr, ptr %233, i64 1
  %235 = load ptr, ptr %234, align 8, !tbaa !5
  %236 = getelementptr inbounds float, ptr %235, i64 0
  store float 0.000000e+00, ptr %236, align 4, !tbaa !40
  %237 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @x_psidot, i32 0, i32 2), align 8, !tbaa !50
  %238 = getelementptr inbounds ptr, ptr %237, i64 0
  %239 = load ptr, ptr %238, align 8, !tbaa !5
  %240 = getelementptr inbounds float, ptr %239, i64 0
  store float 0.000000e+00, ptr %240, align 4, !tbaa !40
  %241 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @x_psidot, i32 0, i32 2), align 8, !tbaa !50
  %242 = getelementptr inbounds ptr, ptr %241, i64 1
  %243 = load ptr, ptr %242, align 8, !tbaa !5
  %244 = getelementptr inbounds float, ptr %243, i64 0
  store float 0.000000e+00, ptr %244, align 4, !tbaa !40
  %245 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @Q_psi, i32 0, i32 2), align 8, !tbaa !50
  %246 = getelementptr inbounds ptr, ptr %245, i64 0
  %247 = load ptr, ptr %246, align 8, !tbaa !5
  %248 = getelementptr inbounds float, ptr %247, i64 0
  store float 0x3F847AE140000000, ptr %248, align 4, !tbaa !40
  %249 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @Q_psi, i32 0, i32 2), align 8, !tbaa !50
  %250 = getelementptr inbounds ptr, ptr %249, i64 0
  %251 = load ptr, ptr %250, align 8, !tbaa !5
  %252 = getelementptr inbounds float, ptr %251, i64 1
  store float 0.000000e+00, ptr %252, align 4, !tbaa !40
  %253 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @Q_psi, i32 0, i32 2), align 8, !tbaa !50
  %254 = getelementptr inbounds ptr, ptr %253, i64 0
  %255 = load ptr, ptr %254, align 8, !tbaa !5
  %256 = getelementptr inbounds float, ptr %255, i64 1
  store float 0.000000e+00, ptr %256, align 4, !tbaa !40
  %257 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @Q_psi, i32 0, i32 2), align 8, !tbaa !50
  %258 = getelementptr inbounds ptr, ptr %257, i64 1
  %259 = load ptr, ptr %258, align 8, !tbaa !5
  %260 = getelementptr inbounds float, ptr %259, i64 1
  store float 1.000000e+02, ptr %260, align 4, !tbaa !40
  %261 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @Q_psidot, i32 0, i32 2), align 8, !tbaa !50
  %262 = getelementptr inbounds ptr, ptr %261, i64 0
  %263 = load ptr, ptr %262, align 8, !tbaa !5
  %264 = getelementptr inbounds float, ptr %263, i64 0
  store float 2.000000e+02, ptr %264, align 4, !tbaa !40
  %265 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @Q_psidot, i32 0, i32 2), align 8, !tbaa !50
  %266 = getelementptr inbounds ptr, ptr %265, i64 0
  %267 = load ptr, ptr %266, align 8, !tbaa !5
  %268 = getelementptr inbounds float, ptr %267, i64 1
  store float 0.000000e+00, ptr %268, align 4, !tbaa !40
  %269 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @Q_psidot, i32 0, i32 2), align 8, !tbaa !50
  %270 = getelementptr inbounds ptr, ptr %269, i64 0
  %271 = load ptr, ptr %270, align 8, !tbaa !5
  %272 = getelementptr inbounds float, ptr %271, i64 1
  store float 0.000000e+00, ptr %272, align 4, !tbaa !40
  %273 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @Q_psidot, i32 0, i32 2), align 8, !tbaa !50
  %274 = getelementptr inbounds ptr, ptr %273, i64 1
  %275 = load ptr, ptr %274, align 8, !tbaa !5
  %276 = getelementptr inbounds float, ptr %275, i64 1
  store float 2.000000e+02, ptr %276, align 4, !tbaa !40
  %277 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @R_psi, i32 0, i32 2), align 8, !tbaa !50
  %278 = getelementptr inbounds ptr, ptr %277, i64 0
  %279 = load ptr, ptr %278, align 8, !tbaa !5
  %280 = getelementptr inbounds float, ptr %279, i64 0
  store float 1.000000e+01, ptr %280, align 4, !tbaa !40
  %281 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @R_psidot, i32 0, i32 2), align 8, !tbaa !50
  %282 = getelementptr inbounds ptr, ptr %281, i64 0
  %283 = load ptr, ptr %282, align 8, !tbaa !5
  %284 = getelementptr inbounds float, ptr %283, i64 0
  store float 5.000000e+03, ptr %284, align 4, !tbaa !40
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @P_theta, ptr align 8 @P_psi, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @x_theta, ptr align 8 @x_psi, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @Q_theta, ptr align 8 @Q_psi, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @R_theta, ptr align 8 @R_psi, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @P_thetadot, ptr align 8 @P_psidot, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @x_thetadot, ptr align 8 @x_psidot, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @Q_thetadot, ptr align 8 @Q_psidot, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @R_thetadot, ptr align 8 @R_psidot, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @P_phi, ptr align 8 @P_psi, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @x_phi, ptr align 8 @x_psi, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @Q_phi, ptr align 8 @Q_psi, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @R_phi, ptr align 8 @R_psi, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @P_phidot, ptr align 8 @P_psidot, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @x_phidot, ptr align 8 @x_psidot, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @Q_phidot, ptr align 8 @Q_psidot, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @R_phidot, ptr align 8 @R_psidot, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #10
  call void @initMatrix(ptr dead_on_unwind writable sret(%struct.MATRIX) align 8 %15, i64 noundef 2, i64 noundef 2)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @EYE2, ptr align 8 %15, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #10
  %285 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @EYE2, i32 0, i32 2), align 8, !tbaa !50
  %286 = getelementptr inbounds ptr, ptr %285, i64 0
  %287 = load ptr, ptr %286, align 8, !tbaa !5
  %288 = getelementptr inbounds float, ptr %287, i64 0
  store float 1.000000e+00, ptr %288, align 4, !tbaa !40
  %289 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @EYE2, i32 0, i32 2), align 8, !tbaa !50
  %290 = getelementptr inbounds ptr, ptr %289, i64 0
  %291 = load ptr, ptr %290, align 8, !tbaa !5
  %292 = getelementptr inbounds float, ptr %291, i64 1
  store float 0.000000e+00, ptr %292, align 4, !tbaa !40
  %293 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @EYE2, i32 0, i32 2), align 8, !tbaa !50
  %294 = getelementptr inbounds ptr, ptr %293, i64 1
  %295 = load ptr, ptr %294, align 8, !tbaa !5
  %296 = getelementptr inbounds float, ptr %295, i64 0
  store float 0.000000e+00, ptr %296, align 4, !tbaa !40
  %297 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @EYE2, i32 0, i32 2), align 8, !tbaa !50
  %298 = getelementptr inbounds ptr, ptr %297, i64 1
  %299 = load ptr, ptr %298, align 8, !tbaa !5
  %300 = getelementptr inbounds float, ptr %299, i64 1
  store float 1.000000e+00, ptr %300, align 4, !tbaa !40
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #10
  call void @initMatrix(ptr dead_on_unwind writable sret(%struct.MATRIX) align 8 %16, i64 noundef 2, i64 noundef 2)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @A_kalman, ptr align 8 %16, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #10
  call void @initMatrix(ptr dead_on_unwind writable sret(%struct.MATRIX) align 8 %17, i64 noundef 1, i64 noundef 2)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @C_kalman, ptr align 8 %17, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #10
  call void @initMatrix(ptr dead_on_unwind writable sret(%struct.MATRIX) align 8 %18, i64 noundef 1, i64 noundef 1)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @z_temp, ptr align 8 %18, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #10
  call void @initMatrix(ptr dead_on_unwind writable sret(%struct.MATRIX) align 8 %19, i64 noundef 1, i64 noundef 1)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @inn, ptr align 8 %19, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #10
  call void @initMatrix(ptr dead_on_unwind writable sret(%struct.MATRIX) align 8 %20, i64 noundef 1, i64 noundef 1)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @S, ptr align 8 %20, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #10
  call void @initMatrix(ptr dead_on_unwind writable sret(%struct.MATRIX) align 8 %21, i64 noundef 2, i64 noundef 1)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @K, ptr align 8 %21, i64 24, i1 false), !tbaa.struct !48
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #10
  %301 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @A_kalman, i32 0, i32 2), align 8, !tbaa !50
  %302 = getelementptr inbounds ptr, ptr %301, i64 0
  %303 = load ptr, ptr %302, align 8, !tbaa !5
  %304 = getelementptr inbounds float, ptr %303, i64 0
  store float 1.000000e+00, ptr %304, align 4, !tbaa !40
  %305 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @A_kalman, i32 0, i32 2), align 8, !tbaa !50
  %306 = getelementptr inbounds ptr, ptr %305, i64 1
  %307 = load ptr, ptr %306, align 8, !tbaa !5
  %308 = getelementptr inbounds float, ptr %307, i64 0
  store float 0.000000e+00, ptr %308, align 4, !tbaa !40
  %309 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @A_kalman, i32 0, i32 2), align 8, !tbaa !50
  %310 = getelementptr inbounds ptr, ptr %309, i64 1
  %311 = load ptr, ptr %310, align 8, !tbaa !5
  %312 = getelementptr inbounds float, ptr %311, i64 1
  store float 1.000000e+00, ptr %312, align 4, !tbaa !40
  %313 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @C_kalman, i32 0, i32 2), align 8, !tbaa !50
  %314 = getelementptr inbounds ptr, ptr %313, i64 0
  %315 = load ptr, ptr %314, align 8, !tbaa !5
  %316 = getelementptr inbounds float, ptr %315, i64 0
  store float 1.000000e+00, ptr %316, align 4, !tbaa !40
  %317 = load ptr, ptr getelementptr inbounds (%struct.MATRIX, ptr @C_kalman, i32 0, i32 2), align 8, !tbaa !50
  %318 = getelementptr inbounds ptr, ptr %317, i64 0
  %319 = load ptr, ptr %318, align 8, !tbaa !5
  %320 = getelementptr inbounds float, ptr %319, i64 1
  store float 0.000000e+00, ptr %320, align 4, !tbaa !40
  %321 = call i32 (ptr, ...) @printf(ptr noundef @.str.32)
  %322 = load ptr, ptr @stdout, align 8, !tbaa !5
  %323 = call i32 @fflush(ptr noundef %322)
  %324 = call i32 @usleep(i32 noundef 1000000)
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #10
  %325 = call i32 @pthread_create(ptr noundef %22, ptr noundef null, ptr noundef @get_filtered_attitude_parallel, ptr noundef null) #10
  %326 = icmp ne i32 %325, 0
  br i1 %326, label %327, label %328

327:                                              ; preds = %177
  call void @perror(ptr noundef @.str.33)
  call void @stopVideo()
  call void @exit(i32 noundef -2) #11
  unreachable

328:                                              ; preds = %177
  %329 = call i32 @gettimeofday(ptr noundef @before_loop, ptr noundef null) #10
  %330 = call i32 @gettimeofday(ptr noundef @before_control, ptr noundef null) #10
  br label %331

331:                                              ; preds = %352, %328
  %332 = load i64, ptr @before_loop, align 8
  %333 = load i64, ptr getelementptr inbounds ({ i64, i64 }, ptr @before_loop, i32 0, i32 1), align 8
  %334 = load i64, ptr @elapsed_loop, align 8
  %335 = load i64, ptr getelementptr inbounds ({ i64, i64 }, ptr @elapsed_loop, i32 0, i32 1), align 8
  call void @check_time(ptr noundef @now_loop, i64 %332, i64 %333, i64 %334, i64 %335, ptr noundef @time_loop)
  %336 = load i64, ptr @IMU__READ_TIMESTEP, align 8, !tbaa !39
  call void @passive_wait(ptr noundef @now_control, ptr noundef @before_control, ptr noundef @elapsed_control, ptr noundef @time_control, i64 noundef %336)
  %337 = load float, ptr @dt, align 4, !tbaa !40
  %338 = fpext float %337 to double
  %339 = load float, ptr @psi_filt, align 4, !tbaa !40
  %340 = fpext float %339 to double
  %341 = load float, ptr @psi_dot_filt, align 4, !tbaa !40
  %342 = fpext float %341 to double
  %343 = load float, ptr @theta_filt, align 4, !tbaa !40
  %344 = fpext float %343 to double
  %345 = load float, ptr @theta_dot_filt, align 4, !tbaa !40
  %346 = fpext float %345 to double
  %347 = load float, ptr @phi_filt, align 4, !tbaa !40
  %348 = fpext float %347 to double
  %349 = load float, ptr @phi_dot_filt, align 4, !tbaa !40
  %350 = fpext float %349 to double
  %351 = call i32 (ptr, ...) @printf(ptr noundef @.str.34, double noundef %338, double noundef %340, double noundef %342, double noundef %344, double noundef %346, double noundef %348, double noundef %350)
  br label %352

352:                                              ; preds = %331
  %353 = load i64, ptr @time_loop, align 8, !tbaa !39
  %354 = load i64, ptr @CALIB__TIME, align 8, !tbaa !41
  %355 = icmp ule i64 %353, %354
  br i1 %355, label %331, label %356, !llvm.loop !52

356:                                              ; preds = %352
  %357 = call i32 (ptr, ...) @printf(ptr noundef @.str.35)
  %358 = call i32 (ptr, ...) @printf(ptr noundef @.str.36)
  call void @Treat_reply(ptr noundef @.str.37)
  %359 = call i32 (ptr, ...) @printf(ptr noundef @.str.38)
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #10
  store i8 1, ptr %23, align 1, !tbaa !9
  br label %360

360:                                              ; preds = %399, %356
  %361 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.29, ptr noundef @reply)
  %362 = call i32 @strcmp(ptr noundef @reply, ptr noundef @.str.39) #12
  %363 = icmp ne i32 %362, 0
  br i1 %363, label %364, label %371

364:                                              ; preds = %360
  %365 = call i32 @strcmp(ptr noundef @reply, ptr noundef @.str.40) #12
  %366 = icmp ne i32 %365, 0
  br i1 %366, label %367, label %371

367:                                              ; preds = %364
  %368 = call i32 (ptr, ...) @printf(ptr noundef @.str.41)
  %369 = load ptr, ptr @stdout, align 8, !tbaa !5
  %370 = call i32 @fflush(ptr noundef %369)
  br label %398

371:                                              ; preds = %364, %360
  %372 = call i32 @strcmp(ptr noundef @reply, ptr noundef @.str.39) #12
  %373 = icmp eq i32 %372, 0
  br i1 %373, label %374, label %392

374:                                              ; preds = %371
  store i8 1, ptr @flight_type, align 1, !tbaa !9
  store i8 0, ptr %23, align 1, !tbaa !9
  call void @llvm.memset.p0.i64(ptr align 4 @new_msp430_uart_options, i8 0, i64 60, i1 false)
  store i32 0, ptr @new_msp430_uart_options, align 4, !tbaa !43
  store i32 0, ptr getelementptr inbounds (%struct.termios, ptr @new_msp430_uart_options, i32 0, i32 1), align 4, !tbaa !45
  store i32 6322, ptr getelementptr inbounds (%struct.termios, ptr @new_msp430_uart_options, i32 0, i32 2), align 4, !tbaa !46
  store i32 0, ptr getelementptr inbounds (%struct.termios, ptr @new_msp430_uart_options, i32 0, i32 3), align 4, !tbaa !47
  store i8 0, ptr getelementptr inbounds ([32 x i8], ptr getelementptr inbounds (%struct.termios, ptr @new_msp430_uart_options, i32 0, i32 5), i64 0, i64 6), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds ([32 x i8], ptr getelementptr inbounds (%struct.termios, ptr @new_msp430_uart_options, i32 0, i32 5), i64 0, i64 5), align 1, !tbaa !9
  %375 = call i32 (ptr, ...) @printf(ptr noundef @.str.42)
  %376 = load ptr, ptr @stdout, align 8, !tbaa !5
  %377 = call i32 @fflush(ptr noundef %376)
  call void @open_serial_port(ptr noundef @MSP430_UART, ptr noundef @.str.43)
  %378 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  %379 = load i32, ptr @MSP430_UART, align 4, !tbaa !14
  call void @get_old_attr(i32 noundef %379, ptr noundef @old_msp430_uart_options)
  %380 = load i32, ptr @MSP430_UART, align 4, !tbaa !14
  call void @set_to_blocking(i32 noundef %380)
  %381 = load i32, ptr @MSP430_UART, align 4, !tbaa !14
  call void @set_new_attr(i32 noundef %381, ptr noundef @old_msp430_uart_options, ptr noundef @new_msp430_uart_options)
  %382 = call i32 (ptr, ...) @printf(ptr noundef @.str.44)
  %383 = load ptr, ptr @stdout, align 8, !tbaa !5
  %384 = call i32 @fflush(ptr noundef %383)
  call void @MSP430_UART_write(ptr noundef @.str.45)
  %385 = call i32 @usleep(i32 noundef 500000)
  %386 = call i32 (ptr, ...) @printf(ptr noundef @.str.46)
  %387 = call i32 (ptr, ...) @printf(ptr noundef @.str.47)
  %388 = load ptr, ptr @stdout, align 8, !tbaa !5
  %389 = call i32 @fflush(ptr noundef %388)
  call void @MSP430_UART_write(ptr noundef @.str.48)
  %390 = call i32 (ptr, ...) @printf(ptr noundef @.str.49)
  %391 = call i32 @usleep(i32 noundef 10000000)
  br label %397

392:                                              ; preds = %371
  %393 = call i32 @strcmp(ptr noundef @reply, ptr noundef @.str.40) #12
  %394 = icmp eq i32 %393, 0
  br i1 %394, label %395, label %396

395:                                              ; preds = %392
  store i8 0, ptr @flight_type, align 1, !tbaa !9
  store i8 0, ptr %23, align 1, !tbaa !9
  br label %396

396:                                              ; preds = %395, %392
  br label %397

397:                                              ; preds = %396, %374
  br label %398

398:                                              ; preds = %397, %367
  br label %399

399:                                              ; preds = %398
  %400 = load i8, ptr %23, align 1, !tbaa !9
  %401 = icmp ne i8 %400, 0
  br i1 %401, label %360, label %402, !llvm.loop !53

402:                                              ; preds = %399
  call void @llvm.memset.p0.i64(ptr align 16 @reply, i8 0, i64 30, i1 false)
  %403 = call i32 (ptr, ...) @printf(ptr noundef @.str.50)
  call void @Treat_reply(ptr noundef @.str.51)
  %404 = call i32 (ptr, ...) @printf(ptr noundef @.str.52)
  %405 = load ptr, ptr @stdout, align 8, !tbaa !5
  %406 = call i32 @fflush(ptr noundef %405)
  br label %407

407:                                              ; preds = %416, %402
  %408 = load i8, ptr @launch_detect_gpio, align 1, !tbaa !9
  %409 = zext i8 %408 to i32
  %410 = shl i32 1, %409
  %411 = load ptr, ptr getelementptr inbounds (%struct.bcm2835_peripheral, ptr @gpio, i32 0, i32 3), align 8, !tbaa !10
  %412 = getelementptr inbounds i32, ptr %411, i64 13
  %413 = load volatile i32, ptr %412, align 4, !tbaa !14
  %414 = and i32 %413, %410
  store volatile i32 %414, ptr %412, align 4, !tbaa !14
  %415 = icmp ne i32 %414, 0
  br i1 %415, label %416, label %417

416:                                              ; preds = %407
  br label %407, !llvm.loop !54

417:                                              ; preds = %407
  %418 = call i32 (ptr, ...) @printf(ptr noundef @.str.53)
  %419 = load ptr, ptr @stdout, align 8, !tbaa !5
  %420 = call i32 @fflush(ptr noundef %419)
  %421 = load i8, ptr @flight_type, align 1, !tbaa !9
  %422 = sext i8 %421 to i32
  %423 = icmp eq i32 %422, 1
  br i1 %423, label %424, label %644

424:                                              ; preds = %417
  %425 = load i64, ptr @ENGINE__BURN_TIME, align 8, !tbaa !39
  %426 = trunc i64 %425 to i32
  %427 = call i32 @usleep(i32 noundef %426)
  %428 = call i32 (ptr, ...) @printf(ptr noundef @.str.54)
  call void @llvm.lifetime.start.p0(i64 200, ptr %24) #10
  %429 = load ptr, ptr @control_log, align 8, !tbaa !5
  %430 = load ptr, ptr @error_log, align 8, !tbaa !5
  call void @write_to_file_custom(ptr noundef %429, ptr noundef @.str.55, ptr noundef %430)
  %431 = call i32 @gettimeofday(ptr noundef @before_control, ptr noundef null) #10
  %432 = call i32 @gettimeofday(ptr noundef @before_loop, ptr noundef null) #10
  br label %433

433:                                              ; preds = %635, %424
  %434 = load i64, ptr @GLOBAL__TIME_STARTPOINT, align 8
  %435 = load i64, ptr getelementptr inbounds ({ i64, i64 }, ptr @GLOBAL__TIME_STARTPOINT, i32 0, i32 1), align 8
  %436 = load i64, ptr @elapsed_control_glob, align 8
  %437 = load i64, ptr getelementptr inbounds ({ i64, i64 }, ptr @elapsed_control_glob, i32 0, i32 1), align 8
  call void @check_time(ptr noundef @now_control_glob, i64 %434, i64 %435, i64 %436, i64 %437, ptr noundef @time_control_glob)
  %438 = load i64, ptr @before_loop, align 8
  %439 = load i64, ptr getelementptr inbounds ({ i64, i64 }, ptr @before_loop, i32 0, i32 1), align 8
  %440 = load i64, ptr @elapsed_loop, align 8
  %441 = load i64, ptr getelementptr inbounds ({ i64, i64 }, ptr @elapsed_loop, i32 0, i32 1), align 8
  call void @check_time(ptr noundef @now_loop, i64 %438, i64 %439, i64 %440, i64 %441, ptr noundef @time_loop)
  %442 = load i64, ptr @CONTROL__TIME_STEP, align 8, !tbaa !39
  call void @passive_wait(ptr noundef @now_control, ptr noundef @before_control, ptr noundef @elapsed_control, ptr noundef @time_control, i64 noundef %442)
  %443 = load float, ptr @psi_filt, align 4, !tbaa !40
  store float %443, ptr @psi_cont, align 4, !tbaa !40
  %444 = load float, ptr @psi_dot_filt, align 4, !tbaa !40
  store float %444, ptr @psidot_cont, align 4, !tbaa !40
  %445 = load float, ptr @theta_filt, align 4, !tbaa !40
  store float %445, ptr @theta_cont, align 4, !tbaa !40
  %446 = load float, ptr @theta_dot_filt, align 4, !tbaa !40
  store float %446, ptr @thetadot_cont, align 4, !tbaa !40
  %447 = load float, ptr @phi_filt, align 4, !tbaa !40
  store float %447, ptr @phi_cont, align 4, !tbaa !40
  %448 = load float, ptr @wx, align 4, !tbaa !40
  store float %448, ptr @wx_cont, align 4, !tbaa !40
  %449 = load double, ptr @Fpitch_loop, align 8, !tbaa !55
  %450 = load float, ptr @theta_cont, align 4, !tbaa !40
  %451 = load float, ptr @theta_ref, align 4, !tbaa !40
  %452 = fsub float %450, %451
  %453 = fpext float %452 to double
  %454 = load double, ptr getelementptr inbounds (%struct.Control_loop, ptr @Fpitch_loop, i32 0, i32 1), align 8, !tbaa !58
  %455 = load float, ptr @thetadot_cont, align 4, !tbaa !40
  %456 = fpext float %455 to double
  %457 = fmul double %454, %456
  %458 = call double @llvm.fmuladd.f64(double %449, double %453, double %457)
  store double %458, ptr @Fpitch, align 8, !tbaa !59
  %459 = load double, ptr @Fyaw_loop, align 8, !tbaa !55
  %460 = load float, ptr @psi_cont, align 4, !tbaa !40
  %461 = load float, ptr @psi_ref, align 4, !tbaa !40
  %462 = fsub float %460, %461
  %463 = fpext float %462 to double
  %464 = load double, ptr getelementptr inbounds (%struct.Control_loop, ptr @Fyaw_loop, i32 0, i32 1), align 8, !tbaa !58
  %465 = load float, ptr @psidot_cont, align 4, !tbaa !40
  %466 = fpext float %465 to double
  %467 = fmul double %464, %466
  %468 = call double @llvm.fmuladd.f64(double %459, double %463, double %467)
  store double %468, ptr @Fyaw, align 8, !tbaa !59
  %469 = load double, ptr @Mroll_loop, align 8, !tbaa !55
  %470 = load float, ptr @wx_cont, align 4, !tbaa !40
  %471 = load float, ptr @wx_ref, align 4, !tbaa !40
  %472 = fsub float %470, %471
  %473 = fpext float %472 to double
  %474 = fmul double %469, %473
  store double %474, ptr @Mroll, align 8, !tbaa !59
  store double 0.000000e+00, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 1), i64 0, i64 1), align 8, !tbaa !59
  store double -1.000000e+00, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 1), i64 0, i64 2), align 16, !tbaa !59
  store double -1.000000e+00, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 1), i64 0, i64 3), align 8, !tbaa !59
  store double -1.000000e+00, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 1), i64 0, i64 4), align 16, !tbaa !59
  store double -1.000000e+00, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 1), i64 0, i64 5), align 8, !tbaa !59
  %475 = load double, ptr @Fpitch, align 8, !tbaa !59
  %476 = fcmp oge double %475, 0.000000e+00
  br i1 %476, label %477, label %493

477:                                              ; preds = %433
  %478 = load double, ptr @Fpitch, align 8, !tbaa !59
  store double %478, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 2), i64 0, i64 1), align 8, !tbaa !59
  %479 = load float, ptr @phi_cont, align 4, !tbaa !40
  %480 = fpext float %479 to double
  %481 = call double @cos(double noundef %480) #10
  store double %481, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 2), i64 0, i64 2), align 16, !tbaa !59
  %482 = load float, ptr @phi_cont, align 4, !tbaa !40
  %483 = fpext float %482 to double
  %484 = call double @sin(double noundef %483) #10
  %485 = fneg double %484
  store double %485, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 2), i64 0, i64 3), align 8, !tbaa !59
  %486 = load float, ptr @phi_cont, align 4, !tbaa !40
  %487 = fpext float %486 to double
  %488 = call double @cos(double noundef %487) #10
  %489 = fneg double %488
  store double %489, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 2), i64 0, i64 4), align 16, !tbaa !59
  %490 = load float, ptr @phi_cont, align 4, !tbaa !40
  %491 = fpext float %490 to double
  %492 = call double @sin(double noundef %491) #10
  store double %492, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 2), i64 0, i64 5), align 8, !tbaa !59
  br label %510

493:                                              ; preds = %433
  %494 = load double, ptr @Fpitch, align 8, !tbaa !59
  %495 = fneg double %494
  store double %495, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 2), i64 0, i64 1), align 8, !tbaa !59
  %496 = load float, ptr @phi_cont, align 4, !tbaa !40
  %497 = fpext float %496 to double
  %498 = call double @cos(double noundef %497) #10
  %499 = fneg double %498
  store double %499, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 2), i64 0, i64 2), align 16, !tbaa !59
  %500 = load float, ptr @phi_cont, align 4, !tbaa !40
  %501 = fpext float %500 to double
  %502 = call double @sin(double noundef %501) #10
  store double %502, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 2), i64 0, i64 3), align 8, !tbaa !59
  %503 = load float, ptr @phi_cont, align 4, !tbaa !40
  %504 = fpext float %503 to double
  %505 = call double @cos(double noundef %504) #10
  store double %505, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 2), i64 0, i64 4), align 16, !tbaa !59
  %506 = load float, ptr @phi_cont, align 4, !tbaa !40
  %507 = fpext float %506 to double
  %508 = call double @sin(double noundef %507) #10
  %509 = fneg double %508
  store double %509, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 2), i64 0, i64 5), align 8, !tbaa !59
  br label %510

510:                                              ; preds = %493, %477
  %511 = load double, ptr @Fyaw, align 8, !tbaa !59
  %512 = fcmp oge double %511, 0.000000e+00
  br i1 %512, label %513, label %529

513:                                              ; preds = %510
  %514 = load double, ptr @Fyaw, align 8, !tbaa !59
  store double %514, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 3), i64 0, i64 1), align 8, !tbaa !59
  %515 = load float, ptr @phi_cont, align 4, !tbaa !40
  %516 = fpext float %515 to double
  %517 = call double @sin(double noundef %516) #10
  store double %517, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 3), i64 0, i64 2), align 16, !tbaa !59
  %518 = load float, ptr @phi_cont, align 4, !tbaa !40
  %519 = fpext float %518 to double
  %520 = call double @cos(double noundef %519) #10
  store double %520, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 3), i64 0, i64 3), align 8, !tbaa !59
  %521 = load float, ptr @phi_cont, align 4, !tbaa !40
  %522 = fpext float %521 to double
  %523 = call double @sin(double noundef %522) #10
  %524 = fneg double %523
  store double %524, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 3), i64 0, i64 4), align 16, !tbaa !59
  %525 = load float, ptr @phi_cont, align 4, !tbaa !40
  %526 = fpext float %525 to double
  %527 = call double @cos(double noundef %526) #10
  %528 = fneg double %527
  store double %528, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 3), i64 0, i64 5), align 8, !tbaa !59
  br label %546

529:                                              ; preds = %510
  %530 = load double, ptr @Fyaw, align 8, !tbaa !59
  %531 = fneg double %530
  store double %531, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 3), i64 0, i64 1), align 8, !tbaa !59
  %532 = load float, ptr @phi_cont, align 4, !tbaa !40
  %533 = fpext float %532 to double
  %534 = call double @sin(double noundef %533) #10
  %535 = fneg double %534
  store double %535, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 3), i64 0, i64 2), align 16, !tbaa !59
  %536 = load float, ptr @phi_cont, align 4, !tbaa !40
  %537 = fpext float %536 to double
  %538 = call double @cos(double noundef %537) #10
  %539 = fneg double %538
  store double %539, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 3), i64 0, i64 3), align 8, !tbaa !59
  %540 = load float, ptr @phi_cont, align 4, !tbaa !40
  %541 = fpext float %540 to double
  %542 = call double @sin(double noundef %541) #10
  store double %542, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 3), i64 0, i64 4), align 16, !tbaa !59
  %543 = load float, ptr @phi_cont, align 4, !tbaa !40
  %544 = fpext float %543 to double
  %545 = call double @cos(double noundef %544) #10
  store double %545, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 3), i64 0, i64 5), align 8, !tbaa !59
  br label %546

546:                                              ; preds = %529, %513
  %547 = load double, ptr @Mroll, align 8, !tbaa !59
  %548 = fcmp oge double %547, 0.000000e+00
  br i1 %548, label %549, label %557

549:                                              ; preds = %546
  %550 = load double, ptr @Mroll, align 8, !tbaa !59
  store double %550, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 4), i64 0, i64 1), align 8, !tbaa !59
  %551 = load double, ptr @d, align 8, !tbaa !59
  store double %551, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 4), i64 0, i64 2), align 16, !tbaa !59
  %552 = load double, ptr @d, align 8, !tbaa !59
  %553 = fneg double %552
  store double %553, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 4), i64 0, i64 3), align 8, !tbaa !59
  %554 = load double, ptr @d, align 8, !tbaa !59
  store double %554, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 4), i64 0, i64 4), align 16, !tbaa !59
  %555 = load double, ptr @d, align 8, !tbaa !59
  %556 = fneg double %555
  store double %556, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 4), i64 0, i64 5), align 8, !tbaa !59
  br label %566

557:                                              ; preds = %546
  %558 = load double, ptr @Mroll, align 8, !tbaa !59
  %559 = fneg double %558
  store double %559, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 4), i64 0, i64 1), align 8, !tbaa !59
  %560 = load double, ptr @d, align 8, !tbaa !59
  %561 = fneg double %560
  store double %561, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 4), i64 0, i64 2), align 16, !tbaa !59
  %562 = load double, ptr @d, align 8, !tbaa !59
  store double %562, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 4), i64 0, i64 3), align 8, !tbaa !59
  %563 = load double, ptr @d, align 8, !tbaa !59
  %564 = fneg double %563
  store double %564, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 4), i64 0, i64 4), align 16, !tbaa !59
  %565 = load double, ptr @d, align 8, !tbaa !59
  store double %565, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds ([5 x [6 x double]], ptr @A, i64 0, i64 4), i64 0, i64 5), align 8, !tbaa !59
  br label %566

566:                                              ; preds = %557, %549
  %567 = load i32, ptr @M, align 4, !tbaa !14
  %568 = load i32, ptr @N, align 4, !tbaa !14
  %569 = load i32, ptr @M1, align 4, !tbaa !14
  %570 = load i32, ptr @M2, align 4, !tbaa !14
  %571 = load i32, ptr @M3, align 4, !tbaa !14
  call void @simplx(ptr noundef @A, i32 noundef %567, i32 noundef %568, i32 noundef %569, i32 noundef %570, i32 noundef %571, ptr noundef @ICASE, ptr noundef @IZROV, ptr noundef @IPOSV)
  %572 = load i32, ptr @ICASE, align 4, !tbaa !14
  %573 = load i32, ptr @M, align 4, !tbaa !14
  %574 = load i32, ptr @N, align 4, !tbaa !14
  call void @get_simplex_solution(i32 noundef %572, ptr noundef @IPOSV, ptr noundef @A, i32 noundef %573, i32 noundef %574, ptr noundef @R1, ptr noundef @R2, ptr noundef @R3, ptr noundef @R4)
  %575 = load double, ptr @R1, align 8, !tbaa !59
  %576 = load double, ptr @VALVE__MAX_THRUST, align 8, !tbaa !59
  %577 = fcmp oge double %575, %576
  br i1 %577, label %578, label %580

578:                                              ; preds = %566
  %579 = load double, ptr @VALVE__MAX_THRUST, align 8, !tbaa !59
  store double %579, ptr @R1, align 8, !tbaa !59
  br label %580

580:                                              ; preds = %578, %566
  %581 = load double, ptr @R2, align 8, !tbaa !59
  %582 = load double, ptr @VALVE__MAX_THRUST, align 8, !tbaa !59
  %583 = fcmp oge double %581, %582
  br i1 %583, label %584, label %586

584:                                              ; preds = %580
  %585 = load double, ptr @VALVE__MAX_THRUST, align 8, !tbaa !59
  store double %585, ptr @R2, align 8, !tbaa !59
  br label %586

586:                                              ; preds = %584, %580
  %587 = load double, ptr @R3, align 8, !tbaa !59
  %588 = load double, ptr @VALVE__MAX_THRUST, align 8, !tbaa !59
  %589 = fcmp oge double %587, %588
  br i1 %589, label %590, label %592

590:                                              ; preds = %586
  %591 = load double, ptr @VALVE__MAX_THRUST, align 8, !tbaa !59
  store double %591, ptr @R3, align 8, !tbaa !59
  br label %592

592:                                              ; preds = %590, %586
  %593 = load double, ptr @R4, align 8, !tbaa !59
  %594 = load double, ptr @VALVE__MAX_THRUST, align 8, !tbaa !59
  %595 = fcmp oge double %593, %594
  br i1 %595, label %596, label %598

596:                                              ; preds = %592
  %597 = load double, ptr @VALVE__MAX_THRUST, align 8, !tbaa !59
  store double %597, ptr @R4, align 8, !tbaa !59
  br label %598

598:                                              ; preds = %596, %592
  %599 = load double, ptr @R1, align 8, !tbaa !59
  %600 = load double, ptr @R2, align 8, !tbaa !59
  %601 = load double, ptr @R3, align 8, !tbaa !59
  %602 = load double, ptr @R4, align 8, !tbaa !59
  call void @search_PWM(double noundef %599, double noundef %600, double noundef %601, double noundef %602, ptr noundef @PWM1, ptr noundef @PWM2, ptr noundef @PWM3, ptr noundef @PWM4)
  %603 = load i32, ptr @PWM1, align 4, !tbaa !14
  %604 = load i32, ptr @PWM2, align 4, !tbaa !14
  %605 = load i32, ptr @PWM3, align 4, !tbaa !14
  %606 = load i32, ptr @PWM4, align 4, !tbaa !14
  call void @MSP430_UART_write_PWM(i32 noundef %603, i32 noundef %604, i32 noundef %605, i32 noundef %606)
  %607 = getelementptr inbounds [200 x i8], ptr %24, i64 0, i64 0
  %608 = load i64, ptr @time_control_glob, align 8, !tbaa !39
  %609 = load i64, ptr @time_control, align 8, !tbaa !39
  %610 = load double, ptr @Fpitch, align 8, !tbaa !59
  %611 = load double, ptr @Fyaw, align 8, !tbaa !59
  %612 = load double, ptr @Mroll, align 8, !tbaa !59
  %613 = load double, ptr @R1, align 8, !tbaa !59
  %614 = load double, ptr @R2, align 8, !tbaa !59
  %615 = load double, ptr @R3, align 8, !tbaa !59
  %616 = load double, ptr @R4, align 8, !tbaa !59
  %617 = load i32, ptr @PWM1, align 4, !tbaa !14
  %618 = load i32, ptr @PWM2, align 4, !tbaa !14
  %619 = load i32, ptr @PWM3, align 4, !tbaa !14
  %620 = load i32, ptr @PWM4, align 4, !tbaa !14
  %621 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %607, ptr noundef @.str.56, i64 noundef %608, i64 noundef %609, double noundef %610, double noundef %611, double noundef %612, double noundef %613, double noundef %614, double noundef %615, double noundef %616, i32 noundef %617, i32 noundef %618, i32 noundef %619, i32 noundef %620) #10
  %622 = load ptr, ptr @control_log, align 8, !tbaa !5
  %623 = getelementptr inbounds [200 x i8], ptr %24, i64 0, i64 0
  %624 = load ptr, ptr @error_log, align 8, !tbaa !5
  call void @write_to_file_custom(ptr noundef %622, ptr noundef %623, ptr noundef %624)
  %625 = load i64, ptr @time_control, align 8, !tbaa !39
  %626 = load double, ptr @R1, align 8, !tbaa !59
  %627 = load double, ptr @R2, align 8, !tbaa !59
  %628 = load double, ptr @R3, align 8, !tbaa !59
  %629 = load double, ptr @R4, align 8, !tbaa !59
  %630 = load i32, ptr @PWM1, align 4, !tbaa !14
  %631 = load i32, ptr @PWM2, align 4, !tbaa !14
  %632 = load i32, ptr @PWM3, align 4, !tbaa !14
  %633 = load i32, ptr @PWM4, align 4, !tbaa !14
  %634 = call i32 (ptr, ...) @printf(ptr noundef @.str.57, i64 noundef %625, double noundef %626, double noundef %627, double noundef %628, double noundef %629, i32 noundef %630, i32 noundef %631, i32 noundef %632, i32 noundef %633)
  br label %635

635:                                              ; preds = %598
  %636 = load i64, ptr @time_loop, align 8, !tbaa !39
  %637 = load i64, ptr @ACTIVE__CONTROL_TIME, align 8, !tbaa !39
  %638 = icmp ule i64 %636, %637
  br i1 %638, label %433, label %639, !llvm.loop !60

639:                                              ; preds = %635
  call void @MSP430_UART_write_PWM(i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  %640 = call i32 (ptr, ...) @printf(ptr noundef @.str.58)
  %641 = load i64, ptr @DESCENT__TIME, align 8, !tbaa !39
  %642 = trunc i64 %641 to i32
  %643 = call i32 @usleep(i32 noundef %642)
  call void @llvm.lifetime.end.p0(i64 200, ptr %24) #10
  br label %652

644:                                              ; preds = %417
  %645 = load i64, ptr @ENGINE__BURN_TIME, align 8, !tbaa !39
  %646 = load i64, ptr @ACTIVE__CONTROL_TIME, align 8, !tbaa !39
  %647 = add i64 %645, %646
  %648 = load i64, ptr @DESCENT__TIME, align 8, !tbaa !39
  %649 = add i64 %647, %648
  %650 = trunc i64 %649 to i32
  %651 = call i32 @usleep(i32 noundef %650)
  br label %652

652:                                              ; preds = %644, %639
  %653 = call i32 (ptr, ...) @printf(ptr noundef @.str.59)
  %654 = load i8, ptr @flight_type, align 1, !tbaa !9
  %655 = sext i8 %654 to i32
  %656 = icmp eq i32 %655, 1
  br i1 %656, label %657, label %658

657:                                              ; preds = %652
  call void @MSP430_UART_write(ptr noundef @.str.45)
  br label %658

658:                                              ; preds = %657, %652
  store i8 1, ptr @SPI_quit, align 1, !tbaa !9
  %659 = load i64, ptr %3, align 8, !tbaa !41
  %660 = call i32 @pthread_join(i64 noundef %659, ptr noundef null)
  store i8 1, ptr @IMU_quit, align 1, !tbaa !9
  %661 = load i64, ptr %6, align 8, !tbaa !41
  %662 = call i32 @pthread_join(i64 noundef %661, ptr noundef null)
  %663 = load i64, ptr %22, align 8, !tbaa !41
  %664 = call i32 @pthread_join(i64 noundef %663, ptr noundef null)
  %665 = call i32 @pthread_mutex_destroy(ptr noundef @error_log_write_lock) #10
  call void @unmap_peripheral(ptr noundef @gpio)
  call void @stopVideo()
  %666 = load ptr, ptr @error_log, align 8, !tbaa !5
  %667 = call i32 @fclose(ptr noundef %666)
  %668 = load ptr, ptr @imu_log, align 8, !tbaa !5
  %669 = call i32 @fclose(ptr noundef %668)
  %670 = load ptr, ptr @pressure_log, align 8, !tbaa !5
  %671 = call i32 @fclose(ptr noundef %670)
  %672 = load ptr, ptr @control_log, align 8, !tbaa !5
  %673 = call i32 @fclose(ptr noundef %672)
  %674 = load i32, ptr @RAZOR_UART, align 4, !tbaa !14
  call void @reset_old_attr_port(i32 noundef %674, ptr noundef @old_razor_uart_options)
  %675 = load i32, ptr @RAZOR_UART, align 4, !tbaa !14
  call void @close_port(i32 noundef %675)
  %676 = call i32 (ptr, ...) @printf(ptr noundef @.str.60)
  call void @pthread_exit(ptr noundef null) #13
  unreachable
}

; Function Attrs: nounwind
declare i32 @gettimeofday(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind
declare i32 @pthread_mutex_init(ptr noundef, ptr noundef) #1

declare void @perror(ptr noundef) #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #3

declare i32 @printf(ptr noundef, ...) #2

declare void @open_error_file(ptr noundef, ptr noundef, ptr noundef) #2

declare void @open_file(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare void @stopVideo() #2

declare void @startVideo(ptr noundef, ptr noundef) #2

declare i32 @usleep(i32 noundef) #2

declare i32 @map_peripheral(ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

declare void @pressure_sensor_SPI_connect(ptr noundef, ptr noundef, i8 noundef zeroext, i8 noundef zeroext, i64 noundef) #2

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #1

declare void @Treat_reply(ptr noundef) #2

; Function Attrs: nounwind
declare i32 @pthread_create(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare ptr @get_readings_SPI_parallel(ptr noundef) #2

declare void @check_time(ptr noundef, i64, i64, i64, i64, ptr noundef) #2

declare void @passive_wait(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef) #2

declare void @Fpitch_loop_control_setup(...) #2

declare void @Fyaw_loop_control_setup(...) #2

declare void @Mroll_loop_control_setup(...) #2

declare void @open_serial_port(ptr noundef, ptr noundef) #2

declare i32 @fflush(ptr noundef) #2

declare void @get_old_attr(i32 noundef, ptr noundef) #2

declare void @set_to_blocking(i32 noundef) #2

declare void @set_new_attr(i32 noundef, ptr noundef, ptr noundef) #2

declare void @initMatrix(ptr dead_on_unwind writable sret(%struct.MATRIX) align 8, i64 noundef, i64 noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4

declare ptr @read_IMU_parallel(ptr noundef) #2

declare void @Calibrate_IMU(...) #2

declare void @construct_zeroed_DCM(...) #2

declare void @zero_Euler_angles(...) #2

declare float @TO_DEG(float noundef) #2

declare ptr @get_filtered_attitude_parallel(ptr noundef) #2

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #7

declare void @MSP430_UART_write(ptr noundef) #2

declare void @write_to_file_custom(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #8

; Function Attrs: nounwind
declare double @cos(double noundef) #1

; Function Attrs: nounwind
declare double @sin(double noundef) #1

declare void @simplx(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare void @get_simplex_solution(i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare void @search_PWM(double noundef, double noundef, double noundef, double noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare void @MSP430_UART_write_PWM(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

declare i32 @pthread_join(i64 noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i32 @pthread_mutex_destroy(ptr noundef) #1

declare void @unmap_peripheral(ptr noundef) #2

declare i32 @fclose(ptr noundef) #2

declare void @reset_old_attr_port(i32 noundef, ptr noundef) #2

declare void @close_port(i32 noundef) #2

; Function Attrs: noreturn
declare void @pthread_exit(ptr noundef) #9

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nounwind }
attributes #11 = { noreturn nounwind }
attributes #12 = { nounwind willreturn memory(read) }
attributes #13 = { noreturn }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 24}
!11 = !{!"bcm2835_peripheral", !12, i64 0, !13, i64 8, !6, i64 16, !6, i64 24}
!12 = !{!"long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!16, !7, i64 0}
!16 = !{!"SPI_data", !7, i64 0, !7, i64 1, !12, i64 8, !7, i64 16, !13, i64 20, !13, i64 24, !17, i64 28, !17, i64 32, !13, i64 36, !13, i64 40}
!17 = !{!"float", !7, i64 0}
!18 = !{!16, !7, i64 1}
!19 = !{!16, !12, i64 8}
!20 = !{!16, !7, i64 16}
!21 = !{!16, !13, i64 20}
!22 = !{!16, !13, i64 24}
!23 = !{!16, !17, i64 28}
!24 = !{!16, !17, i64 32}
!25 = !{!16, !13, i64 36}
!26 = !{!16, !13, i64 40}
!27 = !{!28, !29, i64 0}
!28 = !{!"spi_ioc_transfer", !29, i64 0, !29, i64 8, !13, i64 16, !13, i64 20, !30, i64 24, !7, i64 26, !7, i64 27, !7, i64 28, !7, i64 29, !7, i64 30, !7, i64 31}
!29 = !{!"long long", !7, i64 0}
!30 = !{!"short", !7, i64 0}
!31 = !{!28, !29, i64 8}
!32 = !{!28, !13, i64 16}
!33 = !{!28, !13, i64 20}
!34 = !{!28, !7, i64 26}
!35 = !{!28, !30, i64 24}
!36 = !{!28, !7, i64 27}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!29, !29, i64 0}
!40 = !{!17, !17, i64 0}
!41 = !{!12, !12, i64 0}
!42 = distinct !{!42, !38}
!43 = !{!44, !13, i64 0}
!44 = !{!"termios", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !7, i64 16, !7, i64 17, !13, i64 52, !13, i64 56}
!45 = !{!44, !13, i64 4}
!46 = !{!44, !13, i64 8}
!47 = !{!44, !13, i64 12}
!48 = !{i64 0, i64 8, !41, i64 8, i64 8, !41, i64 16, i64 8, !5}
!49 = distinct !{!49, !38}
!50 = !{!51, !6, i64 16}
!51 = !{!"MATRIX", !12, i64 0, !12, i64 8, !6, i64 16}
!52 = distinct !{!52, !38}
!53 = distinct !{!53, !38}
!54 = distinct !{!54, !38}
!55 = !{!56, !57, i64 0}
!56 = !{!"Control_loop", !57, i64 0, !57, i64 8, !57, i64 16, !57, i64 24}
!57 = !{!"double", !7, i64 0}
!58 = !{!56, !57, i64 8}
!59 = !{!57, !57, i64 0}
!60 = distinct !{!60, !38}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.bcm2835_peripheral = type { i64, i32, ptr, ptr }
%struct.timeval = type { i64, i64 }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct.SPI_data = type { i8, i8, i64, i8, i32, i32, float, float, i32, i32 }
%struct.spi_ioc_transfer = type { i64, i64, i32, i32, i16, i8, i8, i8, i8, i8, i8 }
%struct.termios = type { i32, i32, i32, i32, i8, [32 x i8], i32, i32 }
%struct.MATRIX = type { i64, i64, ptr }
%struct.Control_loop = type { double, double, double, double }

@ENGINE__BURN_TIME = external dso_local local_unnamed_addr global i64, align 8
@ACTIVE__CONTROL_TIME = external dso_local local_unnamed_addr global i64, align 8
@DESCENT__TIME = external dso_local local_unnamed_addr global i64, align 8
@CONTROL__TIME_STEP = external dso_local local_unnamed_addr global i64, align 8
@SPI__READ_TIMESTEP = external dso_local local_unnamed_addr global i64, align 8
@IMU__READ_TIMESTEP = external dso_local local_unnamed_addr global i64, align 8
@CALIB__TIME = external dso_local local_unnamed_addr global i64, align 8
@SPI_quit = external dso_local local_unnamed_addr global i8, align 1
@IMU_quit = external dso_local local_unnamed_addr global i8, align 1
@PWM1 = external dso_local global i32, align 4
@PWM2 = external dso_local global i32, align 4
@PWM3 = external dso_local global i32, align 4
@PWM4 = external dso_local global i32, align 4
@R1 = external dso_local global double, align 8
@R2 = external dso_local global double, align 8
@R3 = external dso_local global double, align 8
@R4 = external dso_local global double, align 8
@d = external dso_local local_unnamed_addr global double, align 8
@Fpitch = external dso_local local_unnamed_addr global double, align 8
@Fyaw = external dso_local local_unnamed_addr global double, align 8
@Mroll = external dso_local local_unnamed_addr global double, align 8
@N = external dso_local local_unnamed_addr global i32, align 4
@M1 = external dso_local local_unnamed_addr global i32, align 4
@M2 = external dso_local local_unnamed_addr global i32, align 4
@M3 = external dso_local local_unnamed_addr global i32, align 4
@M = external dso_local local_unnamed_addr global i32, align 4
@psi_cont = external dso_local local_unnamed_addr global float, align 4
@psidot_cont = external dso_local local_unnamed_addr global float, align 4
@theta_cont = external dso_local local_unnamed_addr global float, align 4
@thetadot_cont = external dso_local local_unnamed_addr global float, align 4
@phi_cont = external dso_local local_unnamed_addr global float, align 4
@wx_cont = external dso_local local_unnamed_addr global float, align 4
@psi_ref = external dso_local local_unnamed_addr global float, align 4
@theta_ref = external dso_local local_unnamed_addr global float, align 4
@wx_ref = external dso_local local_unnamed_addr global float, align 4
@flight_type = external dso_local local_unnamed_addr global i8, align 1
@error_log = external dso_local global ptr, align 8
@pressure_log = external dso_local global ptr, align 8
@imu_log = external dso_local global ptr, align 8
@control_log = external dso_local global ptr, align 8
@gpio = external dso_local global %struct.bcm2835_peripheral, align 8
@launch_detect_gpio = external dso_local local_unnamed_addr global i8, align 1
@GLOBAL__TIME_STARTPOINT = external dso_local global %struct.timeval, align 8
@error_log_write_lock = external dso_local global %union.pthread_mutex_t, align 8
@.str = external hidden unnamed_addr constant [44 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [74 x i8], align 1
@SPI_config = external dso_local global %struct.SPI_data, align 8
@data = external dso_local global [4 x i8], align 1
@transfer = external dso_local local_unnamed_addr global [4 x %struct.spi_ioc_transfer], align 16
@.str.13 = external hidden unnamed_addr constant [36 x i8], align 1
@RADIAL_SENSOR = external constant [0 x i8], align 1
@AXIAL_SENSOR = external constant [0 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [12 x i8], align 1
@MESSAGE = external dso_local global [700 x i8], align 16
@.str.15 = external hidden unnamed_addr constant [125 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [45 x i8], align 1
@before_loop = external dso_local global %struct.timeval, align 8
@before_control = external dso_local global %struct.timeval, align 8
@now_loop = external dso_local global %struct.timeval, align 8
@elapsed_loop = external dso_local local_unnamed_addr global %struct.timeval, align 8
@time_loop = external dso_local global i64, align 8
@now_control = external dso_local global %struct.timeval, align 8
@elapsed_control = external dso_local global %struct.timeval, align 8
@time_control = external dso_local global i64, align 8
@.str.19 = external hidden unnamed_addr constant [103 x i8], align 1
@radial_status = external dso_local local_unnamed_addr global i8, align 1
@radial_pressure = external dso_local local_unnamed_addr global float, align 4
@radial_temperature = external dso_local local_unnamed_addr global float, align 4
@axial_status = external dso_local local_unnamed_addr global i8, align 1
@axial_pressure = external dso_local local_unnamed_addr global float, align 4
@axial_temperature = external dso_local local_unnamed_addr global float, align 4
@.str.20 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [8 x i8], align 1
@new_razor_uart_options = external dso_local global %struct.termios, align 4
@.str.24 = external hidden unnamed_addr constant [38 x i8], align 1
@RAZOR_UART = external dso_local global i32, align 4
@.str.25 = external hidden unnamed_addr constant [13 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@old_razor_uart_options = external dso_local global %struct.termios, align 4
@R_MATRIX = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@DCM_MATRIX = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@.str.26 = external hidden unnamed_addr constant [37 x i8], align 1
@psi_save = external dso_local local_unnamed_addr global float, align 4
@psi_save_last = external local_unnamed_addr global float, align 4
@theta_save = external dso_local local_unnamed_addr global float, align 4
@theta_save_last = external local_unnamed_addr global float, align 4
@phi_save = external dso_local local_unnamed_addr global float, align 4
@phi_save_last = external local_unnamed_addr global float, align 4
@.str.27 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [7 x i8], align 1
@P_psi = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@P_psidot = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@x_psi = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@x_psidot = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@Q_psi = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@Q_psidot = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@R_psi = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@R_psidot = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@P_theta = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@x_theta = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@Q_theta = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@R_theta = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@P_thetadot = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@x_thetadot = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@Q_thetadot = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@R_thetadot = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@P_phi = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@x_phi = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@Q_phi = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@R_phi = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@P_phidot = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@x_phidot = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@Q_phidot = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@R_phidot = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@EYE2 = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@A_kalman = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@C_kalman = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@z_temp = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@inn = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@S = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@K = external dso_local local_unnamed_addr global %struct.MATRIX, align 8
@.str.32 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [128 x i8], align 1
@dt = external local_unnamed_addr global float, align 4
@psi_filt = external dso_local local_unnamed_addr global float, align 4
@psi_dot_filt = external dso_local local_unnamed_addr global float, align 4
@theta_filt = external dso_local local_unnamed_addr global float, align 4
@theta_dot_filt = external dso_local local_unnamed_addr global float, align 4
@phi_filt = external dso_local local_unnamed_addr global float, align 4
@phi_dot_filt = external dso_local local_unnamed_addr global float, align 4
@.str.35 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [93 x i8], align 1
@reply = external dso_local global [30 x i8], align 16
@.str.39 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [42 x i8], align 1
@new_msp430_uart_options = external dso_local global %struct.termios, align 4
@.str.42 = external hidden unnamed_addr constant [35 x i8], align 1
@MSP430_UART = external dso_local global i32, align 4
@.str.43 = external hidden unnamed_addr constant [13 x i8], align 1
@old_msp430_uart_options = external dso_local global %struct.termios, align 4
@.str.44 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [106 x i8], align 1
@now_control_glob = external dso_local global %struct.timeval, align 8
@elapsed_control_glob = external dso_local local_unnamed_addr global %struct.timeval, align 8
@time_control_glob = external dso_local global i64, align 8
@wx = external dso_local local_unnamed_addr global float, align 4
@Fpitch_loop = external dso_local local_unnamed_addr global %struct.Control_loop, align 8
@Fyaw_loop = external dso_local local_unnamed_addr global %struct.Control_loop, align 8
@Mroll_loop = external dso_local local_unnamed_addr global %struct.Control_loop, align 8
@A = external dso_local global [5 x [6 x double]], align 16
@ICASE = external dso_local global i32, align 4
@IZROV = external dso_local global [6 x i32], align 16
@IPOSV = external dso_local global [5 x i32], align 16
@VALVE__MAX_THRUST = external local_unnamed_addr global double, align 8
@.str.56 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [37 x i8], align 1

; Function Attrs: noreturn nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca %struct.MATRIX, align 8
  %3 = alloca %struct.MATRIX, align 8
  %4 = alloca i64, align 8
  %5 = alloca %struct.MATRIX, align 8
  %6 = alloca %struct.MATRIX, align 8
  %7 = alloca %struct.MATRIX, align 8
  %8 = alloca %struct.MATRIX, align 8
  %9 = alloca %struct.MATRIX, align 8
  %10 = alloca %struct.MATRIX, align 8
  %11 = alloca %struct.MATRIX, align 8
  %12 = alloca %struct.MATRIX, align 8
  %13 = alloca %struct.MATRIX, align 8
  %14 = alloca %struct.MATRIX, align 8
  %15 = alloca %struct.MATRIX, align 8
  %16 = alloca %struct.MATRIX, align 8
  %17 = alloca %struct.MATRIX, align 8
  %18 = alloca %struct.MATRIX, align 8
  %19 = alloca %struct.MATRIX, align 8
  %20 = alloca i64, align 8
  %21 = alloca [200 x i8], align 16
  %22 = tail call i32 @gettimeofday(ptr noundef nonnull @GLOBAL__TIME_STARTPOINT, ptr noundef null) #12
  %23 = tail call i32 @pthread_mutex_init(ptr noundef nonnull @error_log_write_lock, ptr noundef null) #12
  %.not = icmp eq i32 %23, 0
  br i1 %.not, label %25, label %24

24:                                               ; preds = %0
  tail call void @perror(ptr noundef nonnull @.str) #13
  tail call void @exit(i32 noundef -2) #14
  unreachable

25:                                               ; preds = %0
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  tail call void @open_error_file(ptr noundef nonnull @error_log, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3) #12
  %27 = load ptr, ptr @error_log, align 8, !tbaa !5
  tail call void @open_file(ptr noundef nonnull @pressure_log, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3, ptr noundef %27) #12
  %28 = load ptr, ptr @error_log, align 8, !tbaa !5
  tail call void @open_file(ptr noundef nonnull @imu_log, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, ptr noundef %28) #12
  %29 = load ptr, ptr @error_log, align 8, !tbaa !5
  tail call void @open_file(ptr noundef nonnull @control_log, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.3, ptr noundef %29) #12
  %30 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  tail call void @stopVideo() #12
  %31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  tail call void @startVideo(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.10) #12
  %32 = tail call i32 @usleep(i32 noundef 1000000) #12
  %33 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  %34 = tail call i32 @map_peripheral(ptr noundef nonnull @gpio) #12
  %35 = icmp eq i32 %34, -1
  br i1 %35, label %36, label %38

36:                                               ; preds = %25
  %37 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12)
  tail call void @stopVideo() #12
  tail call void @exit(i32 noundef -2) #14
  unreachable

38:                                               ; preds = %25
  %39 = load i8, ptr @launch_detect_gpio, align 1, !tbaa !9
  %40 = urem i8 %39, 10
  %narrow = mul nuw nsw i8 %40, 3
  %41 = zext nneg i8 %narrow to i32
  %42 = shl nuw nsw i32 7, %41
  %43 = xor i32 %42, -1
  %44 = load ptr, ptr getelementptr inbounds (i8, ptr @gpio, i64 24), align 8, !tbaa !10
  %45 = udiv i8 %39, 10
  %46 = zext nneg i8 %45 to i64
  %47 = getelementptr inbounds i32, ptr %44, i64 %46
  %48 = load volatile i32, ptr %47, align 4, !tbaa !14
  %49 = and i32 %48, %43
  store volatile i32 %49, ptr %47, align 4, !tbaa !14
  store i8 0, ptr @SPI_config, align 8, !tbaa !15
  store i8 8, ptr getelementptr inbounds (i8, ptr @SPI_config, i64 1), align 1, !tbaa !18
  store i64 800000, ptr getelementptr inbounds (i8, ptr @SPI_config, i64 8), align 8, !tbaa !19
  store i8 4, ptr getelementptr inbounds (i8, ptr @SPI_config, i64 16), align 8, !tbaa !20
  store i32 14745, ptr getelementptr inbounds (i8, ptr @SPI_config, i64 20), align 4, !tbaa !21
  store i32 1638, ptr getelementptr inbounds (i8, ptr @SPI_config, i64 24), align 8, !tbaa !22
  store <2 x float> <float 1.000000e+02, float -1.000000e+02>, ptr getelementptr inbounds (i8, ptr @SPI_config, i64 28), align 4, !tbaa !23
  store i32 0, ptr getelementptr inbounds (i8, ptr @SPI_config, i64 36), align 4, !tbaa !24
  store i32 0, ptr getelementptr inbounds (i8, ptr @SPI_config, i64 40), align 8, !tbaa !25
  store i32 0, ptr @data, align 1
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) getelementptr inbounds (i8, ptr @transfer, i64 16), i8 0, i64 16, i1 false)
  store i64 ptrtoint (ptr @data to i64), ptr @transfer, align 16, !tbaa !26
  store i64 ptrtoint (ptr @data to i64), ptr getelementptr inbounds (i8, ptr @transfer, i64 8), align 8, !tbaa !30
  store i32 1, ptr getelementptr inbounds (i8, ptr @transfer, i64 16), align 16, !tbaa !31
  store i32 800000, ptr getelementptr inbounds (i8, ptr @transfer, i64 20), align 4, !tbaa !32
  store i8 8, ptr getelementptr inbounds (i8, ptr @transfer, i64 26), align 2, !tbaa !33
  store i16 100, ptr getelementptr inbounds (i8, ptr @transfer, i64 24), align 8, !tbaa !34
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) getelementptr inbounds (i8, ptr @transfer, i64 48), i8 0, i64 16, i1 false)
  store i64 ptrtoint (ptr getelementptr inbounds (i8, ptr @data, i64 1) to i64), ptr getelementptr inbounds (i8, ptr @transfer, i64 32), align 16, !tbaa !26
  store i64 ptrtoint (ptr getelementptr inbounds (i8, ptr @data, i64 1) to i64), ptr getelementptr inbounds (i8, ptr @transfer, i64 40), align 8, !tbaa !30
  store i32 1, ptr getelementptr inbounds (i8, ptr @transfer, i64 48), align 16, !tbaa !31
  store i32 800000, ptr getelementptr inbounds (i8, ptr @transfer, i64 52), align 4, !tbaa !32
  store i8 8, ptr getelementptr inbounds (i8, ptr @transfer, i64 58), align 2, !tbaa !33
  store i16 100, ptr getelementptr inbounds (i8, ptr @transfer, i64 56), align 8, !tbaa !34
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) getelementptr inbounds (i8, ptr @transfer, i64 80), i8 0, i64 16, i1 false)
  store i64 ptrtoint (ptr getelementptr inbounds (i8, ptr @data, i64 2) to i64), ptr getelementptr inbounds (i8, ptr @transfer, i64 64), align 16, !tbaa !26
  store i64 ptrtoint (ptr getelementptr inbounds (i8, ptr @data, i64 2) to i64), ptr getelementptr inbounds (i8, ptr @transfer, i64 72), align 8, !tbaa !30
  store i32 1, ptr getelementptr inbounds (i8, ptr @transfer, i64 80), align 16, !tbaa !31
  store i32 800000, ptr getelementptr inbounds (i8, ptr @transfer, i64 84), align 4, !tbaa !32
  store i8 8, ptr getelementptr inbounds (i8, ptr @transfer, i64 90), align 2, !tbaa !33
  store i16 100, ptr getelementptr inbounds (i8, ptr @transfer, i64 88), align 8, !tbaa !34
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) getelementptr inbounds (i8, ptr @transfer, i64 112), i8 0, i64 16, i1 false)
  store i64 ptrtoint (ptr getelementptr inbounds (i8, ptr @data, i64 3) to i64), ptr getelementptr inbounds (i8, ptr @transfer, i64 96), align 16, !tbaa !26
  store i64 ptrtoint (ptr getelementptr inbounds (i8, ptr @data, i64 3) to i64), ptr getelementptr inbounds (i8, ptr @transfer, i64 104), align 8, !tbaa !30
  store i32 1, ptr getelementptr inbounds (i8, ptr @transfer, i64 112), align 16, !tbaa !31
  store i32 800000, ptr getelementptr inbounds (i8, ptr @transfer, i64 116), align 4, !tbaa !32
  store i8 8, ptr getelementptr inbounds (i8, ptr @transfer, i64 122), align 2, !tbaa !33
  store i16 100, ptr getelementptr inbounds (i8, ptr @transfer, i64 120), align 8, !tbaa !34
  %50 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %51 = load i8, ptr @SPI_config, align 8, !tbaa !15
  %52 = load i8, ptr getelementptr inbounds (i8, ptr @SPI_config, i64 1), align 1, !tbaa !18
  %53 = load i64, ptr getelementptr inbounds (i8, ptr @SPI_config, i64 8), align 8, !tbaa !19
  tail call void @pressure_sensor_SPI_connect(ptr noundef nonnull @RADIAL_SENSOR, ptr noundef nonnull getelementptr inbounds (i8, ptr @SPI_config, i64 36), i8 noundef zeroext %51, i8 noundef zeroext %52, i64 noundef %53) #12
  %54 = load i8, ptr @SPI_config, align 8, !tbaa !15
  %55 = load i8, ptr getelementptr inbounds (i8, ptr @SPI_config, i64 1), align 1, !tbaa !18
  %56 = load i64, ptr getelementptr inbounds (i8, ptr @SPI_config, i64 8), align 8, !tbaa !19
  tail call void @pressure_sensor_SPI_connect(ptr noundef nonnull @AXIAL_SENSOR, ptr noundef nonnull getelementptr inbounds (i8, ptr @SPI_config, i64 40), i8 noundef zeroext %54, i8 noundef zeroext %55, i64 noundef %56) #12
  %57 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14)
  %58 = load i8, ptr @SPI_config, align 8, !tbaa !15
  %59 = zext i8 %58 to i32
  %60 = load i8, ptr getelementptr inbounds (i8, ptr @SPI_config, i64 1), align 1, !tbaa !18
  %61 = zext i8 %60 to i32
  %62 = load i64, ptr getelementptr inbounds (i8, ptr @SPI_config, i64 8), align 8, !tbaa !19
  %63 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) @MESSAGE, ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef %59, i32 noundef %61, i64 noundef %62) #12
  %64 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @MESSAGE)
  %65 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16)
  tail call void @Treat_reply(ptr noundef nonnull @.str.17) #12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #12
  %66 = call i32 @pthread_create(ptr noundef nonnull %1, ptr noundef null, ptr noundef nonnull @get_readings_SPI_parallel, ptr noundef nonnull @SPI_config) #12
  %.not25 = icmp eq i32 %66, 0
  br i1 %.not25, label %68, label %67

67:                                               ; preds = %38
  call void @perror(ptr noundef nonnull @.str.18) #13
  call void @stopVideo() #12
  call void @exit(i32 noundef -2) #14
  unreachable

68:                                               ; preds = %38
  %69 = call i32 @gettimeofday(ptr noundef nonnull @before_loop, ptr noundef null) #12
  %70 = call i32 @gettimeofday(ptr noundef nonnull @before_control, ptr noundef null) #12
  br label %71

71:                                               ; preds = %71, %68
  %72 = load i64, ptr @before_loop, align 8
  %73 = load i64, ptr getelementptr inbounds (i8, ptr @before_loop, i64 8), align 8
  %74 = load i64, ptr @elapsed_loop, align 8
  %75 = load i64, ptr getelementptr inbounds (i8, ptr @elapsed_loop, i64 8), align 8
  call void @check_time(ptr noundef nonnull @now_loop, i64 %72, i64 %73, i64 %74, i64 %75, ptr noundef nonnull @time_loop) #12
  %76 = load i64, ptr @SPI__READ_TIMESTEP, align 8, !tbaa !35
  call void @passive_wait(ptr noundef nonnull @now_control, ptr noundef nonnull @before_control, ptr noundef nonnull @elapsed_control, ptr noundef nonnull @time_control, i64 noundef %76) #12
  %77 = load i8, ptr @radial_status, align 1, !tbaa !9
  %78 = zext i8 %77 to i32
  %79 = load float, ptr @radial_pressure, align 4, !tbaa !23
  %80 = fpext float %79 to double
  %81 = load float, ptr @radial_temperature, align 4, !tbaa !23
  %82 = fpext float %81 to double
  %83 = load i8, ptr @axial_status, align 1, !tbaa !9
  %84 = sext i8 %83 to i32
  %85 = load float, ptr @axial_pressure, align 4, !tbaa !23
  %86 = fpext float %85 to double
  %87 = load float, ptr @axial_temperature, align 4, !tbaa !23
  %88 = fpext float %87 to double
  %89 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, i32 noundef %78, double noundef %80, double noundef %82, i32 noundef %84, double noundef %86, double noundef %88)
  %90 = load i64, ptr @time_loop, align 8, !tbaa !35
  %91 = load i64, ptr @CALIB__TIME, align 8, !tbaa !36
  %.not26 = icmp ugt i64 %90, %91
  br i1 %.not26, label %92, label %71, !llvm.loop !37

92:                                               ; preds = %71
  %93 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20)
  call void @Treat_reply(ptr noundef nonnull @.str.21) #12
  %94 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22)
  call void (...) @Fpitch_loop_control_setup() #12
  call void (...) @Fyaw_loop_control_setup() #12
  call void (...) @Mroll_loop_control_setup() #12
  %95 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(60) @new_razor_uart_options, i8 0, i64 60, i1 false)
  store i32 6321, ptr getelementptr inbounds (i8, ptr @new_razor_uart_options, i64 8), align 4, !tbaa !39
  store i8 0, ptr getelementptr inbounds (i8, ptr @new_razor_uart_options, i64 23), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @new_razor_uart_options, i64 22), align 2, !tbaa !9
  %96 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24)
  call void @open_serial_port(ptr noundef nonnull @RAZOR_UART, ptr noundef nonnull @.str.25) #12
  %97 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %98 = load ptr, ptr @stdout, align 8, !tbaa !5
  %99 = call i32 @fflush(ptr noundef %98)
  %100 = load i32, ptr @RAZOR_UART, align 4, !tbaa !14
  call void @get_old_attr(i32 noundef %100, ptr noundef nonnull @old_razor_uart_options) #12
  %101 = load i32, ptr @RAZOR_UART, align 4, !tbaa !14
  call void @set_to_blocking(i32 noundef %101) #12
  %102 = load i32, ptr @RAZOR_UART, align 4, !tbaa !14
  call void @set_new_attr(i32 noundef %102, ptr noundef nonnull @old_razor_uart_options, ptr noundef nonnull @new_razor_uart_options) #12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #12
  call void @initMatrix(ptr dead_on_unwind nonnull writable sret(%struct.MATRIX) align 8 %2, i64 noundef 3, i64 noundef 3) #12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @R_MATRIX, ptr noundef nonnull align 8 dereferenceable(24) %2, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #12
  call void @initMatrix(ptr dead_on_unwind nonnull writable sret(%struct.MATRIX) align 8 %3, i64 noundef 3, i64 noundef 3) #12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @DCM_MATRIX, ptr noundef nonnull align 8 dereferenceable(24) %3, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #12
  %103 = call i32 @pthread_create(ptr noundef nonnull %4, ptr noundef null, ptr noundef nonnull @read_IMU_parallel, ptr noundef null) #12
  %.not27 = icmp eq i32 %103, 0
  br i1 %.not27, label %thread-pre-split, label %104

104:                                              ; preds = %92
  call void @perror(ptr noundef nonnull @.str.26) #13
  call void @stopVideo() #12
  call void @exit(i32 noundef -2) #14
  unreachable

thread-pre-split:                                 ; preds = %92
  %105 = load i64, ptr @IMU__READ_TIMESTEP, align 8, !tbaa !35
  %106 = trunc i64 %105 to i32
  %107 = call i32 @usleep(i32 noundef %106) #12
  call void (...) @Calibrate_IMU() #12
  call void (...) @construct_zeroed_DCM() #12
  call void (...) @zero_Euler_angles() #12
  %108 = load float, ptr @psi_save, align 4, !tbaa !23
  store float %108, ptr @psi_save_last, align 4, !tbaa !23
  %109 = load float, ptr @theta_save, align 4, !tbaa !23
  store float %109, ptr @theta_save_last, align 4, !tbaa !23
  %110 = load float, ptr @phi_save, align 4, !tbaa !23
  store float %110, ptr @phi_save_last, align 4, !tbaa !23
  %111 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27)
  %112 = load float, ptr @psi_save, align 4, !tbaa !23
  %113 = call float @TO_DEG(float noundef %112) #12
  %114 = fpext float %113 to double
  %115 = load float, ptr @theta_save, align 4, !tbaa !23
  %116 = call float @TO_DEG(float noundef %115) #12
  %117 = fpext float %116 to double
  %118 = load float, ptr @phi_save, align 4, !tbaa !23
  %119 = call float @TO_DEG(float noundef %118) #12
  %120 = fpext float %119 to double
  %121 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) @MESSAGE, ptr noundef nonnull dereferenceable(1) @.str.28, double noundef %114, double noundef %117, double noundef %120) #12
  %122 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29, ptr noundef nonnull @MESSAGE)
  %123 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.30)
  call void @Treat_reply(ptr noundef nonnull @.str.31) #12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #12
  call void @initMatrix(ptr dead_on_unwind nonnull writable sret(%struct.MATRIX) align 8 %5, i64 noundef 2, i64 noundef 2) #12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @P_psi, ptr noundef nonnull align 8 dereferenceable(24) %5, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #12
  call void @initMatrix(ptr dead_on_unwind nonnull writable sret(%struct.MATRIX) align 8 %6, i64 noundef 2, i64 noundef 2) #12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @P_psidot, ptr noundef nonnull align 8 dereferenceable(24) %6, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #12
  call void @initMatrix(ptr dead_on_unwind nonnull writable sret(%struct.MATRIX) align 8 %7, i64 noundef 2, i64 noundef 1) #12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @x_psi, ptr noundef nonnull align 8 dereferenceable(24) %7, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #12
  call void @initMatrix(ptr dead_on_unwind nonnull writable sret(%struct.MATRIX) align 8 %8, i64 noundef 2, i64 noundef 1) #12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @x_psidot, ptr noundef nonnull align 8 dereferenceable(24) %8, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #12
  call void @initMatrix(ptr dead_on_unwind nonnull writable sret(%struct.MATRIX) align 8 %9, i64 noundef 2, i64 noundef 2) #12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @Q_psi, ptr noundef nonnull align 8 dereferenceable(24) %9, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #12
  call void @initMatrix(ptr dead_on_unwind nonnull writable sret(%struct.MATRIX) align 8 %10, i64 noundef 2, i64 noundef 2) #12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @Q_psidot, ptr noundef nonnull align 8 dereferenceable(24) %10, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #12
  call void @initMatrix(ptr dead_on_unwind nonnull writable sret(%struct.MATRIX) align 8 %11, i64 noundef 1, i64 noundef 1) #12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @R_psi, ptr noundef nonnull align 8 dereferenceable(24) %11, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #12
  call void @initMatrix(ptr dead_on_unwind nonnull writable sret(%struct.MATRIX) align 8 %12, i64 noundef 1, i64 noundef 1) #12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @R_psidot, ptr noundef nonnull align 8 dereferenceable(24) %12, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #12
  %124 = load ptr, ptr getelementptr inbounds (i8, ptr @P_psi, i64 16), align 8, !tbaa !42
  %125 = load ptr, ptr %124, align 8, !tbaa !5
  store <2 x float> <float 1.000000e+00, float 0.000000e+00>, ptr %125, align 4, !tbaa !23
  %126 = getelementptr inbounds i8, ptr %124, i64 8
  %127 = load ptr, ptr %126, align 8, !tbaa !5
  %128 = getelementptr inbounds i8, ptr %127, i64 4
  store float 1.000000e+00, ptr %128, align 4, !tbaa !23
  %129 = load ptr, ptr getelementptr inbounds (i8, ptr @P_psidot, i64 16), align 8, !tbaa !42
  %130 = load ptr, ptr %129, align 8, !tbaa !5
  store <2 x float> <float 1.000000e+00, float 0.000000e+00>, ptr %130, align 4, !tbaa !23
  %131 = getelementptr inbounds i8, ptr %129, i64 8
  %132 = load ptr, ptr %131, align 8, !tbaa !5
  %133 = getelementptr inbounds i8, ptr %132, i64 4
  store float 1.000000e+00, ptr %133, align 4, !tbaa !23
  %134 = load ptr, ptr getelementptr inbounds (i8, ptr @x_psi, i64 16), align 8, !tbaa !42
  %135 = load ptr, ptr %134, align 8, !tbaa !5
  store float 0.000000e+00, ptr %135, align 4, !tbaa !23
  %136 = getelementptr inbounds i8, ptr %134, i64 8
  %137 = load ptr, ptr %136, align 8, !tbaa !5
  store float 0.000000e+00, ptr %137, align 4, !tbaa !23
  %138 = load ptr, ptr getelementptr inbounds (i8, ptr @x_psidot, i64 16), align 8, !tbaa !42
  %139 = load ptr, ptr %138, align 8, !tbaa !5
  store float 0.000000e+00, ptr %139, align 4, !tbaa !23
  %140 = getelementptr inbounds i8, ptr %138, i64 8
  %141 = load ptr, ptr %140, align 8, !tbaa !5
  store float 0.000000e+00, ptr %141, align 4, !tbaa !23
  %142 = load ptr, ptr getelementptr inbounds (i8, ptr @Q_psi, i64 16), align 8, !tbaa !42
  %143 = load ptr, ptr %142, align 8, !tbaa !5
  store <2 x float> <float 0x3F847AE140000000, float 0.000000e+00>, ptr %143, align 4, !tbaa !23
  %144 = getelementptr inbounds i8, ptr %142, i64 8
  %145 = load ptr, ptr %144, align 8, !tbaa !5
  %146 = getelementptr inbounds i8, ptr %145, i64 4
  store float 1.000000e+02, ptr %146, align 4, !tbaa !23
  %147 = load ptr, ptr getelementptr inbounds (i8, ptr @Q_psidot, i64 16), align 8, !tbaa !42
  %148 = load ptr, ptr %147, align 8, !tbaa !5
  store <2 x float> <float 2.000000e+02, float 0.000000e+00>, ptr %148, align 4, !tbaa !23
  %149 = getelementptr inbounds i8, ptr %147, i64 8
  %150 = load ptr, ptr %149, align 8, !tbaa !5
  %151 = getelementptr inbounds i8, ptr %150, i64 4
  store float 2.000000e+02, ptr %151, align 4, !tbaa !23
  %152 = load ptr, ptr getelementptr inbounds (i8, ptr @R_psi, i64 16), align 8, !tbaa !42
  %153 = load ptr, ptr %152, align 8, !tbaa !5
  store float 1.000000e+01, ptr %153, align 4, !tbaa !23
  %154 = load ptr, ptr getelementptr inbounds (i8, ptr @R_psidot, i64 16), align 8, !tbaa !42
  %155 = load ptr, ptr %154, align 8, !tbaa !5
  store float 5.000000e+03, ptr %155, align 4, !tbaa !23
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @P_theta, ptr noundef nonnull align 8 dereferenceable(24) @P_psi, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @x_theta, ptr noundef nonnull align 8 dereferenceable(24) @x_psi, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @Q_theta, ptr noundef nonnull align 8 dereferenceable(24) @Q_psi, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @R_theta, ptr noundef nonnull align 8 dereferenceable(24) @R_psi, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @P_thetadot, ptr noundef nonnull align 8 dereferenceable(24) @P_psidot, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @x_thetadot, ptr noundef nonnull align 8 dereferenceable(24) @x_psidot, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @Q_thetadot, ptr noundef nonnull align 8 dereferenceable(24) @Q_psidot, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @R_thetadot, ptr noundef nonnull align 8 dereferenceable(24) @R_psidot, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @P_phi, ptr noundef nonnull align 8 dereferenceable(24) @P_psi, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @x_phi, ptr noundef nonnull align 8 dereferenceable(24) @x_psi, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @Q_phi, ptr noundef nonnull align 8 dereferenceable(24) @Q_psi, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @R_phi, ptr noundef nonnull align 8 dereferenceable(24) @R_psi, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @P_phidot, ptr noundef nonnull align 8 dereferenceable(24) @P_psidot, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @x_phidot, ptr noundef nonnull align 8 dereferenceable(24) @x_psidot, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @Q_phidot, ptr noundef nonnull align 8 dereferenceable(24) @Q_psidot, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @R_phidot, ptr noundef nonnull align 8 dereferenceable(24) @R_psidot, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #12
  call void @initMatrix(ptr dead_on_unwind nonnull writable sret(%struct.MATRIX) align 8 %13, i64 noundef 2, i64 noundef 2) #12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @EYE2, ptr noundef nonnull align 8 dereferenceable(24) %13, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #12
  %156 = load ptr, ptr getelementptr inbounds (i8, ptr @EYE2, i64 16), align 8, !tbaa !42
  %157 = load ptr, ptr %156, align 8, !tbaa !5
  store <2 x float> <float 1.000000e+00, float 0.000000e+00>, ptr %157, align 4, !tbaa !23
  %158 = getelementptr inbounds i8, ptr %156, i64 8
  %159 = load ptr, ptr %158, align 8, !tbaa !5
  store <2 x float> <float 0.000000e+00, float 1.000000e+00>, ptr %159, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #12
  call void @initMatrix(ptr dead_on_unwind nonnull writable sret(%struct.MATRIX) align 8 %14, i64 noundef 2, i64 noundef 2) #12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @A_kalman, ptr noundef nonnull align 8 dereferenceable(24) %14, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %15) #12
  call void @initMatrix(ptr dead_on_unwind nonnull writable sret(%struct.MATRIX) align 8 %15, i64 noundef 1, i64 noundef 2) #12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @C_kalman, ptr noundef nonnull align 8 dereferenceable(24) %15, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #12
  call void @initMatrix(ptr dead_on_unwind nonnull writable sret(%struct.MATRIX) align 8 %16, i64 noundef 1, i64 noundef 1) #12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @z_temp, ptr noundef nonnull align 8 dereferenceable(24) %16, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %17) #12
  call void @initMatrix(ptr dead_on_unwind nonnull writable sret(%struct.MATRIX) align 8 %17, i64 noundef 1, i64 noundef 1) #12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @inn, ptr noundef nonnull align 8 dereferenceable(24) %17, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %18) #12
  call void @initMatrix(ptr dead_on_unwind nonnull writable sret(%struct.MATRIX) align 8 %18, i64 noundef 1, i64 noundef 1) #12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @S, ptr noundef nonnull align 8 dereferenceable(24) %18, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %19) #12
  call void @initMatrix(ptr dead_on_unwind nonnull writable sret(%struct.MATRIX) align 8 %19, i64 noundef 2, i64 noundef 1) #12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) @K, ptr noundef nonnull align 8 dereferenceable(24) %19, i64 24, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %19) #12
  %160 = load ptr, ptr getelementptr inbounds (i8, ptr @A_kalman, i64 16), align 8, !tbaa !42
  %161 = load ptr, ptr %160, align 8, !tbaa !5
  store float 1.000000e+00, ptr %161, align 4, !tbaa !23
  %162 = getelementptr inbounds i8, ptr %160, i64 8
  %163 = load ptr, ptr %162, align 8, !tbaa !5
  store <2 x float> <float 0.000000e+00, float 1.000000e+00>, ptr %163, align 4, !tbaa !23
  %164 = load ptr, ptr getelementptr inbounds (i8, ptr @C_kalman, i64 16), align 8, !tbaa !42
  %165 = load ptr, ptr %164, align 8, !tbaa !5
  store <2 x float> <float 1.000000e+00, float 0.000000e+00>, ptr %165, align 4, !tbaa !23
  %166 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.32)
  %167 = load ptr, ptr @stdout, align 8, !tbaa !5
  %168 = call i32 @fflush(ptr noundef %167)
  %169 = call i32 @usleep(i32 noundef 1000000) #12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #12
  %170 = call i32 @pthread_create(ptr noundef nonnull %20, ptr noundef null, ptr noundef nonnull @get_filtered_attitude_parallel, ptr noundef null) #12
  %.not29 = icmp eq i32 %170, 0
  br i1 %.not29, label %172, label %171

171:                                              ; preds = %thread-pre-split
  call void @perror(ptr noundef nonnull @.str.33) #13
  call void @stopVideo() #12
  call void @exit(i32 noundef -2) #14
  unreachable

172:                                              ; preds = %thread-pre-split
  %173 = call i32 @gettimeofday(ptr noundef nonnull @before_loop, ptr noundef null) #12
  %174 = call i32 @gettimeofday(ptr noundef nonnull @before_control, ptr noundef null) #12
  br label %175

175:                                              ; preds = %175, %172
  %176 = load i64, ptr @before_loop, align 8
  %177 = load i64, ptr getelementptr inbounds (i8, ptr @before_loop, i64 8), align 8
  %178 = load i64, ptr @elapsed_loop, align 8
  %179 = load i64, ptr getelementptr inbounds (i8, ptr @elapsed_loop, i64 8), align 8
  call void @check_time(ptr noundef nonnull @now_loop, i64 %176, i64 %177, i64 %178, i64 %179, ptr noundef nonnull @time_loop) #12
  %180 = load i64, ptr @IMU__READ_TIMESTEP, align 8, !tbaa !35
  call void @passive_wait(ptr noundef nonnull @now_control, ptr noundef nonnull @before_control, ptr noundef nonnull @elapsed_control, ptr noundef nonnull @time_control, i64 noundef %180) #12
  %181 = load float, ptr @dt, align 4, !tbaa !23
  %182 = fpext float %181 to double
  %183 = load float, ptr @psi_filt, align 4, !tbaa !23
  %184 = fpext float %183 to double
  %185 = load float, ptr @psi_dot_filt, align 4, !tbaa !23
  %186 = fpext float %185 to double
  %187 = load float, ptr @theta_filt, align 4, !tbaa !23
  %188 = fpext float %187 to double
  %189 = load float, ptr @theta_dot_filt, align 4, !tbaa !23
  %190 = fpext float %189 to double
  %191 = load float, ptr @phi_filt, align 4, !tbaa !23
  %192 = fpext float %191 to double
  %193 = load float, ptr @phi_dot_filt, align 4, !tbaa !23
  %194 = fpext float %193 to double
  %195 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.34, double noundef %182, double noundef %184, double noundef %186, double noundef %188, double noundef %190, double noundef %192, double noundef %194)
  %196 = load i64, ptr @time_loop, align 8, !tbaa !35
  %197 = load i64, ptr @CALIB__TIME, align 8, !tbaa !36
  %.not30 = icmp ugt i64 %196, %197
  br i1 %.not30, label %198, label %175, !llvm.loop !44

198:                                              ; preds = %175
  %199 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.35)
  %200 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.36)
  call void @Treat_reply(ptr noundef nonnull @.str.37) #12
  %201 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.38)
  %202 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.29, ptr noundef nonnull @reply)
  %203 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @reply, ptr noundef nonnull dereferenceable(1) @.str.39) #15
  %.not3143 = icmp eq i32 %203, 0
  br i1 %.not3143, label %._crit_edge, label %.lr.ph

.critedge:                                        ; preds = %.lr.ph
  %204 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.41)
  %205 = load ptr, ptr @stdout, align 8, !tbaa !5
  %206 = call i32 @fflush(ptr noundef %205)
  %207 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.29, ptr noundef nonnull @reply)
  %208 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @reply, ptr noundef nonnull dereferenceable(1) @.str.39) #15
  %.not31 = icmp eq i32 %208, 0
  br i1 %.not31, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %198, %.critedge
  %209 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @reply, ptr noundef nonnull dereferenceable(1) @.str.40) #15
  %.not32 = icmp eq i32 %209, 0
  br i1 %.not32, label %227, label %.critedge

._crit_edge:                                      ; preds = %.critedge, %198
  store i8 1, ptr @flight_type, align 1, !tbaa !9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(60) @new_msp430_uart_options, i8 0, i64 60, i1 false)
  store i32 6322, ptr getelementptr inbounds (i8, ptr @new_msp430_uart_options, i64 8), align 4, !tbaa !39
  store i8 0, ptr getelementptr inbounds (i8, ptr @new_msp430_uart_options, i64 23), align 1, !tbaa !9
  store i8 1, ptr getelementptr inbounds (i8, ptr @new_msp430_uart_options, i64 22), align 2, !tbaa !9
  %210 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.42)
  %211 = load ptr, ptr @stdout, align 8, !tbaa !5
  %212 = call i32 @fflush(ptr noundef %211)
  call void @open_serial_port(ptr noundef nonnull @MSP430_UART, ptr noundef nonnull @.str.43) #12
  %213 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %214 = load i32, ptr @MSP430_UART, align 4, !tbaa !14
  call void @get_old_attr(i32 noundef %214, ptr noundef nonnull @old_msp430_uart_options) #12
  %215 = load i32, ptr @MSP430_UART, align 4, !tbaa !14
  call void @set_to_blocking(i32 noundef %215) #12
  %216 = load i32, ptr @MSP430_UART, align 4, !tbaa !14
  call void @set_new_attr(i32 noundef %216, ptr noundef nonnull @old_msp430_uart_options, ptr noundef nonnull @new_msp430_uart_options) #12
  %217 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.44)
  %218 = load ptr, ptr @stdout, align 8, !tbaa !5
  %219 = call i32 @fflush(ptr noundef %218)
  call void @MSP430_UART_write(ptr noundef nonnull @.str.45) #12
  %220 = call i32 @usleep(i32 noundef 500000) #12
  %221 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.46)
  %222 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.47)
  %223 = load ptr, ptr @stdout, align 8, !tbaa !5
  %224 = call i32 @fflush(ptr noundef %223)
  call void @MSP430_UART_write(ptr noundef nonnull @.str.48) #12
  %225 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.49)
  %226 = call i32 @usleep(i32 noundef 10000000) #12
  br label %228

227:                                              ; preds = %.lr.ph
  store i8 0, ptr @flight_type, align 1, !tbaa !9
  br label %228

228:                                              ; preds = %._crit_edge, %227
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(30) @reply, i8 0, i64 30, i1 false)
  %229 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.50)
  call void @Treat_reply(ptr noundef nonnull @.str.51) #12
  %230 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.52)
  %231 = load ptr, ptr @stdout, align 8, !tbaa !5
  %232 = call i32 @fflush(ptr noundef %231)
  %233 = load i8, ptr @launch_detect_gpio, align 1, !tbaa !9
  %234 = zext nneg i8 %233 to i32
  %235 = shl nuw i32 1, %234
  %236 = load ptr, ptr getelementptr inbounds (i8, ptr @gpio, i64 24), align 8, !tbaa !10
  %237 = getelementptr inbounds i8, ptr %236, i64 52
  br label %238

238:                                              ; preds = %238, %228
  %239 = load volatile i32, ptr %237, align 4, !tbaa !14
  %240 = and i32 %239, %235
  store volatile i32 %240, ptr %237, align 4, !tbaa !14
  %.not34 = icmp eq i32 %240, 0
  br i1 %.not34, label %241, label %238, !llvm.loop !45

241:                                              ; preds = %238
  %242 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.53)
  %243 = load ptr, ptr @stdout, align 8, !tbaa !5
  %244 = call i32 @fflush(ptr noundef %243)
  %245 = load i8, ptr @flight_type, align 1, !tbaa !9
  %246 = icmp eq i8 %245, 1
  %247 = load i64, ptr @ENGINE__BURN_TIME, align 8, !tbaa !35
  br i1 %246, label %248, label %434

248:                                              ; preds = %241
  %249 = trunc i64 %247 to i32
  %250 = call i32 @usleep(i32 noundef %249) #12
  %251 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.54)
  call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %21) #12
  %252 = load ptr, ptr @control_log, align 8, !tbaa !5
  %253 = load ptr, ptr @error_log, align 8, !tbaa !5
  call void @write_to_file_custom(ptr noundef %252, ptr noundef nonnull @.str.55, ptr noundef %253) #12
  %254 = call i32 @gettimeofday(ptr noundef nonnull @before_control, ptr noundef null) #12
  %255 = call i32 @gettimeofday(ptr noundef nonnull @before_loop, ptr noundef null) #12
  br label %256

256:                                              ; preds = %395, %248
  %257 = load i64, ptr @GLOBAL__TIME_STARTPOINT, align 8
  %258 = load i64, ptr getelementptr inbounds (i8, ptr @GLOBAL__TIME_STARTPOINT, i64 8), align 8
  %259 = load i64, ptr @elapsed_control_glob, align 8
  %260 = load i64, ptr getelementptr inbounds (i8, ptr @elapsed_control_glob, i64 8), align 8
  call void @check_time(ptr noundef nonnull @now_control_glob, i64 %257, i64 %258, i64 %259, i64 %260, ptr noundef nonnull @time_control_glob) #12
  %261 = load i64, ptr @before_loop, align 8
  %262 = load i64, ptr getelementptr inbounds (i8, ptr @before_loop, i64 8), align 8
  %263 = load i64, ptr @elapsed_loop, align 8
  %264 = load i64, ptr getelementptr inbounds (i8, ptr @elapsed_loop, i64 8), align 8
  call void @check_time(ptr noundef nonnull @now_loop, i64 %261, i64 %262, i64 %263, i64 %264, ptr noundef nonnull @time_loop) #12
  %265 = load i64, ptr @CONTROL__TIME_STEP, align 8, !tbaa !35
  call void @passive_wait(ptr noundef nonnull @now_control, ptr noundef nonnull @before_control, ptr noundef nonnull @elapsed_control, ptr noundef nonnull @time_control, i64 noundef %265) #12
  %266 = load float, ptr @psi_filt, align 4, !tbaa !23
  store float %266, ptr @psi_cont, align 4, !tbaa !23
  %267 = load float, ptr @psi_dot_filt, align 4, !tbaa !23
  store float %267, ptr @psidot_cont, align 4, !tbaa !23
  %268 = load float, ptr @theta_filt, align 4, !tbaa !23
  store float %268, ptr @theta_cont, align 4, !tbaa !23
  %269 = load float, ptr @theta_dot_filt, align 4, !tbaa !23
  store float %269, ptr @thetadot_cont, align 4, !tbaa !23
  %270 = load float, ptr @phi_filt, align 4, !tbaa !23
  store float %270, ptr @phi_cont, align 4, !tbaa !23
  %271 = load float, ptr @wx, align 4, !tbaa !23
  store float %271, ptr @wx_cont, align 4, !tbaa !23
  %272 = load double, ptr @Fpitch_loop, align 8, !tbaa !46
  %273 = load float, ptr @theta_ref, align 4, !tbaa !23
  %274 = fsub float %268, %273
  %275 = fpext float %274 to double
  %276 = load double, ptr getelementptr inbounds (i8, ptr @Fpitch_loop, i64 8), align 8, !tbaa !49
  %277 = fpext float %269 to double
  %278 = fmul double %276, %277
  %279 = call double @llvm.fmuladd.f64(double %272, double %275, double %278)
  store double %279, ptr @Fpitch, align 8, !tbaa !50
  %280 = load double, ptr @Fyaw_loop, align 8, !tbaa !46
  %281 = load float, ptr @psi_ref, align 4, !tbaa !23
  %282 = fsub float %266, %281
  %283 = fpext float %282 to double
  %284 = load double, ptr getelementptr inbounds (i8, ptr @Fyaw_loop, i64 8), align 8, !tbaa !49
  %285 = fpext float %267 to double
  %286 = fmul double %284, %285
  %287 = call double @llvm.fmuladd.f64(double %280, double %283, double %286)
  store double %287, ptr @Fyaw, align 8, !tbaa !50
  %288 = load double, ptr @Mroll_loop, align 8, !tbaa !46
  %289 = load float, ptr @wx_ref, align 4, !tbaa !23
  %290 = fsub float %271, %289
  %291 = fpext float %290 to double
  %292 = fmul double %288, %291
  store double %292, ptr @Mroll, align 8, !tbaa !50
  store <2 x double> <double 0.000000e+00, double -1.000000e+00>, ptr getelementptr inbounds (i8, ptr @A, i64 56), align 8, !tbaa !50
  store <2 x double> <double -1.000000e+00, double -1.000000e+00>, ptr getelementptr inbounds (i8, ptr @A, i64 72), align 8, !tbaa !50
  store double -1.000000e+00, ptr getelementptr inbounds (i8, ptr @A, i64 88), align 8, !tbaa !50
  %293 = fcmp ult double %279, 0.000000e+00
  br i1 %293, label %308, label %294

294:                                              ; preds = %256
  store double %279, ptr getelementptr inbounds (i8, ptr @A, i64 104), align 8, !tbaa !50
  %295 = fpext float %270 to double
  %296 = call double @cos(double noundef %295) #12
  store double %296, ptr getelementptr inbounds (i8, ptr @A, i64 112), align 16, !tbaa !50
  %297 = load float, ptr @phi_cont, align 4, !tbaa !23
  %298 = fpext float %297 to double
  %299 = call double @sin(double noundef %298) #12
  %300 = fneg double %299
  store double %300, ptr getelementptr inbounds (i8, ptr @A, i64 120), align 8, !tbaa !50
  %301 = load float, ptr @phi_cont, align 4, !tbaa !23
  %302 = fpext float %301 to double
  %303 = call double @cos(double noundef %302) #12
  %304 = fneg double %303
  store double %304, ptr getelementptr inbounds (i8, ptr @A, i64 128), align 16, !tbaa !50
  %305 = load float, ptr @phi_cont, align 4, !tbaa !23
  %306 = fpext float %305 to double
  %307 = call double @sin(double noundef %306) #12
  br label %323

308:                                              ; preds = %256
  %309 = fneg double %279
  store double %309, ptr getelementptr inbounds (i8, ptr @A, i64 104), align 8, !tbaa !50
  %310 = fpext float %270 to double
  %311 = call double @cos(double noundef %310) #12
  %312 = fneg double %311
  store double %312, ptr getelementptr inbounds (i8, ptr @A, i64 112), align 16, !tbaa !50
  %313 = load float, ptr @phi_cont, align 4, !tbaa !23
  %314 = fpext float %313 to double
  %315 = call double @sin(double noundef %314) #12
  store double %315, ptr getelementptr inbounds (i8, ptr @A, i64 120), align 8, !tbaa !50
  %316 = load float, ptr @phi_cont, align 4, !tbaa !23
  %317 = fpext float %316 to double
  %318 = call double @cos(double noundef %317) #12
  store double %318, ptr getelementptr inbounds (i8, ptr @A, i64 128), align 16, !tbaa !50
  %319 = load float, ptr @phi_cont, align 4, !tbaa !23
  %320 = fpext float %319 to double
  %321 = call double @sin(double noundef %320) #12
  %322 = fneg double %321
  br label %323

323:                                              ; preds = %308, %294
  %storemerge = phi double [ %322, %308 ], [ %307, %294 ]
  store double %storemerge, ptr getelementptr inbounds (i8, ptr @A, i64 136), align 8, !tbaa !50
  %324 = load double, ptr @Fyaw, align 8, !tbaa !50
  %325 = fcmp ult double %324, 0.000000e+00
  br i1 %325, label %341, label %326

326:                                              ; preds = %323
  store double %324, ptr getelementptr inbounds (i8, ptr @A, i64 152), align 8, !tbaa !50
  %327 = load float, ptr @phi_cont, align 4, !tbaa !23
  %328 = fpext float %327 to double
  %329 = call double @sin(double noundef %328) #12
  store double %329, ptr getelementptr inbounds (i8, ptr @A, i64 160), align 16, !tbaa !50
  %330 = load float, ptr @phi_cont, align 4, !tbaa !23
  %331 = fpext float %330 to double
  %332 = call double @cos(double noundef %331) #12
  store double %332, ptr getelementptr inbounds (i8, ptr @A, i64 168), align 8, !tbaa !50
  %333 = load float, ptr @phi_cont, align 4, !tbaa !23
  %334 = fpext float %333 to double
  %335 = call double @sin(double noundef %334) #12
  %336 = fneg double %335
  store double %336, ptr getelementptr inbounds (i8, ptr @A, i64 176), align 16, !tbaa !50
  %337 = load float, ptr @phi_cont, align 4, !tbaa !23
  %338 = fpext float %337 to double
  %339 = call double @cos(double noundef %338) #12
  %340 = fneg double %339
  br label %357

341:                                              ; preds = %323
  %342 = fneg double %324
  store double %342, ptr getelementptr inbounds (i8, ptr @A, i64 152), align 8, !tbaa !50
  %343 = load float, ptr @phi_cont, align 4, !tbaa !23
  %344 = fpext float %343 to double
  %345 = call double @sin(double noundef %344) #12
  %346 = fneg double %345
  store double %346, ptr getelementptr inbounds (i8, ptr @A, i64 160), align 16, !tbaa !50
  %347 = load float, ptr @phi_cont, align 4, !tbaa !23
  %348 = fpext float %347 to double
  %349 = call double @cos(double noundef %348) #12
  %350 = fneg double %349
  store double %350, ptr getelementptr inbounds (i8, ptr @A, i64 168), align 8, !tbaa !50
  %351 = load float, ptr @phi_cont, align 4, !tbaa !23
  %352 = fpext float %351 to double
  %353 = call double @sin(double noundef %352) #12
  store double %353, ptr getelementptr inbounds (i8, ptr @A, i64 176), align 16, !tbaa !50
  %354 = load float, ptr @phi_cont, align 4, !tbaa !23
  %355 = fpext float %354 to double
  %356 = call double @cos(double noundef %355) #12
  br label %357

357:                                              ; preds = %341, %326
  %storemerge35 = phi double [ %356, %341 ], [ %340, %326 ]
  store double %storemerge35, ptr getelementptr inbounds (i8, ptr @A, i64 184), align 8, !tbaa !50
  %358 = load double, ptr @Mroll, align 8, !tbaa !50
  %359 = fcmp ult double %358, 0.000000e+00
  br i1 %359, label %363, label %360

360:                                              ; preds = %357
  %361 = load double, ptr @d, align 8, !tbaa !50
  %362 = fneg double %361
  br label %367

363:                                              ; preds = %357
  %364 = fneg double %358
  %365 = load double, ptr @d, align 8, !tbaa !50
  %366 = fneg double %365
  br label %367

367:                                              ; preds = %363, %360
  %.sink45 = phi double [ %364, %363 ], [ %358, %360 ]
  %.sink = phi double [ %366, %363 ], [ %361, %360 ]
  %storemerge41 = phi double [ %365, %363 ], [ %362, %360 ]
  store double %.sink45, ptr getelementptr inbounds (i8, ptr @A, i64 200), align 8
  store double %.sink, ptr getelementptr inbounds (i8, ptr @A, i64 208), align 16
  store double %storemerge41, ptr getelementptr inbounds (i8, ptr @A, i64 216), align 8, !tbaa !50
  store double %.sink, ptr getelementptr inbounds (i8, ptr @A, i64 224), align 16, !tbaa !50
  store double %storemerge41, ptr getelementptr inbounds (i8, ptr @A, i64 232), align 8, !tbaa !50
  %368 = load i32, ptr @M, align 4, !tbaa !14
  %369 = load i32, ptr @N, align 4, !tbaa !14
  %370 = load i32, ptr @M1, align 4, !tbaa !14
  %371 = load i32, ptr @M2, align 4, !tbaa !14
  %372 = load i32, ptr @M3, align 4, !tbaa !14
  call void @simplx(ptr noundef nonnull @A, i32 noundef %368, i32 noundef %369, i32 noundef %370, i32 noundef %371, i32 noundef %372, ptr noundef nonnull @ICASE, ptr noundef nonnull @IZROV, ptr noundef nonnull @IPOSV) #12
  %373 = load i32, ptr @ICASE, align 4, !tbaa !14
  %374 = load i32, ptr @M, align 4, !tbaa !14
  %375 = load i32, ptr @N, align 4, !tbaa !14
  call void @get_simplex_solution(i32 noundef %373, ptr noundef nonnull @IPOSV, ptr noundef nonnull @A, i32 noundef %374, i32 noundef %375, ptr noundef nonnull @R1, ptr noundef nonnull @R2, ptr noundef nonnull @R3, ptr noundef nonnull @R4) #12
  %376 = load double, ptr @R1, align 8, !tbaa !50
  %377 = load double, ptr @VALVE__MAX_THRUST, align 8, !tbaa !50
  %378 = fcmp ult double %376, %377
  br i1 %378, label %380, label %379

379:                                              ; preds = %367
  store double %377, ptr @R1, align 8, !tbaa !50
  br label %380

380:                                              ; preds = %379, %367
  %381 = phi double [ %377, %379 ], [ %376, %367 ]
  %382 = load double, ptr @R2, align 8, !tbaa !50
  %383 = fcmp ult double %382, %377
  br i1 %383, label %385, label %384

384:                                              ; preds = %380
  store double %377, ptr @R2, align 8, !tbaa !50
  br label %385

385:                                              ; preds = %384, %380
  %386 = phi double [ %377, %384 ], [ %382, %380 ]
  %387 = load double, ptr @R3, align 8, !tbaa !50
  %388 = fcmp ult double %387, %377
  br i1 %388, label %390, label %389

389:                                              ; preds = %385
  store double %377, ptr @R3, align 8, !tbaa !50
  br label %390

390:                                              ; preds = %389, %385
  %391 = phi double [ %377, %389 ], [ %387, %385 ]
  %392 = load double, ptr @R4, align 8, !tbaa !50
  %393 = fcmp ult double %392, %377
  br i1 %393, label %395, label %394

394:                                              ; preds = %390
  store double %377, ptr @R4, align 8, !tbaa !50
  br label %395

395:                                              ; preds = %394, %390
  %396 = phi double [ %377, %394 ], [ %392, %390 ]
  call void @search_PWM(double noundef %381, double noundef %386, double noundef %391, double noundef %396, ptr noundef nonnull @PWM1, ptr noundef nonnull @PWM2, ptr noundef nonnull @PWM3, ptr noundef nonnull @PWM4) #12
  %397 = load i32, ptr @PWM1, align 4, !tbaa !14
  %398 = load i32, ptr @PWM2, align 4, !tbaa !14
  %399 = load i32, ptr @PWM3, align 4, !tbaa !14
  %400 = load i32, ptr @PWM4, align 4, !tbaa !14
  call void @MSP430_UART_write_PWM(i32 noundef %397, i32 noundef %398, i32 noundef %399, i32 noundef %400) #12
  %401 = load i64, ptr @time_control_glob, align 8, !tbaa !35
  %402 = load i64, ptr @time_control, align 8, !tbaa !35
  %403 = load double, ptr @Fpitch, align 8, !tbaa !50
  %404 = load double, ptr @Fyaw, align 8, !tbaa !50
  %405 = load double, ptr @Mroll, align 8, !tbaa !50
  %406 = load double, ptr @R1, align 8, !tbaa !50
  %407 = load double, ptr @R2, align 8, !tbaa !50
  %408 = load double, ptr @R3, align 8, !tbaa !50
  %409 = load double, ptr @R4, align 8, !tbaa !50
  %410 = load i32, ptr @PWM1, align 4, !tbaa !14
  %411 = load i32, ptr @PWM2, align 4, !tbaa !14
  %412 = load i32, ptr @PWM3, align 4, !tbaa !14
  %413 = load i32, ptr @PWM4, align 4, !tbaa !14
  %414 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %21, ptr noundef nonnull dereferenceable(1) @.str.56, i64 noundef %401, i64 noundef %402, double noundef %403, double noundef %404, double noundef %405, double noundef %406, double noundef %407, double noundef %408, double noundef %409, i32 noundef %410, i32 noundef %411, i32 noundef %412, i32 noundef %413) #12
  %415 = load ptr, ptr @control_log, align 8, !tbaa !5
  %416 = load ptr, ptr @error_log, align 8, !tbaa !5
  call void @write_to_file_custom(ptr noundef %415, ptr noundef nonnull %21, ptr noundef %416) #12
  %417 = load i64, ptr @time_control, align 8, !tbaa !35
  %418 = load double, ptr @R1, align 8, !tbaa !50
  %419 = load double, ptr @R2, align 8, !tbaa !50
  %420 = load double, ptr @R3, align 8, !tbaa !50
  %421 = load double, ptr @R4, align 8, !tbaa !50
  %422 = load i32, ptr @PWM1, align 4, !tbaa !14
  %423 = load i32, ptr @PWM2, align 4, !tbaa !14
  %424 = load i32, ptr @PWM3, align 4, !tbaa !14
  %425 = load i32, ptr @PWM4, align 4, !tbaa !14
  %426 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.57, i64 noundef %417, double noundef %418, double noundef %419, double noundef %420, double noundef %421, i32 noundef %422, i32 noundef %423, i32 noundef %424, i32 noundef %425)
  %427 = load i64, ptr @time_loop, align 8, !tbaa !35
  %428 = load i64, ptr @ACTIVE__CONTROL_TIME, align 8, !tbaa !35
  %.not37 = icmp ugt i64 %427, %428
  br i1 %.not37, label %429, label %256, !llvm.loop !51

429:                                              ; preds = %395
  call void @MSP430_UART_write_PWM(i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0) #12
  %430 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.58)
  %431 = load i64, ptr @DESCENT__TIME, align 8, !tbaa !35
  %432 = trunc i64 %431 to i32
  %433 = call i32 @usleep(i32 noundef %432) #12
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %21) #12
  br label %441

434:                                              ; preds = %241
  %435 = load i64, ptr @ACTIVE__CONTROL_TIME, align 8, !tbaa !35
  %436 = add i64 %435, %247
  %437 = load i64, ptr @DESCENT__TIME, align 8, !tbaa !35
  %438 = add i64 %436, %437
  %439 = trunc i64 %438 to i32
  %440 = call i32 @usleep(i32 noundef %439) #12
  br label %441

441:                                              ; preds = %434, %429
  %442 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.59)
  %443 = load i8, ptr @flight_type, align 1, !tbaa !9
  %444 = icmp eq i8 %443, 1
  br i1 %444, label %445, label %446

445:                                              ; preds = %441
  call void @MSP430_UART_write(ptr noundef nonnull @.str.45) #12
  br label %446

446:                                              ; preds = %445, %441
  store i8 1, ptr @SPI_quit, align 1, !tbaa !9
  %447 = load i64, ptr %1, align 8, !tbaa !36
  %448 = call i32 @pthread_join(i64 noundef %447, ptr noundef null) #12
  store i8 1, ptr @IMU_quit, align 1, !tbaa !9
  %449 = load i64, ptr %4, align 8, !tbaa !36
  %450 = call i32 @pthread_join(i64 noundef %449, ptr noundef null) #12
  %451 = load i64, ptr %20, align 8, !tbaa !36
  %452 = call i32 @pthread_join(i64 noundef %451, ptr noundef null) #12
  %453 = call i32 @pthread_mutex_destroy(ptr noundef nonnull @error_log_write_lock) #12
  call void @unmap_peripheral(ptr noundef nonnull @gpio) #12
  call void @stopVideo() #12
  %454 = load ptr, ptr @error_log, align 8, !tbaa !5
  %455 = call i32 @fclose(ptr noundef %454)
  %456 = load ptr, ptr @imu_log, align 8, !tbaa !5
  %457 = call i32 @fclose(ptr noundef %456)
  %458 = load ptr, ptr @pressure_log, align 8, !tbaa !5
  %459 = call i32 @fclose(ptr noundef %458)
  %460 = load ptr, ptr @control_log, align 8, !tbaa !5
  %461 = call i32 @fclose(ptr noundef %460)
  %462 = load i32, ptr @RAZOR_UART, align 4, !tbaa !14
  call void @reset_old_attr_port(i32 noundef %462, ptr noundef nonnull @old_razor_uart_options) #12
  %463 = load i32, ptr @RAZOR_UART, align 4, !tbaa !14
  call void @close_port(i32 noundef %463) #12
  %464 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.60)
  call void @pthread_exit(ptr noundef null) #14
  unreachable
}

; Function Attrs: nofree nounwind
declare noundef i32 @gettimeofday(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nounwind
declare i32 @pthread_mutex_init(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

declare void @open_error_file(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @open_file(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @stopVideo() local_unnamed_addr #4

declare void @startVideo(ptr noundef, ptr noundef) local_unnamed_addr #4

declare i32 @usleep(i32 noundef) local_unnamed_addr #4

declare i32 @map_peripheral(ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #5

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

declare void @pressure_sensor_SPI_connect(ptr noundef, ptr noundef, i8 noundef zeroext, i8 noundef zeroext, i64 noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

declare void @Treat_reply(ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind
declare i32 @pthread_create(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @get_readings_SPI_parallel(ptr noundef) #4

declare void @check_time(ptr noundef, i64, i64, i64, i64, ptr noundef) local_unnamed_addr #4

declare void @passive_wait(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #4

declare void @Fpitch_loop_control_setup(...) local_unnamed_addr #4

declare void @Fyaw_loop_control_setup(...) local_unnamed_addr #4

declare void @Mroll_loop_control_setup(...) local_unnamed_addr #4

declare void @open_serial_port(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #1

declare void @get_old_attr(i32 noundef, ptr noundef) local_unnamed_addr #4

declare void @set_to_blocking(i32 noundef) local_unnamed_addr #4

declare void @set_new_attr(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @initMatrix(ptr dead_on_unwind writable sret(%struct.MATRIX) align 8, i64 noundef, i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #5

declare ptr @read_IMU_parallel(ptr noundef) #4

declare void @Calibrate_IMU(...) local_unnamed_addr #4

declare void @construct_zeroed_DCM(...) local_unnamed_addr #4

declare void @zero_Euler_angles(...) local_unnamed_addr #4

declare float @TO_DEG(float noundef) local_unnamed_addr #4

declare ptr @get_filtered_attitude_parallel(ptr noundef) #4

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #8

declare void @MSP430_UART_write(ptr noundef) local_unnamed_addr #4

declare void @write_to_file_custom(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #9

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #10

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #10

declare void @simplx(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @get_simplex_solution(i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @search_PWM(double noundef, double noundef, double noundef, double noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @MSP430_UART_write_PWM(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #4

declare i32 @pthread_join(i64 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind
declare i32 @pthread_mutex_destroy(ptr noundef) local_unnamed_addr #2

declare void @unmap_peripheral(ptr noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #1

declare void @reset_old_attr_port(i32 noundef, ptr noundef) local_unnamed_addr #4

declare void @close_port(i32 noundef) local_unnamed_addr #4

; Function Attrs: noreturn
declare void @pthread_exit(ptr noundef) local_unnamed_addr #11

attributes #0 = { noreturn nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #10 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #12 = { nounwind }
attributes #13 = { cold }
attributes #14 = { noreturn nounwind }
attributes #15 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 24}
!11 = !{!"bcm2835_peripheral", !12, i64 0, !13, i64 8, !6, i64 16, !6, i64 24}
!12 = !{!"long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!16, !7, i64 0}
!16 = !{!"SPI_data", !7, i64 0, !7, i64 1, !12, i64 8, !7, i64 16, !13, i64 20, !13, i64 24, !17, i64 28, !17, i64 32, !13, i64 36, !13, i64 40}
!17 = !{!"float", !7, i64 0}
!18 = !{!16, !7, i64 1}
!19 = !{!16, !12, i64 8}
!20 = !{!16, !7, i64 16}
!21 = !{!16, !13, i64 20}
!22 = !{!16, !13, i64 24}
!23 = !{!17, !17, i64 0}
!24 = !{!16, !13, i64 36}
!25 = !{!16, !13, i64 40}
!26 = !{!27, !28, i64 0}
!27 = !{!"spi_ioc_transfer", !28, i64 0, !28, i64 8, !13, i64 16, !13, i64 20, !29, i64 24, !7, i64 26, !7, i64 27, !7, i64 28, !7, i64 29, !7, i64 30, !7, i64 31}
!28 = !{!"long long", !7, i64 0}
!29 = !{!"short", !7, i64 0}
!30 = !{!27, !28, i64 8}
!31 = !{!27, !13, i64 16}
!32 = !{!27, !13, i64 20}
!33 = !{!27, !7, i64 26}
!34 = !{!27, !29, i64 24}
!35 = !{!28, !28, i64 0}
!36 = !{!12, !12, i64 0}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!40, !13, i64 8}
!40 = !{!"termios", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !7, i64 16, !7, i64 17, !13, i64 52, !13, i64 56}
!41 = !{i64 0, i64 8, !36, i64 8, i64 8, !36, i64 16, i64 8, !5}
!42 = !{!43, !6, i64 16}
!43 = !{!"MATRIX", !12, i64 0, !12, i64 8, !6, i64 16}
!44 = distinct !{!44, !38}
!45 = distinct !{!45, !38}
!46 = !{!47, !48, i64 0}
!47 = !{!"Control_loop", !48, i64 0, !48, i64 8, !48, i64 16, !48, i64 24}
!48 = !{!"double", !7, i64 0}
!49 = !{!47, !48, i64 8}
!50 = !{!48, !48, i64 0}
!51 = distinct !{!51, !38}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass