#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 */
scalar_t__ bubble_sort(int *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
char *test_normal_op() {
  int array[] = {56, 43, 145, -67, -90, 0};
  do {
    if (!(bubble_sort(array, 6) == 0)) {
      printf("Line number is: %d\n", 34);
      return "error, sort was not successful";
    }
  } while (0);
  int i = 0;
  for (; i < 6; i++) {
    printf("%d\t", array[i]);
  }
  puts("");
  return 0;
}


x86 assembly (clang, -O0):
<test_normal_op>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1050 <bubble_sort@plt>
cmp    $0x0,%rax
je     1192 <test_normal_op+0x62>
lea    0xea0(%rip),%rdi
mov    $0x22,%esi
call   1040 <printf@plt>
lea    0xea3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11de <test_normal_op+0xae>
jmp    1197 <test_normal_op+0x67>
movl   $0x0,-0x24(%rbp)
cmpl   $0x6,-0x24(%rbp)
jge    11ca <test_normal_op+0x9a>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    119e <test_normal_op+0x6e>
lea    0xe7d(%rip),%rdi
call   1030 <puts@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_normal_op>:
push   %rbx
sub    $0x20,%rsp
mov    0xed4(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1050 <bubble_sort@plt>
test   %rax,%rax
je     1178 <test_normal_op+0x48>
lea    0xeb3(%rip),%rdi
mov    $0x22,%esi
call   1040 <printf@plt>
lea    0xeb6(%rip),%rax
jmp    11d2 <test_normal_op+0xa2>
mov    (%rsp),%esi
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_normal_op.array = [6 x i32] [i32 56, i32 43, i32 145, i32 -67, i32 -90, i32 0]
@.str = [20 x i8] c"Line number is: %d\0A\00"
@.str.1 = [31 x i8] c"error, sort was not successful\00"
@.str.2 = [4 x i8] c"%d\09\00"
@.str.3 = [1 x i8] zeroinitializer
define i8* @test_normal_op() {
%1 = alloca i8*
%2 = alloca [6 x i32]
%3 = alloca i32
%4 = bitcast [6 x i32]* %2 to i8*
br label %5
5: ; preds = %0
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%7 = call i64 @bubble_sort(i32* %6, i32 6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 34)
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %27
11: ; preds = %5
br label %12
12: ; preds = %11
store i32 0, i32* %3
br label %13
13: ; preds = %22, %12
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, 6
br i1 %15, label %16, label %25
16: ; preds = %13
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %16
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %13
25: ; preds = %13
%26 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
store i8* null, i8** %1
br label %27
27: ; preds = %25, %9
%28 = load i8*, i8** %1
ret i8* %28
}

LLVM IR (-O2):
@__const.test_normal_op.array = [6 x i32] [i32 56, i32 43, i32 145, i32 -67, i32 -90, i32 0]
@.str = [20 x i8] c"Line number is: %d\0A\00"
@.str.1 = [31 x i8] c"error, sort was not successful\00"
@.str.2 = [4 x i8] c"%d\09\00"
define i8* @test_normal_op() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i64 @bubble_sort(i32* %3, i32 6)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %25
6: ; preds = %0
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 1
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 2
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 3
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 4
%19 = load i32, i32* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %19)
%21 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 5
%22 = load i32, i32* %21
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%24 = call i32 @putchar(i32 10)
br label %27
25: ; preds = %0
%26 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 34)
br label %27
27: ; preds = %6, %25
%28 = phi i8* [ null, %6 ], [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), %25 ]
ret i8* %28
}