xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
void popMul() {
  emitln("pop\t%%ebx");
  emitln("mul\t%%ebx");
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"pop\09%%ebx\00"
@.str.1 = [10 x i8] c"mul\09%%ebx\00"
define void @popMul() {
%1 = call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"pop\09%%ebx\00"
@.str.1 = [10 x i8] c"mul\09%%ebx\00"
define void @popMul() {
%1 = tail call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int htonl(int);
void ints_array_htonl(int *netlong, int nmemb) {
  int i;
  for (i = 0; i < nmemb; i++)
    netlong[i] = htonl(netlong[i]);
}


x86 assembly (clang, -O0):
<ints_array_htonl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115d <ints_array_htonl+0x4d>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <htonl@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <ints_array_htonl+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ints_array_htonl>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1146 <ints_array_htonl+0x36>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
call   1030 <htonl@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <ints_array_htonl+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ints_array_htonl(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %21, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @htonl(i32 %15)
%17 = load i32*, i32** %3
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
store i32 %16, i32* %20
br label %21
21: ; preds = %10
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @ints_array_htonl(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @htonl(i32 %9)
store i32 %10, i32* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int oss_unpause(void) { return 0; }


x86 assembly (clang, -O0):
<oss_unpause>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<oss_unpause>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @oss_unpause() {
ret i32 0
}

LLVM IR (-O2):
define i32 @oss_unpause() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo();
int main(void) {
  if (foo() != 5)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0x5,%eax
je     1146 <main+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
cmp    $0x5,%eax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = icmp ne i32 %2, 5
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 5
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
size_t strlen(const char *string) {
  abort();
  return -1;
}


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

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

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned int getmsec(void) {
  struct timeval tt1;
  gettimeofday(&tt1, NULL);
  return (unsigned int)(((tt1.tv_sec) << 8) | ((tt1.tv_usec) >> 12));
}


x86 assembly (clang, -O0):
<getmsec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
sar    $0xc,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmsec>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%ecx
mov    0x4(%rsp),%eax
shl    $0x8,%ecx
sar    $0xc,%eax
or     %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @getmsec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = ashr i32 %7, 12
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @getmsec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = ashr i32 %8, 12
%10 = or i32 %9, %6
ret i32 %10
}
/* Variables and functions */
size_t strlen(const char *a) {
  const char *x = a + 1;
  while (*a++ != 0)
    ;
  return a - x;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1134 <strlen+0x34>
jmp    1114 <strlen+0x14>
mov    -0x8(%rbp),%rax
mov    -0x10(%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
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %3
br label %6
6: ; preds = %12, %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %2
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %6
br label %6
13: ; preds = %6
%14 = load i8*, i8** %2
%15 = load i8*, i8** %3
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
ret i64 %18
}

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = ptrtoint i8* %4 to i64
%10 = ptrtoint i8* %8 to i64
%11 = sub i64 %9, %10
ret i64 %11
}
/* Variables and functions */
char *addColor(char *, char *);
char *inverse(char *str) { return addColor("7", str); }


x86 assembly (clang, -O0):
<inverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <addColor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverse>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <addColor@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"7\00"
define i8* @inverse(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @addColor(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [2 x i8] c"7\00"
define i8* @inverse(i8* %0) {
%2 = tail call i8* @addColor(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Variables and functions */
bool fspath_exists(const char path[]) { return false; }


x86 assembly (clang, -O0):
<fspath_exists>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fspath_exists>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @fspath_exists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @fspath_exists(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ tell_gnugo(char *, char const *);
void error(const char *msg) {
  fprintf(stderr, "metamachine: %s\n", msg);
  tell_gnugo("quit\n", msg);
  abort();
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1050 <tell_gnugo@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1050 <tell_gnugo@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"metamachine: %s\0A\00"
@.str.1 = [6 x i8] c"quit\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @tell_gnugo(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"metamachine: %s\0A\00"
@.str.1 = [6 x i8] c"quit\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @tell_gnugo(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 (...) @abort()
unreachable
}
void PendSVC(void) {}


x86 assembly (clang, -O0):
<PendSVC>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @PendSVC() {
ret void
}

LLVM IR (-O2):
define void @PendSVC() {
ret void
}
void mfm_drive_select(int drive_id, int side) {}


x86 assembly (clang, -O0):
<mfm_drive_select>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @mfm_drive_select(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @mfm_drive_select(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
double const fabs(double const);
int /*<<< orphan*/ kdAssert(int, char const *);
void kdAssertDoubleEquals(const double expected, const double actual,
                          const double delta, const char *message) {
  kdAssert(fabs(expected - actual) <= delta, message);
}


x86 assembly (clang, -O0):
<kdAssertDoubleEquals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1040 <fabs@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x20(%rbp),%rsi
call   1030 <kdAssert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kdAssertDoubleEquals>:
mov    %rdi,%rsi
subsd  %xmm1,%xmm0
andpd  0xee1(%rip),%xmm0
xor    %edi,%edi
ucomisd %xmm0,%xmm2
setae  %dil
jmp    1030 <kdAssert@plt>

LLVM IR (-O0):
define void @kdAssertDoubleEquals(double %0, double %1, double %2, i8* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i8*
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store i8* %3, i8** %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = fsub double %9, %10
%12 = call double @fabs(double %11)
%13 = load double, double* %7
%14 = fcmp ole double %12, %13
%15 = zext i1 %14 to i32
%16 = load i8*, i8** %8
%17 = call i32 @kdAssert(i32 %15, i8* %16)
ret void
}

LLVM IR (-O2):
define void @kdAssertDoubleEquals(double %0, double %1, double %2, i8* %3) {
%5 = fsub double %0, %1
%6 = tail call double @llvm.fabs.f64(double %5)
%7 = fcmp ole double %6, %2
%8 = zext i1 %7 to i32
%9 = tail call i32 @kdAssert(i32 %8, i8* %3)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
scalar_t__ sqrt(double);
void fibonacci_cb(uint64_t fib_num, void *ctx) {
  double *fibb_sum = (double *)ctx;
  *fibb_sum += sqrt((double)fib_num);
}


x86 assembly (clang, -O0):
<fibonacci_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
cvtsi2sd %rax,%xmm0
mov    -0x18(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci_cb>:
push   %rbx
mov    %rsi,%rbx
cvtsi2sd %rdi,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rbx),%xmm0
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @fibonacci_cb(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca double*
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
store double* %7, double** %5
%8 = load i64, i64* %3
%9 = sitofp i64 %8 to double
%10 = call i64 @sqrt(double %9)
%11 = sitofp i64 %10 to double
%12 = load double*, double** %5
%13 = load double, double* %12
%14 = fadd double %13, %11
store double %14, double* %12
ret void
}

LLVM IR (-O2):
define void @fibonacci_cb(i64 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to double*
%4 = sitofp i64 %0 to double
%5 = tail call i64 @sqrt(double %4)
%6 = sitofp i64 %5 to double
%7 = load double, double* %3
%8 = fadd double %7, %6
store double %8, double* %3
ret void
}
double power(double a, int n) {
  double ans = 1.0;
  for (int i = 0; i < n; i++)
    ans *= a;
  return ans;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1149 <power+0x49>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1120 <power+0x20>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %edi,%edi
jle    111b <power+0x1b>
lea    -0x1(%rdi),%ecx
mov    %edi,%eax
and    $0x7,%eax
cmp    $0x7,%ecx
jae    1124 <power+0x24>
movsd  0xee7(%rip),%xmm1
jmp    1155 <power+0x55>
movsd  0xedd(%rip),%xmm0
ret
and    $0xfffffff8,%edi
movsd  0xed1(%rip),%xmm1
nop
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
add    $0xfffffff8,%edi
jne    1130 <power+0x30>
test   %eax,%eax
je     1169 <power+0x69>
nopl   0x0(%rax)
mulsd  %xmm0,%xmm1
add    $0xffffffff,%eax
jne    1160 <power+0x60>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @power(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
%6 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
store double 1.000000e+00, double* %5
store i32 0, i32* %6
br label %7
7: ; preds = %15, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load double, double* %3
%13 = load double, double* %5
%14 = fmul double %13, %12
store double %14, double* %5
br label %15
15: ; preds = %11
%16 = load i32, i32* %6
%17 = add nsw i32 %16, 1
store i32 %17, i32* %6
br label %7
18: ; preds = %7
%19 = load double, double* %5
ret double %19
}

LLVM IR (-O2):
define double @power(double %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %20
4: ; preds = %2
%5 = add i32 %1, -1
%6 = and i32 %1, 7
%7 = icmp ult i32 %5, 7
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = and i32 %1, -8
br label %22
10: ; preds = %22, %4
%11 = phi double [ undef, %4 ], [ %32, %22 ]
%12 = phi double [ 1.000000e+00, %4 ], [ %32, %22 ]
%13 = icmp eq i32 %6, 0
br i1 %13, label %20, label %14
14: ; preds = %10, %14
%15 = phi double [ %17, %14 ], [ %12, %10 ]
%16 = phi i32 [ %18, %14 ], [ 0, %10 ]
%17 = fmul double %15, %0
%18 = add i32 %16, 1
%19 = icmp eq i32 %18, %6
br i1 %19, label %20, label %14
20: ; preds = %10, %14, %2
%21 = phi double [ 1.000000e+00, %2 ], [ %11, %10 ], [ %17, %14 ]
ret double %21
22: ; preds = %22, %8
%23 = phi double [ 1.000000e+00, %8 ], [ %32, %22 ]
%24 = phi i32 [ 0, %8 ], [ %33, %22 ]
%25 = fmul double %23, %0
%26 = fmul double %25, %0
%27 = fmul double %26, %0
%28 = fmul double %27, %0
%29 = fmul double %28, %0
%30 = fmul double %29, %0
%31 = fmul double %30, %0
%32 = fmul double %31, %0
%33 = add i32 %24, 8
%34 = icmp eq i32 %33, %9
br i1 %34, label %10, label %22
}
/* Variables and functions */
int /*<<< orphan*/ MAP_PRIVATE;
void *pft_mmap(size_t, int /*<<< orphan*/, int /*<<< orphan*/ *);
void *valloc_private(size_t size) { return pft_mmap(size, MAP_PRIVATE, NULL); }


x86 assembly (clang, -O0):
<valloc_private>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <pft_mmap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valloc_private>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <pft_mmap@plt>

LLVM IR (-O0):
@MAP_PRIVATE = global i32 0
define i8* @valloc_private(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i32, i32* @MAP_PRIVATE
%5 = call i8* @pft_mmap(i64 %3, i32 %4, i32* null)
ret i8* %5
}

LLVM IR (-O2):
@MAP_PRIVATE = global i32 0
define i8* @valloc_private(i64 %0) {
%2 = load i32, i32* @MAP_PRIVATE
%3 = tail call i8* @pft_mmap(i64 %0, i32 %2, i32* null)
ret i8* %3
}
void rop3_50_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T | S;
  stk2 = *D | stk3;
  stk1 = S ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_50_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_50_0_0>:
or     %esi,%edx
or     (%rdi),%dl
xor    %sil,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_50_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %9
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = load i8*, i8** %4
store i8 %29, i8* %30
ret void
}

LLVM IR (-O2):
define void @rop3_50_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = load i8, i8* %0
%6 = or i8 %4, %5
%7 = xor i8 %6, %1
store i8 %7, i8* %0
ret void
}
const char *base_name(const char *name) {
  const char *base;
  for (base = name; *name; name++)
    if (((*name) == '/'))
      base = name + 1;
  return base;
}


x86 assembly (clang, -O0):
<base_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <base_name+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1139 <base_name+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113e <base_name+0x3e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <base_name+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base_name>:
mov    %rdi,%rax
lea    0x1(%rdi),%rcx
jmp    1117 <base_name+0x17>
nopl   0x0(%rax)
mov    %rcx,%rax
add    $0x1,%rcx
movzbl -0x1(%rcx),%edx
cmp    $0x2f,%dl
je     1110 <base_name+0x10>
test   %dl,%dl
jne    1113 <base_name+0x13>
ret

LLVM IR (-O0):
define i8* @base_name(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 = %18, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %21
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 47
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8* %16, i8** %3
br label %17
17: ; preds = %14, %9
br label %18
18: ; preds = %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
br label %5
21: ; preds = %5
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @base_name(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i8* [ %0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 47, label %6
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret i8* %4
}
unsigned char inb(unsigned short port) {
  unsigned char val;
  asm volatile("inb %1, %0" : "=a"(val) : "Nd"(port));
  return val;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ add_port_vlan_h3c(char *, int, int, int);
int _add_port_vlan(int sb, char *setport, int vlanid, int rfd, int wfd) {
  switch (sb) {
  case 0:
    add_port_vlan_h3c(setport, vlanid, rfd, wfd);
    break;
  default:
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<_add_port_vlan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
test   %eax,%eax
jne    1150 <_add_port_vlan+0x40>
jmp    1139 <_add_port_vlan+0x29>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   1030 <add_port_vlan_h3c@plt>
jmp    115c <_add_port_vlan+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <_add_port_vlan+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_add_port_vlan>:
mov    $0xffffffff,%eax
test   %edi,%edi
je     111a <_add_port_vlan+0xa>
ret
push   %rax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %ecx,%edx
mov    %r8d,%ecx
call   1030 <add_port_vlan_h3c@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @_add_port_vlan(i32 %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
%12 = load i32, i32* %7
switch i32 %12, label %19 [
i32 0, label %13
]
13: ; preds = %5
%14 = load i8*, i8** %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = call i32 @add_port_vlan_h3c(i8* %14, i32 %15, i32 %16, i32 %17)
br label %20
19: ; preds = %5
store i32 -1, i32* %6
br label %21
20: ; preds = %13
store i32 0, i32* %6
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %6
ret i32 %22
}

LLVM IR (-O2):
define i32 @_add_port_vlan(i32 %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp eq i32 %0, 0
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 @add_port_vlan_h3c(i8* %1, i32 %2, i32 %3, i32 %4)
br label %9
9: ; preds = %5, %7
%10 = phi i32 [ 0, %7 ], [ -1, %5 ]
ret i32 %10
}
/* Variables and functions */
int cutils_fcmp_float_compare(float, float);
bool cutils_cdar_DynamicArray_float_compare(const void *p1, const void *p2,
                                            size_t s) {
  return cutils_fcmp_float_compare(*(float *)p1, *(float *)p2);
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_float_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
call   1030 <cutils_fcmp_float_compare@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_float_compare>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
jmp    1030 <cutils_fcmp_float_compare@plt>

LLVM IR (-O0):
define i32 @cutils_cdar_DynamicArray_float_compare(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to float*
%9 = load float, float* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to float*
%12 = load float, float* %11
%13 = call i32 @cutils_fcmp_float_compare(float %9, float %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @cutils_cdar_DynamicArray_float_compare(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = bitcast i8* %0 to float*
%5 = load float, float* %4
%6 = bitcast i8* %1 to float*
%7 = load float, float* %6
%8 = tail call i32 @cutils_fcmp_float_compare(float %5, float %7)
ret i32 %8
}
int is_xdigit(unsigned char c) {
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') ||
         (c >= 'A' && c <= 'F');
}


x86 assembly (clang, -O0):
<is_xdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <is_xdigit+0x29>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    116d <is_xdigit+0x6d>
movzbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1148 <is_xdigit+0x48>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x66,%ecx
mov    %al,-0x2(%rbp)
jle    116d <is_xdigit+0x6d>
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <is_xdigit+0x67>
movzbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_xdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_xdigit(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = icmp sle i32 %16, 102
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = zext i8 %19 to i32
%21 = icmp sge i32 %20, 65
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = zext i8 %23 to i32
%25 = icmp sle i32 %24, 70
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @is_xdigit(i8 zeroext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int ireverse(int);
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int value = 128;
  printf("before = %d, after = %d\n", value, ireverse(value));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x80,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <ireverse@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x80,%edi
call   1040 <ireverse@plt>
lea    0xece(%rip),%rdi
mov    $0x80,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"before = %d, after = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 128, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @ireverse(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"before = %d, after = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @ireverse(i32 128)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 128, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fmul_preg32_qword(int reg32) {
  put8(0xDC);
  put8(0x08 + reg32);
}


x86 assembly (clang, -O0):
<fmul_preg32_qword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xdc,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
add    $0x8,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmul_preg32_qword>:
push   %rbx
mov    %edi,%ebx
mov    $0xdc,%edi
call   1030 <put8@plt>
add    $0x8,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @fmul_preg32_qword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 220)
%4 = load i32, i32* %2
%5 = add nsw i32 8, %4
%6 = call i32 @put8(i32 %5)
ret void
}

LLVM IR (-O2):
define void @fmul_preg32_qword(i32 %0) {
%2 = tail call i32 @put8(i32 220)
%3 = add nsw i32 %0, 8
%4 = tail call i32 @put8(i32 %3)
ret void
}
/* Type definitions */
struct gengetopt_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ cmdline_parser_required2(struct gengetopt_args_info *, char const *,
                                    int /*<<< orphan*/);
int cmdline_parser_required(struct gengetopt_args_info *args_info,
                            const char *prog_name) {
  int result = EXIT_SUCCESS;
  if (cmdline_parser_required2(args_info, prog_name, 0) > 0)
    result = EXIT_FAILURE;
  return result;
}


x86 assembly (clang, -O0):
<cmdline_parser_required>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <cmdline_parser_required2@plt>
cmp    $0x0,%rax
jle    1151 <cmdline_parser_required+0x41>
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdline_parser_required>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%ebx
xor    %edx,%edx
call   1030 <cmdline_parser_required2@plt>
test   %rax,%rax
jle    112f <cmdline_parser_required+0x1f>
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.gengetopt_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @cmdline_parser_required(%struct.gengetopt_args_info* %0, i8* %1) {
%3 = alloca %struct.gengetopt_args_info*
%4 = alloca i8*
%5 = alloca i32
store %struct.gengetopt_args_info* %0, %struct.gengetopt_args_info** %3
store i8* %1, i8** %4
%6 = load i32, i32* @EXIT_SUCCESS
store i32 %6, i32* %5
%7 = load %struct.gengetopt_args_info*, %struct.gengetopt_args_info** %3
%8 = load i8*, i8** %4
%9 = call i64 @cmdline_parser_required2(%struct.gengetopt_args_info* %7, i8* %8, i32 0)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* @EXIT_FAILURE
store i32 %12, i32* %5
br label %13
13: ; preds = %11, %2
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
%struct.gengetopt_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @cmdline_parser_required(%struct.gengetopt_args_info* %0, i8* %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i64 @cmdline_parser_required2(%struct.gengetopt_args_info* %0, i8* %1, i32 0)
%5 = icmp sgt i64 %4, 0
%6 = load i32, i32* @EXIT_FAILURE
%7 = select i1 %5, i32 %6, i32 %3
ret i32 %7
}
int label_get_socket_label_from_exe(const char *exe, char **label) {
  int r = 0;
  return r;
}


x86 assembly (clang, -O0):
<label_get_socket_label_from_exe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<label_get_socket_label_from_exe>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @label_get_socket_label_from_exe(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i32
store i8* %0, i8** %3
store i8** %1, i8*** %4
store i32 0, i32* %5
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @label_get_socket_label_from_exe(i8* nocapture readnone %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void clear_memory(void *p, size_t len) {
  if (len != 0)
    memset(p, 0, len);
}


x86 assembly (clang, -O0):
<clear_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113a <clear_memory+0x2a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_memory>:
test   %rsi,%rsi
je     111f <clear_memory+0xf>
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>
ret

LLVM IR (-O0):
define void @clear_memory(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = call i32 @memset(i8* %8, i32 0, i64 %9)
br label %11
11: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @clear_memory(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ stdout;
void print_notification(char *title, char *msg) {
  printf("\t%s\n\t\t%s\n", title, msg);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<print_notification>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_notification>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\09%s\0A\09\09%s\0A\00"
@stdout = global i32 0
define void @print_notification(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"\09%s\0A\09\09%s\0A\00"
@stdout = global i32 0
define void @print_notification(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ has_proto(char const *);
int /*<<< orphan*/ strlen(char const *);
char *uri_merge_1(char const *, char const *, int /*<<< orphan*/, int);
char *uri_merge(const char *base, const char *link) {
  return uri_merge_1(base, link, strlen(link), !has_proto(link));
}


x86 assembly (clang, -O0):
<uri_merge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <has_proto@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
call   1050 <uri_merge_1@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uri_merge>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <has_proto@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <uri_merge_1@plt>

LLVM IR (-O0):
define i8* @uri_merge(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = load i8*, i8** %4
%10 = call i32 @has_proto(i8* %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
%14 = call i8* @uri_merge_1(i8* %5, i8* %6, i32 %8, i32 %13)
ret i8* %14
}

LLVM IR (-O2):
define i8* @uri_merge(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @has_proto(i8* %1)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i8* @uri_merge_1(i8* %0, i8* %1, i32 %3, i32 %6)
ret i8* %7
}
void swap_integers(int *array, int i1, int i2) {
  int tmp = array[i1];
  array[i1] = array[i2];
  array[i2] = tmp;
}


x86 assembly (clang, -O0):
<swap_integers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_integers>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap_integers(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap_integers(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
void gtk_action_new() {}


x86 assembly (clang, -O0):
<gtk_action_new>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @gtk_action_new() {
ret void
}

LLVM IR (-O2):
define void @gtk_action_new() {
ret void
}
void reversesub(char *s, char *send) {
  if (s < send) {
    char temp = *send;
    *send-- = *s;
    *s++ = temp;
    reversesub(s, send);
  }
}


x86 assembly (clang, -O0):
<reversesub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    116f <reversesub+0x5f>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <reversesub@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reversesub>:
cmp    %rsi,%rdi
jae    112c <reversesub+0x2c>
add    $0x1,%rdi
nopl   0x0(%rax)
movzbl (%rsi),%eax
movzbl -0x1(%rdi),%ecx
mov    %cl,(%rsi)
add    $0xffffffffffffffff,%rsi
mov    %al,-0x1(%rdi)
lea    0x1(%rdi),%rax
cmp    %rsi,%rdi
mov    %rax,%rdi
jb     1110 <reversesub+0x10>
ret

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

LLVM IR (-O2):
define void @reversesub(i8* %0, i8* %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8* [ %9, %4 ], [ %1, %2 ]
%6 = phi i8* [ %10, %4 ], [ %0, %2 ]
%7 = load i8, i8* %5
%8 = load i8, i8* %6
%9 = getelementptr inbounds i8, i8* %5, i64 -1
store i8 %8, i8* %5
%10 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %7, i8* %6
%11 = icmp ult i8* %10, %9
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
long syscall2(long nr, long a1, long a2) {
  register long r0 asm("rax") = nr;
  register long r1 asm("rdi") = a1;
  register long r2 asm("rsi") = a2;
  asm volatile("syscall"
               : "=r"(r0)
               : "r"(r0), "r"(r1), "r"(r2)
               : "rcx", "r11", "memory");
  return r0;
}


x86 assembly (clang, -O0):
<syscall2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
syscall
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall2>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
syscall
ret

LLVM IR (-O0):
define i64 @syscall2(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%10 = load i64, i64* %4
store i64 %10, i64* %7
%11 = load i64, i64* %5
store i64 %11, i64* %8
%12 = load i64, i64* %6
store i64 %12, i64* %9
%13 = load i64, i64* %7
%14 = load i64, i64* %8
%15 = load i64, i64* %9
%16 = call i64 asm sideeffect "syscall", "={rax},{rax},{rdi},{rsi},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %13, i64 %14, i64 %15)
store i64 %16, i64* %7
%17 = load i64, i64* %7
ret i64 %17
}

LLVM IR (-O2):
define i64 @syscall2(i64 %0, i64 %1, i64 %2) {
%4 = tail call i64 asm sideeffect "syscall", "={rax},{rax},{rdi},{rsi},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2)
ret i64 %4
}
void X509_PURPOSE_get_trust(void) {}


x86 assembly (clang, -O0):
<X509_PURPOSE_get_trust>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @X509_PURPOSE_get_trust() {
ret void
}

LLVM IR (-O2):
define void @X509_PURPOSE_get_trust() {
ret void
}
/* Variables and functions */
int getpid();
int pthread_self() { return getpid(); }


x86 assembly (clang, -O0):
<pthread_self>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_self>:
xor    %eax,%eax
jmp    1030 <getpid@plt>

LLVM IR (-O0):
define i32 @pthread_self() {
%1 = call i32 (...) @getpid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @pthread_self() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}