#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 main() {
  int i = 0, N;
  double A, B;
  scanf(" %d", &N);
  while (i < N) {
    scanf(" %lf %lf", &A, &B);
    if (B == 0)
      printf("divisao impossivel\n");
    else
      printf("%0.1lf\n", A / B);
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11bb <main+0x9b>
lea    0xea9(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1195 <main+0x75>
jp     1195 <main+0x75>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ad <main+0x8d>
movsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
lea    0xe7b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <main+0x28>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xec3(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    11c9 <main+0x99>
lea    0xead(%rip),%r14
lea    0x10(%rsp),%r15
lea    0x8(%rsp),%rbx
lea    0xead(%rip),%r12
lea    0xe9e(%rip),%r13
xor    %ebp,%ebp
jmp    119d <main+0x6d>
nopl   0x0(%rax,%rax,1)
movsd  0x10(%rsp),%xmm0
divsd  %xmm1,%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jge    11c9 <main+0x99>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
movsd  0x8(%rsp),%xmm1
ucomisd 0xe45(%rip),%xmm1
jne    1180 <main+0x50>
jp     1180 <main+0x50>
mov    %r12,%rdi
call   1030 <puts@plt>
jmp    1194 <main+0x64>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c" %d\00"
@.str.1 = [9 x i8] c" %lf %lf\00"
@.str.2 = [20 x i8] c"divisao impossivel\0A\00"
@.str.3 = [8 x i8] c"%0.1lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
store i32 0, i32* %2
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
br label %7
7: ; preds = %22, %0
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %25
11: ; preds = %7
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double* %4, double* %5)
%13 = load double, double* %5
%14 = fcmp oeq double %13, 0.000000e+00
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %22
17: ; preds = %11
%18 = load double, double* %4
%19 = load double, double* %5
%20 = fdiv double %18, %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double %20)
br label %22
22: ; preds = %17, %15
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %7
25: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
@.str.1 = [9 x i8] c" %lf %lf\00"
@.str.3 = [8 x i8] c"%0.1lf\0A\00"
@str = [19 x i8] c"divisao impossivel\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = bitcast i32* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %25
10: ; preds = %0, %21
%11 = phi i32 [ %22, %21 ], [ 0, %0 ]
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %3)
%13 = load double, double* %3
%14 = fcmp oeq double %13, 0.000000e+00
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %21
17: ; preds = %10
%18 = load double, double* %2
%19 = fdiv double %18, %13
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double %19)
br label %21
21: ; preds = %17, %15
%22 = add nuw nsw i32 %11, 1
%23 = load i32, i32* %1
%24 = icmp slt i32 %22, %23
br i1 %24, label %10, label %25
25: ; preds = %21, %0
ret i32 0
}