#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ Axle_Delete(int, int);
int /*<<< orphan*/ CarList_Change();
int /*<<< orphan*/ Car_Delete(int);
int /*<<< orphan*/ Car_GetCarAcceleration(int /*<<< orphan*/);
int Car_GetCarAxlesNum(int);
int /*<<< orphan*/ Car_GetCarAxlesSpace(int, int);
int /*<<< orphan*/ Car_GetCarAxlesType(int, int);
int /*<<< orphan*/ Car_GetCarAxlesWeight(int, int);
int Car_GetCarListAxlesNum();
int /*<<< orphan*/ Car_GetCarOverload(int /*<<< orphan*/);
int /*<<< orphan*/ Car_GetCarSpeed(int /*<<< orphan*/);
scalar_t__ Car_GetNum();
int /*<<< orphan*/ Car_Insert(int);
int /*<<< orphan*/ Car_SetCarAcceleration(int, int /*<<< orphan*/);
int /*<<< orphan*/ Car_SetCarAxlesSpace(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ Car_SetCarAxlesType(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ Car_SetCarAxlesWeight(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ Car_SetCarOverload(int, int /*<<< orphan*/);
int /*<<< orphan*/ Car_SetCarSpeed(int, int /*<<< orphan*/);
int /*<<< orphan*/ Finishing();
void ModifyAxlesNo(int inputAxesNo) {
  if (Car_GetNum() > 0) {
    if (inputAxesNo > Car_GetCarListAxlesNum() || inputAxesNo <= 0) {
      return;
    }
    int i = 0, j = 0;
    int c = Car_GetCarAxlesNum(0);
    if (c > inputAxesNo) {
      Car_Insert(1);
      Car_SetCarOverload(1, Car_GetCarOverload(0));
      Car_SetCarSpeed(1, Car_GetCarSpeed(0));
      Car_SetCarAcceleration(1, Car_GetCarAcceleration(0));
      for (i = inputAxesNo; i < c; i++) {
        Car_SetCarAxlesWeight(1, j, Car_GetCarAxlesWeight(0, inputAxesNo));
        Car_SetCarAxlesType(1, j, Car_GetCarAxlesType(0, inputAxesNo));
        Car_SetCarAxlesSpace(1, j, Car_GetCarAxlesSpace(0, inputAxesNo));
        Axle_Delete(0, inputAxesNo);
        j++;
      }
    } else if (c < inputAxesNo) {
      for (i = c; i < inputAxesNo; i++) {
        if (0 == Car_GetCarAxlesNum(1)) {
          Car_Delete(1);
        }
        Car_SetCarAxlesWeight(0, i, Car_GetCarAxlesWeight(1, 0));
        Car_SetCarAxlesType(0, i, Car_GetCarAxlesType(1, 0));
        Car_SetCarAxlesSpace(0, i, Car_GetCarAxlesSpace(1, 0));
        Axle_Delete(1, 0);
      }
      Finishing();
    }
  }
  CarList_Change();
}


x86 assembly (clang, -O0):
<ModifyAxlesNo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1100 <Car_GetNum@plt>
cmp    $0x0,%rax
jle    1444 <ModifyAxlesNo+0x204>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1060 <Car_GetCarListAxlesNum@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jg     1280 <ModifyAxlesNo+0x40>
cmpl   $0x0,-0x4(%rbp)
jg     1285 <ModifyAxlesNo+0x45>
jmp    144b <ModifyAxlesNo+0x20b>
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %edi,%edi
call   1030 <Car_GetCarAxlesNum@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    1381 <ModifyAxlesNo+0x141>
mov    $0x1,%edi
call   10f0 <Car_Insert@plt>
xor    %edi,%edi
call   10a0 <Car_GetCarOverload@plt>
mov    %eax,%esi
mov    $0x1,%edi
call   1110 <Car_SetCarOverload@plt>
xor    %edi,%edi
call   1040 <Car_GetCarSpeed@plt>
mov    %eax,%esi
mov    $0x1,%edi
call   10b0 <Car_SetCarSpeed@plt>
xor    %edi,%edi
call   1120 <Car_GetCarAcceleration@plt>
mov    %eax,%esi
mov    $0x1,%edi
call   1150 <Car_SetCarAcceleration@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    137c <ModifyAxlesNo+0x13c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   10d0 <Car_GetCarAxlesWeight@plt>
mov    -0x20(%rbp),%esi
mov    %eax,%edx
mov    $0x1,%edi
call   1140 <Car_SetCarAxlesWeight@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1080 <Car_GetCarAxlesType@plt>
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
mov    $0x1,%edi
call   1090 <Car_SetCarAxlesType@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   10c0 <Car_GetCarAxlesSpace@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
mov    $0x1,%edi
call   1160 <Car_SetCarAxlesSpace@plt>
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1070 <Axle_Delete@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12f2 <ModifyAxlesNo+0xb2>
jmp    143f <ModifyAxlesNo+0x1ff>
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    143a <ModifyAxlesNo+0x1fa>
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1433 <ModifyAxlesNo+0x1f3>
mov    $0x1,%edi
call   1030 <Car_GetCarAxlesNum@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    13bf <ModifyAxlesNo+0x17f>
mov    $0x1,%edi
call   1050 <Car_Delete@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   10d0 <Car_GetCarAxlesWeight@plt>
mov    -0x2c(%rbp),%esi
mov    %eax,%edx
xor    %edi,%edi
call   1140 <Car_SetCarAxlesWeight@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1080 <Car_GetCarAxlesType@plt>
mov    -0x28(%rbp),%esi
mov    %eax,%edx
xor    %edi,%edi
call   1090 <Car_SetCarAxlesType@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   10c0 <Car_GetCarAxlesSpace@plt>
mov    -0x24(%rbp),%esi
mov    %eax,%edx
xor    %edi,%edi
call   1160 <Car_SetCarAxlesSpace@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <Axle_Delete@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1393 <ModifyAxlesNo+0x153>
mov    $0x0,%al
call   10e0 <Finishing@plt>
jmp    143f <ModifyAxlesNo+0x1ff>
jmp    1444 <ModifyAxlesNo+0x204>
mov    $0x0,%al
call   1130 <CarList_Change@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ModifyAxlesNo>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
xor    %eax,%eax
call   1100 <Car_GetNum@plt>
test   %rax,%rax
jle    13ca <ModifyAxlesNo+0x18a>
xor    %eax,%eax
call   1060 <Car_GetCarListAxlesNum@plt>
test   %r14d,%r14d
jle    132f <ModifyAxlesNo+0xef>
cmp    %r14d,%eax
jl     132f <ModifyAxlesNo+0xef>
xor    %ebp,%ebp
xor    %edi,%edi
call   1030 <Car_GetCarAxlesNum@plt>
mov    %eax,%r15d
sub    %r14d,%r15d
jle    133a <ModifyAxlesNo+0xfa>
mov    $0x1,%edi
call   10f0 <Car_Insert@plt>
xor    %edi,%edi
call   10a0 <Car_GetCarOverload@plt>
mov    $0x1,%edi
mov    %eax,%esi
call   1110 <Car_SetCarOverload@plt>
xor    %edi,%edi
call   1040 <Car_GetCarSpeed@plt>
mov    $0x1,%edi
mov    %eax,%esi
call   10b0 <Car_SetCarSpeed@plt>
xor    %edi,%edi
call   1120 <Car_GetCarAcceleration@plt>
mov    $0x1,%edi
mov    %eax,%esi
call   1150 <Car_SetCarAcceleration@plt>
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
mov    %r14d,%esi
call   10d0 <Car_GetCarAxlesWeight@plt>
mov    $0x1,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1140 <Car_SetCarAxlesWeight@plt>
xor    %edi,%edi
mov    %r14d,%esi
call   1080 <Car_GetCarAxlesType@plt>
mov    $0x1,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1090 <Car_SetCarAxlesType@plt>
xor    %edi,%edi
mov    %r14d,%esi
call   10c0 <Car_GetCarAxlesSpace@plt>
mov    $0x1,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1160 <Car_SetCarAxlesSpace@plt>
xor    %edi,%edi
mov    %r14d,%esi
call   1070 <Axle_Delete@plt>
add    $0x1,%ebp
cmp    %ebp,%r15d
jne    12d0 <ModifyAxlesNo+0x90>
jmp    13ca <ModifyAxlesNo+0x18a>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
jge    13ca <ModifyAxlesNo+0x18a>
mov    %eax,%ebx
jmp    13a9 <ModifyAxlesNo+0x169>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x1,%edi
xor    %esi,%esi
call   10d0 <Car_GetCarAxlesWeight@plt>
xor    %edi,%edi
mov    %ebx,%esi
mov    %eax,%edx
call   1140 <Car_SetCarAxlesWeight@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1080 <Car_GetCarAxlesType@plt>
xor    %edi,%edi
mov    %ebx,%esi
mov    %eax,%edx
call   1090 <Car_SetCarAxlesType@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   10c0 <Car_GetCarAxlesSpace@plt>
xor    %edi,%edi
mov    %ebx,%esi
mov    %eax,%edx
call   1160 <Car_SetCarAxlesSpace@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1070 <Axle_Delete@plt>
add    $0x1,%ebx
cmp    %ebx,%r14d
je     13c3 <ModifyAxlesNo+0x183>
mov    $0x1,%edi
call   1030 <Car_GetCarAxlesNum@plt>
test   %eax,%eax
jne    1350 <ModifyAxlesNo+0x110>
mov    $0x1,%edi
call   1050 <Car_Delete@plt>
jmp    1350 <ModifyAxlesNo+0x110>
xor    %eax,%eax
call   10e0 <Finishing@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1130 <CarList_Change@plt>

LLVM IR (-O0):
define void @ModifyAxlesNo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = call i64 (...) @Car_GetNum()
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %88
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 (...) @Car_GetCarListAxlesNum()
%11 = icmp sgt i32 %9, %10
br i1 %11, label %15, label %12
12: ; preds = %8
%13 = load i32, i32* %2
%14 = icmp sle i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12, %8
br label %90
16: ; preds = %12
store i32 0, i32* %3
store i32 0, i32* %4
%17 = call i32 @Car_GetCarAxlesNum(i32 0)
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = load i32, i32* %2
%20 = icmp sgt i32 %18, %19
br i1 %20, label %21, label %55
21: ; preds = %16
%22 = call i32 @Car_Insert(i32 1)
%23 = call i32 @Car_GetCarOverload(i32 0)
%24 = call i32 @Car_SetCarOverload(i32 1, i32 %23)
%25 = call i32 @Car_GetCarSpeed(i32 0)
%26 = call i32 @Car_SetCarSpeed(i32 1, i32 %25)
%27 = call i32 @Car_GetCarAcceleration(i32 0)
%28 = call i32 @Car_SetCarAcceleration(i32 1, i32 %27)
%29 = load i32, i32* %2
store i32 %29, i32* %3
br label %30
30: ; preds = %51, %21
%31 = load i32, i32* %3
%32 = load i32, i32* %5
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %54
34: ; preds = %30
%35 = load i32, i32* %4
%36 = load i32, i32* %2
%37 = call i32 @Car_GetCarAxlesWeight(i32 0, i32 %36)
%38 = call i32 @Car_SetCarAxlesWeight(i32 1, i32 %35, i32 %37)
%39 = load i32, i32* %4
%40 = load i32, i32* %2
%41 = call i32 @Car_GetCarAxlesType(i32 0, i32 %40)
%42 = call i32 @Car_SetCarAxlesType(i32 1, i32 %39, i32 %41)
%43 = load i32, i32* %4
%44 = load i32, i32* %2
%45 = call i32 @Car_GetCarAxlesSpace(i32 0, i32 %44)
%46 = call i32 @Car_SetCarAxlesSpace(i32 1, i32 %43, i32 %45)
%47 = load i32, i32* %2
%48 = call i32 @Axle_Delete(i32 0, i32 %47)
%49 = load i32, i32* %4
%50 = add nsw i32 %49, 1
store i32 %50, i32* %4
br label %51
51: ; preds = %34
%52 = load i32, i32* %3
%53 = add nsw i32 %52, 1
store i32 %53, i32* %3
br label %30
54: ; preds = %30
br label %87
55: ; preds = %16
%56 = load i32, i32* %5
%57 = load i32, i32* %2
%58 = icmp slt i32 %56, %57
br i1 %58, label %59, label %86
59: ; preds = %55
%60 = load i32, i32* %5
store i32 %60, i32* %3
br label %61
61: ; preds = %81, %59
%62 = load i32, i32* %3
%63 = load i32, i32* %2
%64 = icmp slt i32 %62, %63
br i1 %64, label %65, label %84
65: ; preds = %61
%66 = call i32 @Car_GetCarAxlesNum(i32 1)
%67 = icmp eq i32 0, %66
br i1 %67, label %68, label %70
68: ; preds = %65
%69 = call i32 @Car_Delete(i32 1)
br label %70
70: ; preds = %68, %65
%71 = load i32, i32* %3
%72 = call i32 @Car_GetCarAxlesWeight(i32 1, i32 0)
%73 = call i32 @Car_SetCarAxlesWeight(i32 0, i32 %71, i32 %72)
%74 = load i32, i32* %3
%75 = call i32 @Car_GetCarAxlesType(i32 1, i32 0)
%76 = call i32 @Car_SetCarAxlesType(i32 0, i32 %74, i32 %75)
%77 = load i32, i32* %3
%78 = call i32 @Car_GetCarAxlesSpace(i32 1, i32 0)
%79 = call i32 @Car_SetCarAxlesSpace(i32 0, i32 %77, i32 %78)
%80 = call i32 @Axle_Delete(i32 1, i32 0)
br label %81
81: ; preds = %70
%82 = load i32, i32* %3
%83 = add nsw i32 %82, 1
store i32 %83, i32* %3
br label %61
84: ; preds = %61
%85 = call i32 (...) @Finishing()
br label %86
86: ; preds = %84, %55
br label %87
87: ; preds = %86, %54
br label %88
88: ; preds = %87, %1
%89 = call i32 (...) @CarList_Change()
br label %90
90: ; preds = %88, %15
ret void
}

LLVM IR (-O2):
define void @ModifyAxlesNo(i32 %0) {
%2 = tail call i64 (...) @Car_GetNum()
%3 = icmp sgt i64 %2, 0
br i1 %3, label %4, label %52
4: ; preds = %1
%5 = tail call i32 (...) @Car_GetCarListAxlesNum()
%6 = icmp slt i32 %5, %0
%7 = icmp slt i32 %0, 1
%8 = or i1 %7, %6
br i1 %8, label %54, label %9
9: ; preds = %4
%10 = tail call i32 @Car_GetCarAxlesNum(i32 0)
%11 = icmp sgt i32 %10, %0
br i1 %11, label %12, label %32
12: ; preds = %9
%13 = tail call i32 @Car_Insert(i32 1)
%14 = tail call i32 @Car_GetCarOverload(i32 0)
%15 = tail call i32 @Car_SetCarOverload(i32 1, i32 %14)
%16 = tail call i32 @Car_GetCarSpeed(i32 0)
%17 = tail call i32 @Car_SetCarSpeed(i32 1, i32 %16)
%18 = tail call i32 @Car_GetCarAcceleration(i32 0)
%19 = tail call i32 @Car_SetCarAcceleration(i32 1, i32 %18)
%20 = sub i32 %10, %0
br label %21
21: ; preds = %12, %21
%22 = phi i32 [ 0, %12 ], [ %30, %21 ]
%23 = tail call i32 @Car_GetCarAxlesWeight(i32 0, i32 %0)
%24 = tail call i32 @Car_SetCarAxlesWeight(i32 1, i32 %22, i32 %23)
%25 = tail call i32 @Car_GetCarAxlesType(i32 0, i32 %0)
%26 = tail call i32 @Car_SetCarAxlesType(i32 1, i32 %22, i32 %25)
%27 = tail call i32 @Car_GetCarAxlesSpace(i32 0, i32 %0)
%28 = tail call i32 @Car_SetCarAxlesSpace(i32 1, i32 %22, i32 %27)
%29 = tail call i32 @Axle_Delete(i32 0, i32 %0)
%30 = add nuw i32 %22, 1
%31 = icmp eq i32 %30, %20
br i1 %31, label %52, label %21
32: ; preds = %9
%33 = icmp slt i32 %10, %0
br i1 %33, label %34, label %52
34: ; preds = %32, %40
%35 = phi i32 [ %48, %40 ], [ %10, %32 ]
%36 = tail call i32 @Car_GetCarAxlesNum(i32 1)
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = tail call i32 @Car_Delete(i32 1)
br label %40
40: ; preds = %38, %34
%41 = tail call i32 @Car_GetCarAxlesWeight(i32 1, i32 0)
%42 = tail call i32 @Car_SetCarAxlesWeight(i32 0, i32 %35, i32 %41)
%43 = tail call i32 @Car_GetCarAxlesType(i32 1, i32 0)
%44 = tail call i32 @Car_SetCarAxlesType(i32 0, i32 %35, i32 %43)
%45 = tail call i32 @Car_GetCarAxlesSpace(i32 1, i32 0)
%46 = tail call i32 @Car_SetCarAxlesSpace(i32 0, i32 %35, i32 %45)
%47 = tail call i32 @Axle_Delete(i32 1, i32 0)
%48 = add i32 %35, 1
%49 = icmp eq i32 %48, %0
br i1 %49, label %50, label %34
50: ; preds = %40
%51 = tail call i32 (...) @Finishing()
br label %52
52: ; preds = %21, %50, %32, %1
%53 = tail call i32 (...) @CarList_Change()
br label %54
54: ; preds = %4, %52
ret void
}