xunge/DecIR huggingface dataset:
int verify_benchmark(int r) {
  int expected = 9900;
  if (r != expected)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<verify_benchmark>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x26ac,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1126 <verify_benchmark+0x26>
movl   $0x0,-0x4(%rbp)
jmp    112d <verify_benchmark+0x2d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_benchmark>:
xor    %eax,%eax
cmp    $0x26ac,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @verify_benchmark(i32 %0) {
%2 = icmp eq i32 %0, 9900
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ n;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int16_t lround16(double n) {
  return (int16_t)((n) >= 0.0 ? (n) + 0.5 : (n)-0.5);
}


x86 assembly (clang, -O0):
<lround16>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1132 <lround16+0x32>
movsd  0xedd(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1148 <lround16+0x48>
movsd  -0x8(%rbp),%xmm0
movsd  0xec1(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lround16>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
lea    0xeec(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @lround16(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fadd double %6, 5.000000e-01
br label %11
8: ; preds = %1
%9 = load double, double* %2
%10 = fsub double %9, 5.000000e-01
br label %11
11: ; preds = %8, %5
%12 = phi double [ %7, %5 ], [ %10, %8 ]
%13 = fptosi double %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @lround16(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = select i1 %2, double 5.000000e-01, double -5.000000e-01
%4 = fadd double %3, %0
%5 = fptosi double %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putcharwrap(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ strlcpy(char *, char const *, int);
void printwrap(FILE *f, const char *p) {
  char *q;
  char buf[12];
  q = buf;
  strlcpy(buf, p, sizeof(buf));
  while (*q)
    putcharwrap(f, *q++);
}


x86 assembly (clang, -O0):
<printwrap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x24(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x24(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xc,%edx
call   1040 <strlcpy@plt>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1177 <printwrap+0x57>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%esi
call   1030 <putcharwrap@plt>
jmp    114a <printwrap+0x2a>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printwrap>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%r14
lea    0xc(%rsp),%rdi
mov    $0xc,%edx
call   1040 <strlcpy@plt>
mov    0xc(%rsp),%al
test   %al,%al
je     1166 <printwrap+0x46>
lea    0xd(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <putcharwrap@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1150 <printwrap+0x30>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @printwrap(i32* %0, i8* %1) {
%3 = alloca [12 x i8]
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%5 = call i32 @strlcpy(i8* %4, i8* %1, i32 12)
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %2, %8
%9 = phi i8 [ %14, %8 ], [ %6, %2 ]
%10 = phi i8* [ %11, %8 ], [ %4, %2 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = sext i8 %9 to i32
%13 = call i32 @putcharwrap(i32* %0, i32 %12)
%14 = load i8, i8* %11
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %8
16: ; preds = %8, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ printf(char *, char const *, char *);
char *strerror(int /*<<< orphan*/);
FILE *OpenFile(const char *name, const char *mode) {
  FILE *fp;
  fp = fopen(name, mode);
  if ((NULL == (fp)))
    printf("Cannot open file %s: %s\n", name, strerror(errno));
  return (fp);
}


x86 assembly (clang, -O0):
<OpenFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
jne    1186 <OpenFile+0x56>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpenFile>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1164 <OpenFile+0x34>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea7(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Cannot open file %s: %s\0A\00"
@errno = global i32 0
define i32* @OpenFile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* null, %9
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = load i32, i32* @errno
%14 = call i8* @strerror(i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %14)
br label %16
16: ; preds = %11, %2
%17 = load i32*, i32** %5
ret i32* %17
}

LLVM IR (-O2):
@.str = [25 x i8] c"Cannot open file %s: %s\0A\00"
@errno = global i32 0
define noalias i32* @OpenFile(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %7)
br label %9
9: ; preds = %5, %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int setsockopt(int sockfd, int level, int optname, const void *optval,
               unsigned int optlen) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<setsockopt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb3(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setsockopt>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @setsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* @ENOSYS
store i32 %11, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @setsockopt(i32 %0, i32 %1, i32 %2, i8* nocapture readnone %3, i32 %4) {
%6 = load i32, i32* @ENOSYS
store i32 %6, i32* @errno
ret i32 -1
}
double signf(double v) { return v > 0 ? 1.0 : (v < 0 ? -1.0 : 0); }


x86 assembly (clang, -O0):
<signf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112d <signf+0x2d>
movsd  0xee5(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1156 <signf+0x56>
movsd  -0x8(%rbp),%xmm0
movsd  0xec6(%rip),%xmm3
xorps  %xmm2,%xmm2
cmpltsd %xmm2,%xmm0
movaps %xmm0,%xmm1
andpd  %xmm3,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<signf>:
xorpd  %xmm1,%xmm1
movapd %xmm0,%xmm2
cmpltsd %xmm1,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
cmpltsd %xmm0,%xmm1
movsd  0xee2(%rip),%xmm0
andpd  %xmm1,%xmm0
andnpd %xmm3,%xmm1
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @signf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp olt double %7, 0.000000e+00
%9 = zext i1 %8 to i64
%10 = select i1 %8, double -1.000000e+00, double 0.000000e+00
br label %11
11: ; preds = %6, %5
%12 = phi double [ 1.000000e+00, %5 ], [ %10, %6 ]
ret double %12
}

LLVM IR (-O2):
define double @signf(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fcmp olt double %0, 0.000000e+00
%4 = select i1 %3, double -1.000000e+00, double 0.000000e+00
%5 = select i1 %2, double 1.000000e+00, double %4
ret double %5
}
void *xstrdup(const char *string) {
  char *p = xmalloc(strlen(string) + 1);
  strcpy(p, string);
  return p;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1050 <xmalloc@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
xor    %eax,%eax
call   1050 <xmalloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i32 (i64, ...) bitcast (i32 (...)* @xmalloc to i32 (i64, ...)*)(i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i8* @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @xmalloc to i32 (i64, ...)*)(i64 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* dereferenceable(1) %0)
ret i8* %6
}
void hide(int x) {}


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

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

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

LLVM IR (-O2):
define void @hide(i32 %0) {
ret void
}
RX0AR1(r0, r1, x0, x1, p0, p1) signed char r0, r1;
signed char *p0, *p1;
{
  if ((p0[x0]) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<RX0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x20(%rbp),%rcx
movsbl 0x43d11(%rcx),%ecx
cmp    %ecx,%eax
jg     1149 <RX0AR1+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1150 <RX0AR1+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0AR1>:
movslq %edx,%rax
mov    (%r8,%rax,1),%cl
xor    %eax,%eax
cmp    0x43d11(%r9),%cl
setle  %al
ret

LLVM IR (-O0):
define i32 @RX0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8*, i8** %12
%17 = load i32, i32* %10
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = load i8*, i8** %13
%23 = getelementptr inbounds i8, i8* %22, i64 277777
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %21, %25
br i1 %26, label %27, label %28
27: ; preds = %6
store i32 1, i32* %7
br label %29
28: ; preds = %6
store i32 0, i32* %7
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %7
ret i32 %30
}

LLVM IR (-O2):
define i32 @RX0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %5, i64 277777
%11 = load i8, i8* %10
%12 = icmp sle i8 %9, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
void BIO_ptr_ctrl(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_ptr_ctrl() {
ret void
}
/* Forward declarations */
typedef struct TYPE_5__ TYPE_1__;

/* Type definitions */
struct TYPE_5__ {
  int /*<<< orphan*/ top;
};
typedef TYPE_1__ ERR_STATE;

/* Variables and functions */
TYPE_1__ *ERR_get_state();
int /*<<< orphan*/ err_clear(TYPE_1__ *, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ err_get_slot(TYPE_1__ *);
void ERR_new(void) {
  ERR_STATE *es;
  es = ERR_get_state();
  if (es == NULL)
    return;
  err_get_slot(es);
  err_clear(es, es->top, 0);
}


x86 assembly (clang, -O0):
<ERR_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <ERR_get_state@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1153 <ERR_new+0x23>
jmp    116d <ERR_new+0x3d>
mov    -0x8(%rbp),%rdi
call   1040 <err_get_slot@plt>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <err_clear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ERR_new>:
push   %rbx
xor    %eax,%eax
call   1030 <ERR_get_state@plt>
test   %rax,%rax
je     1155 <ERR_new+0x25>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <err_get_slot@plt>
mov    (%rbx),%esi
mov    %rbx,%rdi
xor    %edx,%edx
pop    %rbx
jmp    1050 <err_clear@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { i32 }
define void @ERR_new() {
%1 = alloca %struct.TYPE_5__*
%2 = call %struct.TYPE_5__* (...) @ERR_get_state()
store %struct.TYPE_5__* %2, %struct.TYPE_5__** %1
%3 = load %struct.TYPE_5__*, %struct.TYPE_5__** %1
%4 = icmp eq %struct.TYPE_5__* %3, null
br i1 %4, label %5, label %6
5: ; preds = %0
br label %14
6: ; preds = %0
%7 = load %struct.TYPE_5__*, %struct.TYPE_5__** %1
%8 = call i32 @err_get_slot(%struct.TYPE_5__* %7)
%9 = load %struct.TYPE_5__*, %struct.TYPE_5__** %1
%10 = load %struct.TYPE_5__*, %struct.TYPE_5__** %1
%11 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @err_clear(%struct.TYPE_5__* %9, i32 %12, i32 0)
br label %14
14: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i32 }
define void @ERR_new() {
%1 = tail call %struct.TYPE_5__* (...) @ERR_get_state()
%2 = icmp eq %struct.TYPE_5__* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 @err_get_slot(%struct.TYPE_5__* %1)
%5 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @err_clear(%struct.TYPE_5__* %1, i32 %6, i32 0)
br label %8
8: ; preds = %0, %3
ret void
}
int main() {
  int sum = 0;
  int i, j;
  while (sum < 100) {
    sum = sum * 2;
  }
  for (i = 0; i < 25; i++) {
    for (j = 0; j < 50; j++) {
      sum = sum + i * j;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    112a <main+0x2a>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
movl   $0x0,-0xc(%rbp)
cmpl   $0x19,-0xc(%rbp)
jge    117c <main+0x7c>
movl   $0x0,-0x10(%rbp)
cmpl   $0x32,-0x10(%rbp)
jge    1169 <main+0x69>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1142 <main+0x42>
jmp    116e <main+0x6e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <main+0x31>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = mul nsw i32 %9, 2
store i32 %10, i32* %2
br label %5
11: ; preds = %5
store i32 0, i32* %3
br label %12
12: ; preds = %29, %11
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 25
br i1 %14, label %15, label %32
15: ; preds = %12
store i32 0, i32* %4
br label %16
16: ; preds = %25, %15
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 50
br i1 %18, label %19, label %28
19: ; preds = %16
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = mul nsw i32 %21, %22
%24 = add nsw i32 %20, %23
store i32 %24, i32* %2
br label %25
25: ; preds = %19
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %16
28: ; preds = %16
br label %29
29: ; preds = %28
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %12
32: ; preds = %12
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, float, float);
int /*<<< orphan*/ scanf(char *, int *, int *, float *, float *);
int main() {
  int a, b;
  float c, d;
  scanf("%d%d%f%f", &a, &b, &c, &d);
  printf("[%d][%d][%f][%f]", a, b, c, d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1040 <scanf@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d%d%f%f\00"
@.str.1 = [17 x i8] c"[%d][%d][%f][%f]\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, float* %3, float* %4)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = load float, float* %3
%9 = load float, float* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, float %8, float %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d%d%f%f\00"
@.str.1 = [17 x i8] c"[%d][%d][%f][%f]\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast float* %3 to i8*
%8 = bitcast float* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, float* %3, float* %4)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = load float, float* %3
%13 = load float, float* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11, float %12, float %13)
ret i32 0
}
__attribute__((always_)) int register_cpu_notifier(struct notifier_block *nb) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.notifier_block = type opaque
define i32 @register_cpu_notifier(%struct.notifier_block* %0) {
%2 = alloca %struct.notifier_block*
store %struct.notifier_block* %0, %struct.notifier_block** %2
ret i32 0
}

LLVM IR (-O2):
%struct.notifier_block = type opaque
define i32 @register_cpu_notifier(%struct.notifier_block* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgswap(void) { gen("xchg\tax,cx"); }


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

x86 assembly (clang, -O2):
<cgswap>:
lea    0xee9(%rip),%rdi
jmp    1030 <gen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"xchg\09ax,cx\00"
define void @cgswap() {
%1 = call i32 @gen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"xchg\09ax,cx\00"
define void @cgswap() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
extern int CALL02_01(void *p0) { printf("ASM->C: %s\n", (char *)p0); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"ASM->C: %s\0A\00"
define i32 @CALL02_01(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [12 x i8] c"ASM->C: %s\0A\00"
define i32 @CALL02_01(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
char *asctime(struct tm const *);
int /*<<< orphan*/ memcpy(char *, char *, int);
char *asctime_r(const struct tm *t, char *dst) {
  char *p = asctime(t);
  if (p == NULL)
    return NULL;
  memcpy(dst, p, 26);
  return dst;
}


x86 assembly (clang, -O0):
<asctime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <asctime@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1155 <asctime_r+0x35>
movq   $0x0,-0x8(%rbp)
jmp    116f <asctime_r+0x4f>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x1a,%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asctime_r>:
push   %rbx
mov    %rsi,%rbx
call   1030 <asctime@plt>
test   %rax,%rax
je     1140 <asctime_r+0x20>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x1a,%edx
call   1040 <memcpy@plt>
jmp    1142 <asctime_r+0x22>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i8* @asctime_r(%struct.tm* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca %struct.tm*
%5 = alloca i8*
%6 = alloca i8*
store %struct.tm* %0, %struct.tm** %4
store i8* %1, i8** %5
%7 = load %struct.tm*, %struct.tm** %4
%8 = call i8* @asctime(%struct.tm* %7)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store i8* null, i8** %3
br label %17
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @memcpy(i8* %13, i8* %14, i32 26)
%16 = load i8*, i8** %5
store i8* %16, i8** %3
br label %17
17: ; preds = %12, %11
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i8* @asctime_r(%struct.tm* %0, i8* %1) {
%3 = tail call i8* @asctime(%struct.tm* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memcpy(i8* %1, i8* %3, i32 26)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %1, %5 ], [ null, %2 ]
ret i8* %8
}
/* Variables and functions */
char *strcpy(char *, char *);
scalar_t__ strlen(char *);
scalar_t__ xmalloc(scalar_t__);
char *xstrdup(char *s) { return strcpy((char *)xmalloc(strlen(s) + 1), s); }


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = add nsw i64 %4, 1
%6 = call i64 @xmalloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
%8 = load i8*, i8** %2
%9 = call i8* @strcpy(i8* %7, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @xmalloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i8* @strcpy(i8* dereferenceable(1) %5, i8* dereferenceable(1) %0)
ret i8* %5
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ readAll(int /*<<< orphan*/, unsigned char *, int);
int32_t getint() {
  int32_t val;
  unsigned char c;
  int i;
  val = 0;
  for (i = 0; i < 4; i++) {
    val <<= 8;
    readAll(0, &c, 1);
    val |= c;
  }
  return val;
}


x86 assembly (clang, -O0):
<getint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1161 <getint+0x51>
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x4(%rbp)
xor    %edi,%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <readAll@plt>
movzbl -0x5(%rbp),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <getint+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getint>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xf(%rsp),%r14
xor    %edi,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <readAll@plt>
movzbl 0xf(%rsp),%ebp
xor    %edi,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <readAll@plt>
movzbl 0xf(%rsp),%ebx
shl    $0x10,%ebp
shl    $0x8,%ebx
or     %ebp,%ebx
xor    %edi,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <readAll@plt>
movzbl 0xf(%rsp),%ebp
or     %ebx,%ebp
shl    $0x8,%ebp
xor    %edi,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <readAll@plt>
movzbl 0xf(%rsp),%eax
or     %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getint() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %15, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 4
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load i32, i32* %1
%9 = shl i32 %8, 8
store i32 %9, i32* %1
%10 = call i32 @readAll(i32 0, i8* %2, i32 1)
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = load i32, i32* %1
%14 = or i32 %13, %12
store i32 %14, i32* %1
br label %15
15: ; preds = %7
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %4
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @getint() {
%1 = alloca i8
%2 = call i32 @readAll(i32 0, i8* %1, i32 1)
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = call i32 @readAll(i32 0, i8* %1, i32 1)
%6 = load i8, i8* %1
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %4, 16
%9 = shl nuw nsw i32 %7, 8
%10 = or i32 %8, %9
%11 = call i32 @readAll(i32 0, i8* %1, i32 1)
%12 = load i8, i8* %1
%13 = zext i8 %12 to i32
%14 = or i32 %10, %13
%15 = shl nuw i32 %14, 8
%16 = call i32 @readAll(i32 0, i8* %1, i32 1)
%17 = load i8, i8* %1
%18 = zext i8 %17 to i32
%19 = or i32 %15, %18
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void TIM1_BRK_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @TIM1_BRK_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @TIM1_BRK_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DrawLine(double, double);
int /*<<< orphan*/ MovePen(double, double);
void DrawTriangle(double x, double y, double base, double height) {
  MovePen(x, y);
  DrawLine(base, 0);
  DrawLine(-base / 2, height);
  DrawLine(-base / 2, -height);
}


x86 assembly (clang, -O0):
<DrawTriangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <MovePen@plt>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
call   1030 <DrawLine@plt>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe84(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <DrawLine@plt>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe52(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
call   1030 <DrawLine@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawTriangle>:
sub    $0x28,%rsp
movaps %xmm3,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
call   1040 <MovePen@plt>
xorps  %xmm1,%xmm1
movsd  0x8(%rsp),%xmm0
call   1030 <DrawLine@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0xeb0(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movaps 0x10(%rsp),%xmm1
call   1030 <DrawLine@plt>
movaps 0x10(%rsp),%xmm1
xorps  0xea4(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
jmp    1030 <DrawLine@plt>

LLVM IR (-O0):
define void @DrawTriangle(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = call i32 @MovePen(double %9, double %10)
%12 = load double, double* %7
%13 = call i32 @DrawLine(double %12, double 0.000000e+00)
%14 = load double, double* %7
%15 = fneg double %14
%16 = fdiv double %15, 2.000000e+00
%17 = load double, double* %8
%18 = call i32 @DrawLine(double %16, double %17)
%19 = load double, double* %7
%20 = fneg double %19
%21 = fdiv double %20, 2.000000e+00
%22 = load double, double* %8
%23 = fneg double %22
%24 = call i32 @DrawLine(double %21, double %23)
ret void
}

LLVM IR (-O2):
define void @DrawTriangle(double %0, double %1, double %2, double %3) {
%5 = tail call i32 @MovePen(double %0, double %1)
%6 = tail call i32 @DrawLine(double %2, double 0.000000e+00)
%7 = fmul double %2, -5.000000e-01
%8 = tail call i32 @DrawLine(double %7, double %3)
%9 = fneg double %3
%10 = tail call i32 @DrawLine(double %7, double %9)
ret void
}
void carmen_base_direct_arm_set(double servos[] __attribute__((unused)),
                                int num_servos __attribute__((unused))) {
  printf("%s not supported by pioneer.\n", __FUNCTION__);
}


x86 assembly (clang, -O0):
<carmen_base_direct_arm_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
lea    0xef1(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_base_direct_arm_set>:
lea    0xee9(%rip),%rdi
lea    0xf00(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"%s not supported by pioneer.\0A\00"
@__FUNCTION__.carmen_base_direct_arm_set = [27 x i8] c"carmen_base_direct_arm_set\00"
define void @carmen_base_direct_arm_set(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__FUNCTION__.carmen_base_direct_arm_set, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"%s not supported by pioneer.\0A\00"
@__FUNCTION__.carmen_base_direct_arm_set = [27 x i8] c"carmen_base_direct_arm_set\00"
define void @carmen_base_direct_arm_set(double* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__FUNCTION__.carmen_base_direct_arm_set, i64 0, i64 0))
ret void
}
/* Type definitions */
struct l2tp_conn_mngr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tunnel_send_Hello(struct l2tp_conn_mngr *);
void l2tp_handle_timer(struct l2tp_conn_mngr *conn) { tunnel_send_Hello(conn); }


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

x86 assembly (clang, -O2):
<l2tp_handle_timer>:
jmp    1030 <tunnel_send_Hello@plt>

LLVM IR (-O0):
%struct.l2tp_conn_mngr = type { i32 }
define void @l2tp_handle_timer(%struct.l2tp_conn_mngr* %0) {
%2 = alloca %struct.l2tp_conn_mngr*
store %struct.l2tp_conn_mngr* %0, %struct.l2tp_conn_mngr** %2
%3 = load %struct.l2tp_conn_mngr*, %struct.l2tp_conn_mngr** %2
%4 = call i32 @tunnel_send_Hello(%struct.l2tp_conn_mngr* %3)
ret void
}

LLVM IR (-O2):
%struct.l2tp_conn_mngr = type { i32 }
define void @l2tp_handle_timer(%struct.l2tp_conn_mngr* %0) {
%2 = tail call i32 @tunnel_send_Hello(%struct.l2tp_conn_mngr* %0)
ret void
}
int isOctDigit(const char digito) { return digito >= '0' && digito <= '7'; }


x86 assembly (clang, -O0):
<isOctDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isOctDigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x37,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOctDigit>:
and    $0xf8,%dil
xor    %eax,%eax
cmp    $0x30,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isOctDigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext 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 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 55
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isOctDigit(i8 signext %0) {
%2 = and i8 %0, -8
%3 = icmp eq i8 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
void array_uint24_be_set(unsigned char data[], const unsigned int input) {
  data[0] = (input >> 16) & 0xFF;
  data[1] = (input >> 8) & 0xFF;
  data[2] = input & 0xFF;
}


x86 assembly (clang, -O0):
<array_uint24_be_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_uint24_be_set>:
mov    %esi,%eax
mov    %esi,%ecx
shr    $0x10,%ecx
mov    %cl,(%rdi)
mov    %ah,0x1(%rdi)
mov    %al,0x2(%rdi)
ret

LLVM IR (-O0):
define void @array_uint24_be_set(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = lshr i32 %5, 16
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = lshr i32 %11, 8
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i32, i32* %4
%18 = and i32 %17, 255
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 %19, i8* %21
ret void
}

LLVM IR (-O2):
define void @array_uint24_be_set(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = trunc i32 %1 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
ret void
}
/* Type definitions */
struct dump_output {
  int dummy;
};
struct document {
  int dummy;
};

/* Variables and functions */
int DUMP_FUNCTION_UNIBYTE(struct document *, struct dump_output *);
int DUMP_FUNCTION_COLOR(struct document *document, struct dump_output *out) {
  return DUMP_FUNCTION_UNIBYTE(document, out);
}


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

x86 assembly (clang, -O2):
<DUMP_FUNCTION_COLOR>:
jmp    1030 <DUMP_FUNCTION_UNIBYTE@plt>

LLVM IR (-O0):
%struct.document = type { i32 }
%struct.dump_output = type { i32 }
define i32 @DUMP_FUNCTION_COLOR(%struct.document* %0, %struct.dump_output* %1) {
%3 = alloca %struct.document*
%4 = alloca %struct.dump_output*
store %struct.document* %0, %struct.document** %3
store %struct.dump_output* %1, %struct.dump_output** %4
%5 = load %struct.document*, %struct.document** %3
%6 = load %struct.dump_output*, %struct.dump_output** %4
%7 = call i32 @DUMP_FUNCTION_UNIBYTE(%struct.document* %5, %struct.dump_output* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.document = type { i32 }
%struct.dump_output = type { i32 }
define i32 @DUMP_FUNCTION_COLOR(%struct.document* %0, %struct.dump_output* %1) {
%3 = tail call i32 @DUMP_FUNCTION_UNIBYTE(%struct.document* %0, %struct.dump_output* %1)
ret i32 %3
}
int do_652() { return 652; }


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

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

LLVM IR (-O0):
define i32 @do_652() {
ret i32 652
}

LLVM IR (-O2):
define i32 @do_652() {
ret i32 652
}
/* Variables and functions */
int delgroup(char *);
int delgshadow(char *);
int removegroup(char *group) {
  int i;
  if ((i = delgroup(group)) != 0) {
    return i;
  }
  if ((i = delgshadow(group)) != 0) {
    return i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<removegroup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <delgroup@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114c <removegroup+0x2c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1173 <removegroup+0x53>
mov    -0x10(%rbp),%rdi
call   1030 <delgshadow@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     116c <removegroup+0x4c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1173 <removegroup+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removegroup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <delgroup@plt>
test   %eax,%eax
je     112f <removegroup+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <delgshadow@plt>

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

LLVM IR (-O2):
define i32 @removegroup(i8* %0) {
%2 = tail call i32 @delgroup(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @delgshadow(i8* %0)
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ %2, %1 ], [ %5, %4 ]
ret i32 %7
}
/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int open(char const *, int, int);
int /*<<< orphan*/ t_error(char *, char const *);
int open_wr(const char *fn) {
  int fd;
  fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0666);
  if (fd == -1) {
    t_error("unable to open file for writing: %s", fn);
  }
  return fd;
}


x86 assembly (clang, -O0):
<open_wr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
or     (%rax),%esi
mov    0x2ea7(%rip),%rax
or     (%rax),%esi
mov    $0x1b6,%edx
call   1030 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1172 <open_wr+0x52>
mov    -0x8(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1040 <t_error@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_wr>:
push   %rbp
push   %rbx
push   %rax
mov    0x2e9e(%rip),%rax
mov    0x2ec7(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
or     (%rax),%esi
mov    $0x1b6,%edx
call   1030 <open@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    1161 <open_wr+0x41>
lea    0xea7(%rip),%rdi
mov    %rbx,%rsi
call   1040 <t_error@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@.str = [36 x i8] c"unable to open file for writing: %s\00"
define i32 @open_wr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_WRONLY
%6 = load i32, i32* @O_CREAT
%7 = or i32 %5, %6
%8 = load i32, i32* @O_TRUNC
%9 = or i32 %7, %8
%10 = call i32 @open(i8* %4, i32 %9, i32 438)
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i8*, i8** %2
%15 = call i32 @t_error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %13, %1
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@.str = [36 x i8] c"unable to open file for writing: %s\00"
define i32 @open_wr(i8* %0) {
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_CREAT
%4 = or i32 %3, %2
%5 = load i32, i32* @O_TRUNC
%6 = or i32 %4, %5
%7 = tail call i32 @open(i8* %0, i32 %6, i32 438)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = tail call i32 @t_error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %11
11: ; preds = %9, %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int usage(const char *argv0) {
  fprintf(stderr, "Usage: %s <TLS port number>\n", argv0);
  return 1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: %s <TLS port number>\0A\00"
define i32 @usage(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 ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: %s <TLS port number>\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}