#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*/ my_putchar(char);
int /*<<< orphan*/ my_putstr(char *);
char *x_malloc(int, int);
void pause_system3() {
  char *str;
  int i;
  int x;
  x = 0;
  str = x_malloc(sizeof(*str), 5);
  str = "|/-\\\0";
  while (42) {
    i = 0;
    while (i < 4) {
      my_putstr("Dowloading... [");
      my_putstr("\033[0m\033[31m");
      my_putchar(str[i]);
      my_putstr("\033[0m\033[37m");
      my_putstr("]\r");
      while (x < 40000000)
        x++;
      x = 0;
      i++;
    }
  }
}


x86 assembly (clang, -O0):
<pause_system3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x10(%rbp)
mov    $0x1,%edi
mov    $0x5,%esi
call   1050 <x_malloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xea7(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    11df <pause_system3+0xaf>
lea    0xe91(%rip),%rdi
call   1040 <my_putstr@plt>
lea    0xe95(%rip),%rdi
call   1040 <my_putstr@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <my_putchar@plt>
lea    0xe82(%rip),%rdi
call   1040 <my_putstr@plt>
lea    0xe80(%rip),%rdi
call   1040 <my_putstr@plt>
cmpl   $0x2625a00,-0x10(%rbp)
jge    11ca <pause_system3+0x9a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11af <pause_system3+0x7f>
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1164 <pause_system3+0x34>
jmp    115d <pause_system3+0x2d>

x86 assembly (clang, -O2):
<pause_system3>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    $0x1,%edi
mov    $0x5,%esi
call   1050 <x_malloc@plt>
lea    0xeb2(%rip),%r14
lea    0xebb(%rip),%r15
lea    0xebe(%rip),%r12
lea    0xec1(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1040 <my_putstr@plt>
mov    %r15,%rdi
call   1040 <my_putstr@plt>
mov    $0x7c,%edi
call   1030 <my_putchar@plt>
mov    %r12,%rdi
call   1040 <my_putstr@plt>
mov    %rbx,%rdi
call   1040 <my_putstr@plt>
mov    %r14,%rdi
call   1040 <my_putstr@plt>
mov    %r15,%rdi
call   1040 <my_putstr@plt>
mov    $0x2f,%edi
call   1030 <my_putchar@plt>
mov    %r12,%rdi
call   1040 <my_putstr@plt>
mov    %rbx,%rdi
call   1040 <my_putstr@plt>
mov    %r14,%rdi
call   1040 <my_putstr@plt>
mov    %r15,%rdi
call   1040 <my_putstr@plt>
mov    $0x2d,%edi
call   1030 <my_putchar@plt>
mov    %r12,%rdi
call   1040 <my_putstr@plt>
mov    %rbx,%rdi
call   1040 <my_putstr@plt>
mov    %r14,%rdi
call   1040 <my_putstr@plt>
mov    %r15,%rdi
call   1040 <my_putstr@plt>
mov    $0x5c,%edi
call   1030 <my_putchar@plt>
mov    %r12,%rdi
call   1040 <my_putstr@plt>
mov    %rbx,%rdi
call   1040 <my_putstr@plt>
jmp    1170 <pause_system3+0x40>

LLVM IR (-O0):
@.str = [6 x i8] c"|/-\\\00\00"
@.str.1 = [16 x i8] c"Dowloading... [\00"
@.str.2 = [10 x i8] c"\1B[0m\1B[31m\00"
@.str.3 = [10 x i8] c"\1B[0m\1B[37m\00"
@.str.4 = [3 x i8] c"]\0D\00"
define void @pause_system3() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %3
%4 = call i8* @x_malloc(i32 1, i32 5)
store i8* %4, i8** %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
br label %5
5: ; preds = %0, %29
store i32 0, i32* %2
br label %6
6: ; preds = %26, %5
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %29
9: ; preds = %6
%10 = call i32 @my_putstr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @my_putstr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%12 = load i8*, i8** %1
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = call i32 @my_putchar(i8 signext %16)
%18 = call i32 @my_putstr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%19 = call i32 @my_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %20
20: ; preds = %23, %9
%21 = load i32, i32* %3
%22 = icmp slt i32 %21, 40000000
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %20
26: ; preds = %20
store i32 0, i32* %3
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 1
store i32 %28, i32* %2
br label %6
29: ; preds = %6
br label %5
}

LLVM IR (-O2):
@.str.1 = [16 x i8] c"Dowloading... [\00"
@.str.2 = [10 x i8] c"\1B[0m\1B[31m\00"
@.str.3 = [10 x i8] c"\1B[0m\1B[37m\00"
@.str.4 = [3 x i8] c"]\0D\00"
define void @pause_system3() {
%1 = tail call i8* @x_malloc(i32 1, i32 5)
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @my_putstr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @my_putstr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @my_putchar(i8 signext 124)
%6 = tail call i32 @my_putstr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @my_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%8 = tail call i32 @my_putstr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @my_putstr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 @my_putchar(i8 signext 47)
%11 = tail call i32 @my_putstr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%12 = tail call i32 @my_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%13 = tail call i32 @my_putstr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%14 = tail call i32 @my_putstr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%15 = tail call i32 @my_putchar(i8 signext 45)
%16 = tail call i32 @my_putstr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%17 = tail call i32 @my_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%18 = tail call i32 @my_putstr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%19 = tail call i32 @my_putstr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%20 = tail call i32 @my_putchar(i8 signext 92)
%21 = tail call i32 @my_putstr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%22 = tail call i32 @my_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %2
}