#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int result[200] = {0};
  int a, b;
  int i = 0;
  int count = 0;
  scanf("%d/%d", &a, &b);
  for (i = 0; i < 200; i++) {
    if (a < b) {
      a *= 10;
    }
    result[i] = a / b;
    count += 1;
    a = a % b;
    if (a == 0) {
      break;
    }
  }
  printf("0.");
  for (int j = 0; j < count; j++) {
    printf("%d", result[j]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x350,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x330(%rbp),%rdi
xor    %esi,%esi
mov    $0x320,%edx
call   1040 <memset@plt>
movl   $0x0,-0x33c(%rbp)
movl   $0x0,-0x340(%rbp)
lea    0xe90(%rip),%rdi
lea    -0x334(%rbp),%rsi
lea    -0x338(%rbp),%rdx
call   1050 <scanf@plt>
movl   $0x0,-0x33c(%rbp)
cmpl   $0xc8,-0x33c(%rbp)
jge    1226 <main+0xf6>
mov    -0x334(%rbp),%eax
cmp    -0x338(%rbp),%eax
jge    11bc <main+0x8c>
imul   $0xa,-0x334(%rbp),%eax
mov    %eax,-0x334(%rbp)
mov    -0x334(%rbp),%eax
cltd
idivl  -0x338(%rbp)
mov    %eax,%ecx
movslq -0x33c(%rbp),%rax
mov    %ecx,-0x330(%rbp,%rax,4)
mov    -0x340(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x340(%rbp)
mov    -0x334(%rbp),%eax
cltd
idivl  -0x338(%rbp)
mov    %edx,-0x334(%rbp)
cmpl   $0x0,-0x334(%rbp)
jne    120d <main+0xdd>
jmp    1226 <main+0xf6>
jmp    1212 <main+0xe2>
mov    -0x33c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x33c(%rbp)
jmp    118d <main+0x5d>
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x344(%rbp)
mov    -0x344(%rbp),%eax
cmp    -0x340(%rbp),%eax
jge    1280 <main+0x150>
movslq -0x344(%rbp),%rax
mov    -0x330(%rbp,%rax,4),%esi
lea    0xd9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x344(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x344(%rbp)
jmp    123e <main+0x10e>
lea    0xd82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x350,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x330,%rsp
lea    0x10(%rsp),%rdi
mov    $0x320,%edx
xor    %esi,%esi
call   1050 <memset@plt>
lea    0xe9c(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1060 <scanf@plt>
mov    0x8(%rsp),%edx
mov    $0xffffffffffffffff,%rsi
mov    0xc(%rsp),%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%rdx,%rdx,1),%eax
cmp    %ecx,%edx
lea    (%rax,%rax,4),%eax
cmovge %edx,%eax
cltd
idiv   %ecx
mov    %eax,0x14(%rsp,%rsi,4)
lea    0x1(%rsi),%r15
test   %edx,%edx
je     11b6 <main+0x76>
cmp    $0xc6,%rsi
mov    %r15,%rsi
jne    1190 <main+0x50>
mov    %edx,0x8(%rsp)
lea    0xe45(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffffffffffff,%rbx
lea    0xe2d(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    0x14(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    11e0 <main+0xa0>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x330,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d/%d\00"
@.str.1 = [3 x i8] c"0.\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = bitcast [200 x i32]* %2 to i8*
store i32 0, i32* %5
store i32 0, i32* %6
%9 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
store i32 0, i32* %5
br label %10
10: ; preds = %36, %0
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 200
br i1 %12, label %13, label %39
13: ; preds = %10
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32, i32* %3
%19 = mul nsw i32 %18, 10
store i32 %19, i32* %3
br label %20
20: ; preds = %17, %13
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = sdiv i32 %21, %22
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [200 x i32], [200 x i32]* %2, i64 0, i64 %25
store i32 %23, i32* %26
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = srem i32 %29, %30
store i32 %31, i32* %3
%32 = load i32, i32* %3
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %20
br label %39
35: ; preds = %20
br label %36
36: ; preds = %35
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %10
39: ; preds = %34, %10
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %7
br label %41
41: ; preds = %51, %39
%42 = load i32, i32* %7
%43 = load i32, i32* %6
%44 = icmp slt i32 %42, %43
br i1 %44, label %45, label %54
45: ; preds = %41
%46 = load i32, i32* %7
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [200 x i32], [200 x i32]* %2, i64 0, i64 %47
%49 = load i32, i32* %48
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %49)
br label %51
51: ; preds = %45
%52 = load i32, i32* %7
%53 = add nsw i32 %52, 1
store i32 %53, i32* %7
br label %41
54: ; preds = %41
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d/%d\00"
@.str.1 = [3 x i8] c"0.\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [200 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [200 x i32]* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
br label %10
10: ; preds = %10, %0
%11 = phi i64 [ 0, %0 ], [ %20, %10 ]
%12 = phi i32 [ %8, %0 ], [ %18, %10 ]
%13 = icmp slt i32 %12, %9
%14 = mul nsw i32 %12, 10
%15 = select i1 %13, i32 %14, i32 %12
%16 = sdiv i32 %15, %9
%17 = getelementptr inbounds [200 x i32], [200 x i32]* %1, i64 0, i64 %11
store i32 %16, i32* %17
%18 = srem i32 %15, %9
%19 = icmp eq i32 %18, 0
%20 = add nuw nsw i64 %11, 1
%21 = icmp eq i64 %20, 200
%22 = select i1 %19, i1 true, i1 %21
br i1 %22, label %23, label %10
23: ; preds = %10
store i32 %18, i32* %2
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%25 = add nuw i64 %11, 1
%26 = and i64 %25, 4294967295
br label %29
27: ; preds = %29
%28 = call i32 @putchar(i32 10)
ret i32 0
29: ; preds = %23, %29
%30 = phi i64 [ 0, %23 ], [ %34, %29 ]
%31 = getelementptr inbounds [200 x i32], [200 x i32]* %1, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %32)
%34 = add nuw nsw i64 %30, 1
%35 = icmp eq i64 %34, %26
br i1 %35, label %27, label %29
}