#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
double log10(double);
int /*<<< orphan*/ pow(double, double);
int /*<<< orphan*/ sscanf(char *, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  int nbin;
  double xmin, xmax, logxmin, logxmax, dlogx;
  if (argc < 4) {
    fprintf(stderr, "Usage `%s' rmin rmax nbins \n", argv[0]);
    return EXIT_FAILURE;
  } else {
    sscanf(argv[1], "%lf", &xmin);
    sscanf(argv[2], "%lf", &xmax);
    sscanf(argv[3], "%d", &nbin);
  }
  assert(xmin > 0 && "rmin has to be non-zero, otherwise log is undefined");
  logxmin = log10(xmin);
  logxmax = log10(xmax);
  dlogx = (logxmax - logxmin) / (double)nbin;
  double left_edge = logxmin;
  for (int i = 0; i < nbin; i++) {
    double right_edge = left_edge + dlogx;
    fprintf(stdout, "%20.12lf %20.12lf\n", pow(10.0, left_edge),
            pow(10.0, right_edge));
    left_edge = right_edge;
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    119f <main+0x4f>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe81(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e43(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12ee <main+0x19e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe77(%rip),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe5d(%rip),%rsi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xe47(%rip),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1050 <sscanf@plt>
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x59(%rbp)
jbe    120e <main+0xbe>
mov    $0x1,%al
mov    %al,-0x59(%rbp)
jmp    120e <main+0xbe>
mov    -0x59(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  -0x20(%rbp),%xmm0
call   1070 <log10@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1070 <log10@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12e2 <main+0x192>
movsd  -0x48(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    0x2d4c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x6c(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  0xd6a(%rip),%xmm0
call   1060 <pow@plt>
cltq
mov    %rax,-0x68(%rbp)
movsd  -0x58(%rbp),%xmm1
movsd  0xd52(%rip),%xmm0
call   1060 <pow@plt>
mov    -0x6c(%rbp),%edi
mov    -0x68(%rbp),%rdx
mov    %eax,%ecx
lea    0xd9d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1262 <main+0x112>
mov    0x2cdf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
jg     118c <main+0x3c>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe8f(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x2e51(%rip),%r15
jmp    12a8 <main+0x158>
mov    0x8(%rbx),%rdi
lea    0xe8e(%rip),%r14
lea    0x10(%rsp),%rdx
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <sscanf@plt>
mov    0x10(%rbx),%rdi
lea    0x20(%rsp),%rdx
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <sscanf@plt>
mov    0x18(%rbx),%rdi
lea    0xe65(%rip),%rsi
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1050 <sscanf@plt>
movsd  0x10(%rsp),%xmm0
xorpd  %xmm1,%xmm1
xor    %edi,%edi
ucomisd %xmm1,%xmm0
seta   %dil
call   1030 <assert@plt>
movsd  0x10(%rsp),%xmm0
call   1070 <log10@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rsp),%xmm0
call   1070 <log10@plt>
mov    0x4(%rsp),%eax
mov    0x2db8(%rip),%r15
test   %eax,%eax
jle    12a8 <main+0x158>
movapd %xmm0,%xmm2
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm2
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  %xmm0,%xmm2
movsd  %xmm2,0x18(%rsp)
mov    0x2d92(%rip),%r12
lea    0xde7(%rip),%r14
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
movsd  0x18(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    (%r12),%r13d
movsd  0xd94(%rip),%xmm0
call   1060 <pow@plt>
movslq %eax,%rbx
movsd  0xd84(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   1060 <pow@plt>
mov    %r13d,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x1,%ebp
movsd  0x8(%rsp),%xmm1
cmp    0x4(%rsp),%ebp
jl     1250 <main+0x100>
mov    (%r15),%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Usage `%s' rmin rmax nbins \0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [52 x i8] c"rmin has to be non-zero, otherwise log is undefined\00"
@stdout = global i32 0
@.str.4 = [19 x i8] c"%20.12lf %20.12lf\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca i32
%14 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 4
br i1 %16, label %17, label %24
17: ; preds = %2
%18 = load i32, i32* @stderr
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = load i32, i32* @EXIT_FAILURE
store i32 %23, i32* %3
br label %78
24: ; preds = %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32 (i8*, i8*, ...) @sscanf(i8* %27, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %7)
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 2
%31 = load i8*, i8** %30
%32 = call i32 (i8*, i8*, ...) @sscanf(i8* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %8)
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 3
%35 = load i8*, i8** %34
%36 = call i32 (i8*, i8*, ...) @sscanf(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %6)
br label %37
37: ; preds = %24
%38 = load double, double* %7
%39 = fcmp ogt double %38, 0.000000e+00
br i1 %39, label %40, label %41
40: ; preds = %37
br label %41
41: ; preds = %40, %37
%42 = phi i1 [ false, %37 ], [ true, %40 ]
%43 = zext i1 %42 to i32
%44 = call i32 @assert(i32 %43)
%45 = load double, double* %7
%46 = call double @log10(double %45)
store double %46, double* %9
%47 = load double, double* %8
%48 = call double @log10(double %47)
store double %48, double* %10
%49 = load double, double* %10
%50 = load double, double* %9
%51 = fsub double %49, %50
%52 = load i32, i32* %6
%53 = sitofp i32 %52 to double
%54 = fdiv double %51, %53
store double %54, double* %11
%55 = load double, double* %9
store double %55, double* %12
store i32 0, i32* %13
br label %56
56: ; preds = %73, %41
%57 = load i32, i32* %13
%58 = load i32, i32* %6
%59 = icmp slt i32 %57, %58
br i1 %59, label %60, label %76
60: ; preds = %56
%61 = load double, double* %12
%62 = load double, double* %11
%63 = fadd double %61, %62
store double %63, double* %14
%64 = load i32, i32* @stdout
%65 = load double, double* %12
%66 = call i32 @pow(double 1.000000e+01, double %65)
%67 = sext i32 %66 to i64
%68 = inttoptr i64 %67 to i8*
%69 = load double, double* %14
%70 = call i32 @pow(double 1.000000e+01, double %69)
%71 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %68, i32 %70)
%72 = load double, double* %14
store double %72, double* %12
br label %73
73: ; preds = %60
%74 = load i32, i32* %13
%75 = add nsw i32 %74, 1
store i32 %75, i32* %13
br label %56
76: ; preds = %56
%77 = load i32, i32* @EXIT_SUCCESS
store i32 %77, i32* %3
br label %78
78: ; preds = %76, %17
%79 = load i32, i32* %3
ret i32 %79
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Usage `%s' rmin rmax nbins \0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [3 x i8] c"%d\00"
@stdout = global i32 0
@.str.4 = [19 x i8] c"%20.12lf %20.12lf\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = bitcast i32* %3 to i8*
%7 = bitcast double* %4 to i8*
%8 = bitcast double* %5 to i8*
%9 = icmp slt i32 %0, 4
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %1
%13 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %50
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = call i32 (i8*, i8*, ...) @sscanf(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %4)
%18 = getelementptr inbounds i8*, i8** %1, i64 2
%19 = load i8*, i8** %18
%20 = call i32 (i8*, i8*, ...) @sscanf(i8* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %5)
%21 = getelementptr inbounds i8*, i8** %1, i64 3
%22 = load i8*, i8** %21
%23 = call i32 (i8*, i8*, ...) @sscanf(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%24 = load double, double* %4
%25 = fcmp ogt double %24, 0.000000e+00
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
%28 = load double, double* %4
%29 = call double @log10(double %28)
%30 = load double, double* %5
%31 = call double @log10(double %30)
%32 = fsub double %31, %29
%33 = load i32, i32* %3
%34 = sitofp i32 %33 to double
%35 = fdiv double %32, %34
%36 = icmp sgt i32 %33, 0
br i1 %36, label %37, label %50
37: ; preds = %14, %37
%38 = phi i32 [ %47, %37 ], [ 0, %14 ]
%39 = phi double [ %40, %37 ], [ %29, %14 ]
%40 = fadd double %35, %39
%41 = load i32, i32* @stdout
%42 = call i32 @pow(double 1.000000e+01, double %39)
%43 = sext i32 %42 to i64
%44 = inttoptr i64 %43 to i8*
%45 = call i32 @pow(double 1.000000e+01, double %40)
%46 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %44, i32 %45)
%47 = add nuw nsw i32 %38, 1
%48 = load i32, i32* %3
%49 = icmp slt i32 %47, %48
br i1 %49, label %37, label %50
50: ; preds = %37, %14, %10
%51 = phi i32* [ @EXIT_FAILURE, %10 ], [ @EXIT_SUCCESS, %14 ], [ @EXIT_SUCCESS, %37 ]
%52 = load i32, i32* %51
ret i32 %52
}