xunge/DecIR huggingface dataset:
/* Type definitions */
struct pending {
  int dummy;
};

/* Variables and functions */
struct pending *pending_find(int, int, int);
int /*<<< orphan*/ player_pending_delete(struct pending *);
int player_remove_requests(int p, int p1, int type) {
  struct pending *ptr;
  while ((ptr = pending_find(p, p1, type))) {
    player_pending_delete(ptr);
  }
  return 0;
}


x86 assembly (clang, -O0):
<player_remove_requests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <pending_find@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     115b <player_remove_requests+0x3b>
mov    -0x18(%rbp),%rdi
call   1030 <player_pending_delete@plt>
jmp    1131 <player_remove_requests+0x11>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<player_remove_requests>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
nopl   0x0(%rax,%rax,1)
call   1040 <pending_find@plt>
test   %rax,%rax
je     114b <player_remove_requests+0x2b>
mov    %rax,%rdi
call   1030 <player_pending_delete@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
jmp    1130 <player_remove_requests+0x10>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.pending = type { i32 }
define i32 @player_remove_requests(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.pending*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
br label %8
8: ; preds = %14, %3
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call %struct.pending* @pending_find(i32 %9, i32 %10, i32 %11)
store %struct.pending* %12, %struct.pending** %7
%13 = icmp ne %struct.pending* %12, null
br i1 %13, label %14, label %17
14: ; preds = %8
%15 = load %struct.pending*, %struct.pending** %7
%16 = call i32 @player_pending_delete(%struct.pending* %15)
br label %8
17: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
%struct.pending = type { i32 }
define i32 @player_remove_requests(i32 %0, i32 %1, i32 %2) {
%4 = tail call %struct.pending* @pending_find(i32 %0, i32 %1, i32 %2)
%5 = icmp eq %struct.pending* %4, null
br i1 %5, label %11, label %6
6: ; preds = %3, %6
%7 = phi %struct.pending* [ %9, %6 ], [ %4, %3 ]
%8 = tail call i32 @player_pending_delete(%struct.pending* %7)
%9 = tail call %struct.pending* @pending_find(i32 %0, i32 %1, i32 %2)
%10 = icmp eq %struct.pending* %9, null
br i1 %10, label %11, label %6
11: ; preds = %6, %3
ret i32 0
}
int f2(void) { return 3.1f; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @f2() {
ret i32 3
}

LLVM IR (-O2):
define i32 @f2() {
ret i32 3
}
double vector_magnitude_squared_3d(const double v[3]) {
  return v[0] * v[0] + v[1] * v[1] + v[2] * v[2];
}


x86 assembly (clang, -O0):
<vector_magnitude_squared_3d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_magnitude_squared_3d>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @vector_magnitude_squared_3d(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = call double @llvm.fmuladd.f64(double %5, double %8, double %15)
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = call double @llvm.fmuladd.f64(double %19, double %22, double %16)
ret double %23
}

LLVM IR (-O2):
define double @vector_magnitude_squared_3d(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
void main() {
  int i;
  for (i = 0; i <= 255; i++) {
    putchar(' ');
    putchar(i);
    putchar(' ');
    if ((i + 1) % 16 == 0)
      printf("\n\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jg     1191 <main+0x71>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    117e <main+0x5e>
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
jmp    1183 <main+0x63>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
lea    0xed4(%rip),%rbx
jmp    1138 <main+0x18>
xchg   %ax,%ax
cmp    $0x100,%ebp
je     1168 <main+0x48>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl %bpl,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
test   $0xf,%bpl
jne    1130 <main+0x10>
mov    %rbx,%rdi
call   1040 <puts@plt>
jmp    1130 <main+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0A\0A\00"
define void @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %18, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 255
br i1 %4, label %5, label %21
5: ; preds = %2
%6 = call i32 @putchar(i8 signext 32)
%7 = load i32, i32* %1
%8 = trunc i32 %7 to i8
%9 = call i32 @putchar(i8 signext %8)
%10 = call i32 @putchar(i8 signext 32)
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
%13 = srem i32 %12, 16
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %5
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %5
br label %18
18: ; preds = %17
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %2
21: ; preds = %2
ret void
}

LLVM IR (-O2):
@str = [2 x i8] c"\0A\00"
define void @main() {
br label %1
1: ; preds = %0, %12
%2 = phi i32 [ 0, %0 ], [ %7, %12 ]
%3 = tail call i32 @putchar(i8 signext 32)
%4 = trunc i32 %2 to i8
%5 = tail call i32 @putchar(i8 signext %4)
%6 = tail call i32 @putchar(i8 signext 32)
%7 = add nuw nsw i32 %2, 1
%8 = and i32 %7, 15
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %12
12: ; preds = %1, %10
%13 = icmp eq i32 %7, 256
br i1 %13, label %14, label %1
14: ; preds = %12
ret void
}
/* Variables and functions */
double exp(double);
DBO(double DBO) {
  double Q3, A = 102.6, B = -0.1101;
  if (DBO > 30) {
    return 2.0;
  } else {
    Q3 = A * exp((B * DBO));
  }
  return Q3;
}


x86 assembly (clang, -O0):
<DBO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeeb(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xebc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    115a <DBO+0x4a>
movl   $0x2,-0x4(%rbp)
jmp    118c <DBO+0x7c>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DBO>:
push   %rax
mov    $0x2,%eax
ucomisd 0xee2(%rip),%xmm0
ja     1139 <DBO+0x29>
mulsd  0xee0(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xedb(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @DBO(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double 1.026000e+02, double* %5
store double -1.101000e-01, double* %6
%7 = load double, double* %3
%8 = fcmp ogt double %7, 3.000000e+01
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 2, i32* %2
br label %20
10: ; preds = %1
%11 = load double, double* %5
%12 = load double, double* %6
%13 = load double, double* %3
%14 = fmul double %12, %13
%15 = call double @exp(double %14)
%16 = fmul double %11, %15
store double %16, double* %4
br label %17
17: ; preds = %10
%18 = load double, double* %4
%19 = fptosi double %18 to i32
store i32 %19, i32* %2
br label %20
20: ; preds = %17, %9
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @DBO(double %0) {
%2 = fcmp ogt double %0, 3.000000e+01
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = fmul double %0, -1.101000e-01
%5 = tail call double @exp(double %4)
%6 = fmul double %5, 1.026000e+02
%7 = fptosi double %6 to i32
br label %8
8: ; preds = %1, %3
%9 = phi i32 [ %7, %3 ], [ 2, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int uint32_t;
typedef int volatile uint16_t;

/* Variables and functions */
int puts(const char *str) {
  while (*str) {
    while (
        !(*(((volatile uint32_t *)(((volatile uint32_t)0x40004400) + 0x00))) &
          ((uint16_t)0x0080)))
      ;
    *(((volatile uint32_t *)(((volatile uint32_t)0x40004400) + 0x04))) =
        *str++ & 0xFF;
  }
  return 0;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1164 <puts+0x64>
jmp    111a <puts+0x1a>
mov    $0x40004400,%eax
mov    (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113b <puts+0x3b>
jmp    1140 <puts+0x40>
jmp    111a <puts+0x1a>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%ecx
and    $0xff,%ecx
mov    $0x40004404,%eax
mov    %ecx,(%rax)
jmp    1108 <puts+0x8>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x33>
cs nopw 0x0(%rax,%rax,1)
testl  $0x80,0x40004400
je     1110 <puts+0x10>
movzbl %al,%eax
mov    %eax,0x40004404
movzbl 0x1(%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <puts+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %14, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %20
7: ; preds = %3
br label %8
8: ; preds = %13, %7
%9 = load volatile i32, i32* inttoptr (i64 1073759232 to i32*)
%10 = and i32 %9, 128
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %14
13: ; preds = %8
br label %8
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %2
%17 = load i8, i8* %15
%18 = sext i8 %17 to i32
%19 = and i32 %18, 255
store volatile i32 %19, i32* inttoptr (i64 1073759236 to i32*)
br label %3
20: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %14, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
br label %7
7: ; preds = %4, %7
%8 = load volatile i32, i32* inttoptr (i64 1073759232 to i32*)
%9 = and i32 %8, 128
%10 = icmp eq i32 %9, 0
br i1 %10, label %7, label %11
11: ; preds = %7
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = zext i8 %5 to i32
store volatile i32 %13, i32* inttoptr (i64 1073759236 to i32*)
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %11, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MON_12;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_mon_12() { return nl_langinfo(MON_12); }


x86 assembly (clang, -O0):
<langinfo_mon_12>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_mon_12>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@MON_12 = global i32 0
define i8* @langinfo_mon_12() {
%1 = load i32, i32* @MON_12
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@MON_12 = global i32 0
define i8* @langinfo_mon_12() {
%1 = load i32, i32* @MON_12
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fprintf(stderr, "Usage: bruteln existing symlink\n");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Usage: bruteln existing symlink\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Usage: bruteln existing symlink\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
struct termios {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ TCSAFLUSH;
int fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ tcsetattr(int, int /*<<< orphan*/, struct termios *);
void tty_restore_mode(FILE *istream, struct termios *old_termios) {
  int fd = fileno(istream);
  tcsetattr(fd, TCSAFLUSH, old_termios);
}


x86 assembly (clang, -O0):
<tty_restore_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fileno@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1040 <tcsetattr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_restore_mode>:
push   %rbx
mov    %rsi,%rbx
call   1030 <fileno@plt>
mov    0x2eb8(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <tcsetattr@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@TCSAFLUSH = global i32 0
define void @tty_restore_mode(i32* %0, %struct.termios* %1) {
%3 = alloca i32*
%4 = alloca %struct.termios*
%5 = alloca i32
store i32* %0, i32** %3
store %struct.termios* %1, %struct.termios** %4
%6 = load i32*, i32** %3
%7 = call i32 @fileno(i32* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* @TCSAFLUSH
%10 = load %struct.termios*, %struct.termios** %4
%11 = call i32 @tcsetattr(i32 %8, i32 %9, %struct.termios* %10)
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@TCSAFLUSH = global i32 0
define void @tty_restore_mode(i32* nocapture %0, %struct.termios* %1) {
%3 = tail call i32 @fileno(i32* %0)
%4 = load i32, i32* @TCSAFLUSH
%5 = tail call i32 @tcsetattr(i32 %3, i32 %4, %struct.termios* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage:\n");
  printf("    draw -f fractal -n n_iter\n");
  printf("OR\n");
  printf("    draw -f generic2d -n n_iter -p file\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [31 x i8] c" draw -f fractal -n n_iter\0A\00"
@.str.2 = [4 x i8] c"OR\0A\00"
@.str.3 = [41 x i8] c" draw -f generic2d -n n_iter -p file\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.4 = [30 x i8] c" draw -f fractal -n n_iter\00"
@str.5 = [3 x i8] c"OR\00"
@str.6 = [40 x i8] c" draw -f generic2d -n n_iter -p file\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
void cmd_getpid(int argc, char *argv[]) { printf("%i\n", getpid()); }


x86 assembly (clang, -O0):
<cmd_getpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_getpid>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define void @cmd_getpid(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @getpid()
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define void @cmd_getpid(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
int alchemist(element)
int element;
{
  switch (element) {
  case 70:
  case 71:
  case 75:
  case 76:
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<alchemist>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffba,%eax
sub    $0x2,%eax
jb     1132 <alchemist+0x32>
jmp    111e <alchemist+0x1e>
mov    -0xc(%rbp),%eax
add    $0xffffffb5,%eax
sub    $0x1,%eax
ja     113e <alchemist+0x3e>
jmp    1132 <alchemist+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1145 <alchemist+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alchemist>:
add    $0xffffffba,%edi
xor    %eax,%eax
cmp    $0x6,%edi
ja     1117 <alchemist+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @alchemist(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 70, label %5
i32 71, label %5
i32 75, label %5
i32 76, label %5
]
5: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@switch.table.alchemist = [7 x i32] [i32 1, i32 1, i32 0, i32 0, i32 0, i32 1, i32 1]
define i32 @alchemist(i32 %0) {
%2 = add i32 %0, -70
%3 = icmp ult i32 %2, 7
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table.alchemist, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int f216(int *);
int f217(int *p) { return f216(p); }


x86 assembly (clang, -O0):
<f217>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <f216@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f217>:
jmp    1030 <f216@plt>

LLVM IR (-O0):
define i32 @f217(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @f216(i32* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @f217(i32* %0) {
%2 = tail call i32 @f216(i32* %0)
ret i32 %2
}
unsigned short unsignedshort_ignoring_signedshort(unsigned short x,
                                                  signed short y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshort_ignoring_signedshort>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedshort_ignoring_signedshort>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @unsignedshort_ignoring_signedshort(i16 zeroext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @unsignedshort_ignoring_signedshort(i16 returned zeroext %0, i16 signext %1) {
ret i16 %0
}
/* Variables and functions */
int /*<<< orphan*/ pop_stack(char *);
void read_eoe_arg(void) {
  pop_stack("fixR");
  pop_stack("fixL");
}


x86 assembly (clang, -O0):
<read_eoe_arg>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <pop_stack@plt>
lea    0xede(%rip),%rdi
call   1030 <pop_stack@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_eoe_arg>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <pop_stack@plt>
lea    0xee1(%rip),%rdi
pop    %rax
jmp    1030 <pop_stack@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"fixR\00"
@.str.1 = [5 x i8] c"fixL\00"
define void @read_eoe_arg() {
%1 = call i32 @pop_stack(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @pop_stack(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"fixR\00"
@.str.1 = [5 x i8] c"fixL\00"
define void @read_eoe_arg() {
%1 = tail call i32 @pop_stack(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @pop_stack(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void sig_handler_1(int signo) { abort(); }


x86 assembly (clang, -O0):
<sig_handler_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<sig_handler_1>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @sig_handler_1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @sig_handler_1(i32 %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int getnb();
char endline() {
  int c;
  c = getnb();
  return ((c == '\0' || c == ';') ? 0 : c);
}


x86 assembly (clang, -O0):
<endline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getnb@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1136 <endline+0x26>
cmpl   $0x3b,-0x4(%rbp)
jne    1140 <endline+0x30>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <endline+0x36>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endline>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getnb@plt>
cmp    $0x3b,%eax
cmovne %eax,%ebx
test   %eax,%eax
cmovne %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @endline() {
%1 = alloca i32
%2 = call i32 (...) @getnb()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 59
br i1 %7, label %8, label %9
8: ; preds = %5, %0
br label %11
9: ; preds = %5
%10 = load i32, i32* %1
br label %11
11: ; preds = %9, %8
%12 = phi i32 [ 0, %8 ], [ %10, %9 ]
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @endline() {
%1 = tail call i32 (...) @getnb()
%2 = icmp eq i32 %1, 0
%3 = icmp eq i32 %1, 59
%4 = or i1 %2, %3
%5 = trunc i32 %1 to i8
%6 = select i1 %4, i8 0, i8 %5
ret i8 %6
}
/* Variables and functions */
size_t strlen(const char *s) {
  const char *sc;
  for (sc = s; *sc != '\0'; ++sc) {
    ;
  }
  return sc - s;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
jmp    1125 <strlen+0x25>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i64 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
br label %11
11: ; preds = %10
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
br label %5
14: ; preds = %5
%15 = load i8*, i8** %3
%16 = load i8*, i8** %2
%17 = ptrtoint i8* %15 to i64
%18 = ptrtoint i8* %16 to i64
%19 = sub i64 %17, %18
ret i64 %19
}

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
void kmalloc_count(struct page *page, int to_alloc) {}


x86 assembly (clang, -O0):
<kmalloc_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmalloc_count>:
ret

LLVM IR (-O0):
%struct.page = type opaque
define void @kmalloc_count(%struct.page* %0, i32 %1) {
%3 = alloca %struct.page*
%4 = alloca i32
store %struct.page* %0, %struct.page** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.page = type opaque
define void @kmalloc_count(%struct.page* nocapture %0, i32 %1) {
ret void
}
char *fun6() { return "fun6"; }


x86 assembly (clang, -O0):
<fun6>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun6>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fun6\00"
define i8* @fun6() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"fun6\00"
define i8* @fun6() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
unsigned int BKDRHash(char *str) {
  unsigned int seed = 131;
  unsigned int hash = 0;
  while (*str) {
    hash = hash * seed + (*str++);
  }
  return hash;
}


x86 assembly (clang, -O0):
<BKDRHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x83,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <BKDRHash+0x46>
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <BKDRHash+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BKDRHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <BKDRHash+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
imul   $0x83,%eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <BKDRHash+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @BKDRHash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 131, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = mul i32 %10, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
%15 = load i8, i8* %13
%16 = sext i8 %15 to i32
%17 = add i32 %12, %16
store i32 %17, i32* %4
br label %5
18: ; preds = %5
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @BKDRHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 131
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *google_chart_get_visualization_function_name(int chart_number) {
  static char visualization_function_name[32];
  sprintf(visualization_function_name, "drawVisualization%d", chart_number);
  return visualization_function_name;
}


x86 assembly (clang, -O0):
<google_chart_get_visualization_function_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<google_chart_get_visualization_function_name>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@google_chart_get_visualization_function_name.visualization_function_name = internal global [32 x i8] zeroinitializer
@.str = [20 x i8] c"drawVisualization%d\00"
define i8* @google_chart_get_visualization_function_name(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @google_chart_get_visualization_function_name.visualization_function_name, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @google_chart_get_visualization_function_name.visualization_function_name, i64 0, i64 0)
}

LLVM IR (-O2):
@google_chart_get_visualization_function_name.visualization_function_name = internal global [32 x i8] zeroinitializer
@.str = [20 x i8] c"drawVisualization%d\00"
define i8* @google_chart_get_visualization_function_name(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @google_chart_get_visualization_function_name.visualization_function_name, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @google_chart_get_visualization_function_name.visualization_function_name, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ TIOCGSID;
scalar_t__ _ioctl(int, int /*<<< orphan*/, int *);
pid_t tcgetsid(int fd) {
  int s;
  if (_ioctl(fd, TIOCGSID, &s) < 0)
    return ((pid_t)-1);
  return ((pid_t)s);
}


x86 assembly (clang, -O0):
<tcgetsid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <_ioctl@plt>
cmp    $0x0,%rax
jge    1146 <tcgetsid+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <tcgetsid+0x3c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcgetsid>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <_ioctl@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
js     1135 <tcgetsid+0x25>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@TIOCGSID = global i32 0
define i32 @tcgetsid(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @TIOCGSID
%7 = call i64 @_ioctl(i32 %5, i32 %6, i32* %4)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@TIOCGSID = global i32 0
define i32 @tcgetsid(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @TIOCGSID
%5 = call i64 @_ioctl(i32 %0, i32 %4, i32* %2)
%6 = icmp slt i64 %5, 0
%7 = load i32, i32* %2
%8 = select i1 %6, i32 -1, i32 %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int try_parse_int_imp(char *, void *, int, int);
bool try_parse_uint64(char *str, uint64_t *value_ptr) {
  return try_parse_int_imp(str, (void *)value_ptr, sizeof(uint64_t), false);
}


x86 assembly (clang, -O0):
<try_parse_uint64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <try_parse_int_imp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_parse_uint64>:
mov    $0x4,%edx
xor    %ecx,%ecx
jmp    1030 <try_parse_int_imp@plt>

LLVM IR (-O0):
define i32 @try_parse_uint64(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = bitcast i32* %6 to i8*
%8 = call i32 @try_parse_int_imp(i8* %5, i8* %7, i32 4, i32 0)
ret i32 %8
}

LLVM IR (-O2):
define i32 @try_parse_uint64(i8* %0, i32* %1) {
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @try_parse_int_imp(i8* %0, i8* %3, i32 4, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dnsquery(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  char addr[100];
  printf("Enter a domain name:");
  gets(addr);
  dnsquery(addr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x70(%rbp),%rdi
call   1050 <dnsquery@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %rbx,%rdi
call   1050 <dnsquery@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Enter a domain name:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i32 @dnsquery(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Enter a domain name:\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @dnsquery(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ helloFork(char *);
int makeChild(char *__command) {
  int pid;
  if ((pid = fork()) == 0) {
    helloFork(__command);
    exit(0);
  } else if (pid == -1) {
    return -1;
  } else {
    return pid;
  }
}


x86 assembly (clang, -O0):
<makeChild>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jne    115f <makeChild+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <helloFork@plt>
xor    %edi,%edi
call   1040 <exit@plt>
cmpl   $0xffffffff,-0x14(%rbp)
jne    1175 <makeChild+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    117b <makeChild+0x4b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeChild>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <fork@plt>
test   %eax,%eax
je     1141 <makeChild+0x11>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <helloFork@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @makeChild(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = call i32 (...) @fork()
store i32 %5, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @helloFork(i8* %8)
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %1
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 -1, i32* %2
br label %17
15: ; preds = %11
%16 = load i32, i32* %4
store i32 %16, i32* %2
br label %17
17: ; preds = %15, %14
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @makeChild(i8* %0) {
%2 = tail call i32 (...) @fork()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @helloFork(i8* %0)
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %1
ret i32 %2
}
long labs(long x) {
  if (x < 0) {
    x = -x;
  }
  return x;
}


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    111d <labs+0x1d>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<labs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
store i64 %7, i64* %2
br label %8
8: ; preds = %5, %1
%9 = load i64, i64* %2
ret i64 %9
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_target_system_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(1, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_target_system_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_target_system_to_container>:
mov    $0x1,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_target_system_to_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 1, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_target_system_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 1, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int do_sync_intr(unsigned char *);
int sync_intr(unsigned char type) {
  int r;
  unsigned char data[64];
  while (1) {
    r = do_sync_intr(data);
    if (r < 0)
      return r;
    if (data[0] == type)
      return 0;
  }
}


x86 assembly (clang, -O0):
<sync_intr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    -0x50(%rbp),%rdi
call   1030 <do_sync_intr@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    113f <sync_intr+0x2f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <sync_intr+0x50>
movzbl -0x50(%rbp),%eax
movzbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    115b <sync_intr+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1160 <sync_intr+0x50>
jmp    111e <sync_intr+0xe>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_intr>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <do_sync_intr@plt>
test   %eax,%eax
js     1133 <sync_intr+0x23>
cmp    %bl,(%rsp)
jne    1120 <sync_intr+0x10>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @sync_intr(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
%5 = alloca [64 x i8]
store i8 %0, i8* %3
br label %6
6: ; preds = %1, %21
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%8 = call i32 @do_sync_intr(i8* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %22
13: ; preds = %6
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = icmp eq i32 %16, %18
br i1 %19, label %20, label %21
20: ; preds = %13
store i32 0, i32* %2
br label %22
21: ; preds = %13
br label %6
22: ; preds = %20, %11
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @sync_intr(i8 zeroext %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %7, %1
%5 = call i32 @do_sync_intr(i8* %3)
%6 = icmp slt i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = load i8, i8* %3
%9 = icmp eq i8 %8, %0
br i1 %9, label %10, label %4
10: ; preds = %7, %4
%11 = phi i32 [ %5, %4 ], [ 0, %7 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ isdigit(int);
char tolower(int);
int hexCharToInt(int c) {
  if (isdigit(c))
    return c - '0';
  return tolower(c) - 'a' + 10;
}


x86 assembly (clang, -O0):
<hexCharToInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     114b <hexCharToInt+0x2b>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    115f <hexCharToInt+0x3f>
mov    -0x8(%rbp),%edi
call   1040 <tolower@plt>
movsbl %al,%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexCharToInt>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
je     1132 <hexCharToInt+0x12>
add    $0xffffffd0,%ebx
jmp    113f <hexCharToInt+0x1f>
mov    %ebx,%edi
call   1040 <tolower@plt>
movsbl %al,%ebx
add    $0xffffffa9,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hexCharToInt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @isdigit(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 48
store i32 %9, i32* %2
br label %16
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call signext i8 @tolower(i32 %11)
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 97
%15 = add nsw i32 %14, 10
store i32 %15, i32* %2
br label %16
16: ; preds = %10, %7
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @hexCharToInt(i32 %0) {
%2 = tail call i64 @isdigit(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = add nsw i32 %0, -48
br label %10
6: ; preds = %1
%7 = tail call signext i8 @tolower(i32 %0)
%8 = sext i8 %7 to i32
%9 = add nsw i32 %8, -87
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ %5, %4 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ sputtype(char *, int);
int puttype(int m) {
  char buf[128];
  if (sputtype(buf, m)) {
    printf("%s", buf);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<puttype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <sputtype@plt>
cmp    $0x0,%rax
je     1166 <puttype+0x46>
lea    -0x90(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    116d <puttype+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puttype>:
sub    $0x88,%rsp
mov    %edi,%esi
mov    %rsp,%rdi
call   1040 <sputtype@plt>
test   %rax,%rax
je     1152 <puttype+0x32>
lea    0xec3(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x88,%rsp
ret
xor    %eax,%eax
add    $0x88,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @puttype(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [128 x i8]
store i32 %0, i32* %3
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i64 @sputtype(i8* %5, i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @puttype(i32 %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i64 @sputtype(i8* %3, i32 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ 1, %6 ], [ 0, %1 ]
ret i32 %9
}