#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 atoi(char *);
int /*<<< orphan*/ printargs(int, char **);
int /*<<< orphan*/ printf(char *, int, int, double);
double root(int, int);
int /*<<< orphan*/ trackoff();
int /*<<< orphan*/ trackon();
int /*<<< orphan*/ trackprint();
int main(int argc, char *argv[]) {
  printargs(argc, argv);
  int pwr = atoi(argv[1]);
  int num = atoi(argv[2]);
  trackon();
  printf("%dth root of %d = %f\n", pwr, num, root(pwr, num));
  trackoff();
  trackprint();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <printargs@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <trackon@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1060 <root@plt>
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe23(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <trackoff@plt>
mov    $0x0,%al
call   1090 <trackprint@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <printargs@plt>
mov    0x8(%rbx),%rdi
call   1080 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1080 <atoi@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <trackon@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1060 <root@plt>
lea    0xe58(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <trackoff@plt>
xor    %eax,%eax
call   1090 <trackprint@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"%dth root of %d = %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32 @printargs(i32 %8, i8** %9)
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
store i32 %14, i32* %6
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
store i32 %18, i32* %7
%19 = call i32 (...) @trackon()
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = call double @root(i32 %22, i32 %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %21, double %24)
%26 = call i32 (...) @trackoff()
%27 = call i32 (...) @trackprint()
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"%dth root of %d = %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @printargs(i32 %0, i8** %1)
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @atoi(i8* %5)
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = tail call i32 (...) @trackon()
%11 = tail call double @root(i32 %6, i32 %9)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %9, double %11)
%13 = tail call i32 (...) @trackoff()
%14 = tail call i32 (...) @trackprint()
ret i32 0
}