xunge/DecIR huggingface dataset:
/* Variables and functions */
char tolower(char);
void StrTolower(char *s) {
  int i = 0;
  while (s[i] != '\0') {
    s[i] = tolower(s[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<StrTolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1164 <StrTolower+0x54>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <StrTolower+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrTolower>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <StrTolower+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <StrTolower+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @StrTolower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %11, %4 ], [ %2, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = tail call signext i8 @tolower(i8 signext %6)
store i8 %8, i8* %7
%9 = add nuw i64 %5, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
size_t strlen(const char *buf) {
  unsigned int i = 0;
  while (buf[i] != 0)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1131 <strlen+0x31>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
%10 = zext i32 %3 to i64
ret i64 %10
}
double min3(double a, double b, double c) {
  if (b < a)
    a = b;
  if (c < a)
    return c;
  return a;
}


x86 assembly (clang, -O0):
<min3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <min3+0x31>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1154 <min3+0x54>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115e <min3+0x5e>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min3>:
minsd  %xmm0,%xmm1
minsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @min3(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %6
%9 = load double, double* %5
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load double, double* %6
store double %12, double* %5
br label %13
13: ; preds = %11, %3
%14 = load double, double* %7
%15 = load double, double* %5
%16 = fcmp olt double %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load double, double* %7
store double %18, double* %4
br label %21
19: ; preds = %13
%20 = load double, double* %5
store double %20, double* %4
br label %21
21: ; preds = %19, %17
%22 = load double, double* %4
ret double %22
}

LLVM IR (-O2):
define double @min3(double %0, double %1, double %2) {
%4 = fcmp olt double %1, %0
%5 = select i1 %4, double %1, double %0
%6 = fcmp ogt double %5, %2
%7 = select i1 %6, double %2, double %5
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_error(char *msg) {
  printf("\E[1;31mError:\E[0;11m ");
  printf("%s", msg);
}


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

x86 assembly (clang, -O2):
<print_error>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"\1B[1;31mError:\1B[0;11m \00"
@.str.1 = [3 x i8] c"%s\00"
define void @print_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"\1B[1;31mError:\1B[0;11m \00"
@.str.1 = [3 x i8] c"%s\00"
define void @print_error(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
void gtk_text_buffer_move_mark_by_name() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_move_mark_by_name() {
ret void
}
/* Type definitions */
struct pool {
  int dummy;
};

/* Variables and functions */
char *pool_alloc(struct pool *, int);
int /*<<< orphan*/ strncpy(char *, char const *, int);
char *pool_strndup(struct pool *pool, const char *str, int n) {
  char *res;
  res = pool_alloc(pool, n + 1);
  strncpy(res, str, n);
  *(res + n) = 0;
  return res;
}


x86 assembly (clang, -O0):
<pool_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
call   1040 <pool_alloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pool_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%r15d
mov    %rsi,%r14
lea    0x1(%r15),%esi
call   1040 <pool_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <strncpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.pool = type { i32 }
define i8* @pool_strndup(%struct.pool* %0, i8* %1, i32 %2) {
%4 = alloca %struct.pool*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store %struct.pool* %0, %struct.pool** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load %struct.pool*, %struct.pool** %4
%9 = load i32, i32* %6
%10 = add nsw i32 %9, 1
%11 = call i8* @pool_alloc(%struct.pool* %8, i32 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = call i32 @strncpy(i8* %12, i8* %13, i32 %14)
%16 = load i8*, i8** %7
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 0, i8* %19
%20 = load i8*, i8** %7
ret i8* %20
}

LLVM IR (-O2):
%struct.pool = type { i32 }
define i8* @pool_strndup(%struct.pool* %0, i8* %1, i32 %2) {
%4 = add nsw i32 %2, 1
%5 = tail call i8* @pool_alloc(%struct.pool* %0, i32 %4)
%6 = tail call i32 @strncpy(i8* %5, i8* %1, i32 %2)
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
ret i8* %5
}
void toggle_io(volatile unsigned int *port) {
  while (1) {
    *port = 0;
    *port = 0xFF;
  }
}


x86 assembly (clang, -O0):
<toggle_io>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xff,(%rax)
jmp    1108 <toggle_io+0x8>

x86 assembly (clang, -O2):
<toggle_io>:
movl   $0x0,(%rdi)
movl   $0xff,(%rdi)
jmp    1100 <toggle_io>

LLVM IR (-O0):
define void @toggle_io(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
br label %3
3: ; preds = %1, %3
%4 = load i32*, i32** %2
store volatile i32 0, i32* %4
%5 = load i32*, i32** %2
store volatile i32 255, i32* %5
br label %3
}

LLVM IR (-O2):
define void @toggle_io(i32* %0) {
br label %2
2: ; preds = %1, %2
store volatile i32 0, i32* %0
store volatile i32 255, i32* %0
br label %2
}
/* Variables and functions */
float max(int /*<<< orphan*/, float);
int /*<<< orphan*/ min(float, float);
float clamp(float x, float minval, float maxval) {
  return max(min(x, maxval), minval);
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <min@plt>
mov    %eax,%edi
movss  -0x8(%rbp),%xmm0
call   1040 <max@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
push   %rax
movss  %xmm1,0x4(%rsp)
movaps %xmm2,%xmm1
call   1030 <min@plt>
mov    %eax,%edi
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1040 <max@plt>

LLVM IR (-O0):
define float @clamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = call i32 @min(float %7, float %8)
%10 = load float, float* %5
%11 = call float @max(i32 %9, float %10)
ret float %11
}

LLVM IR (-O2):
define float @clamp(float %0, float %1, float %2) {
%4 = tail call i32 @min(float %0, float %2)
%5 = tail call float @max(i32 %4, float %1)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ milli_delay(int);
void test_a() {
  int i = 0;
  while (1) {
    milli_delay(10);
  }
}


x86 assembly (clang, -O0):
<test_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <milli_delay@plt>
jmp    111f <test_a+0xf>

x86 assembly (clang, -O2):
<test_a>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <milli_delay@plt>
jmp    1120 <test_a+0x10>

LLVM IR (-O0):
define void @test_a() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @milli_delay(i32 10)
br label %2
}

LLVM IR (-O2):
define void @test_a() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @milli_delay(i32 10)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: %s [-h host ] [-d domain] server\n",
                getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"usage: %s [-h host ] [-d domain] server\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"usage: %s [-h host ] [-d domain] server\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void fixnum_neg(signed char x, signed char *py, int *pv) {
  unsigned char ux, uy;
  ux = (unsigned char)x;
  uy = -ux;
  *py = (uy <= 127) ? (signed char)uy : (-(signed char)(255 - uy) - 1);
  *pv = (x == -128) ? 1 : 0;
}


x86 assembly (clang, -O0):
<fixnum_neg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x19(%rbp)
movzbl -0x19(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %al,-0x1a(%rbp)
movzbl -0x1a(%rbp),%eax
cmp    $0x7f,%eax
jg     113c <fixnum_neg+0x3c>
movsbl -0x1a(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1154 <fixnum_neg+0x54>
movzbl -0x1a(%rbp),%ecx
mov    $0xff,%eax
sub    %ecx,%eax
movsbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
sub    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movsbl -0x1(%rbp),%edx
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0xffffff80,%edx
cmove  %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixnum_neg>:
mov    %edi,%eax
neg    %al
mov    %al,(%rsi)
xor    %eax,%eax
cmp    $0x80,%dil
sete   %al
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @fixnum_neg(i8 signext %0, i8* %1, i32* %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i8
%8 = alloca i8
store i8 %0, i8* %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%9 = load i8, i8* %4
store i8 %9, i8* %7
%10 = load i8, i8* %7
%11 = zext i8 %10 to i32
%12 = sub nsw i32 0, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %8
%14 = load i8, i8* %8
%15 = zext i8 %14 to i32
%16 = icmp sle i32 %15, 127
br i1 %16, label %17, label %20
17: ; preds = %3
%18 = load i8, i8* %8
%19 = sext i8 %18 to i32
br label %28
20: ; preds = %3
%21 = load i8, i8* %8
%22 = zext i8 %21 to i32
%23 = sub nsw i32 255, %22
%24 = trunc i32 %23 to i8
%25 = sext i8 %24 to i32
%26 = sub nsw i32 0, %25
%27 = sub nsw i32 %26, 1
br label %28
28: ; preds = %20, %17
%29 = phi i32 [ %19, %17 ], [ %27, %20 ]
%30 = trunc i32 %29 to i8
%31 = load i8*, i8** %5
store i8 %30, i8* %31
%32 = load i8, i8* %4
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, -128
%35 = zext i1 %34 to i64
%36 = select i1 %34, i32 1, i32 0
%37 = load i32*, i32** %6
store i32 %36, i32* %37
ret void
}

LLVM IR (-O2):
define void @fixnum_neg(i8 signext %0, i8* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = sub i8 0, %0
store i8 %4, i8* %1
%5 = icmp eq i8 %0, -128
%6 = zext i1 %5 to i32
store i32 %6, i32* %2
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t bitops32_count(uint32_t bits) {
  uint8_t counter = 0;
  while (bits) {
    counter += bits % 2;
    bits >>= 1;
  }
  return counter;
}


x86 assembly (clang, -O0):
<bitops32_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1137 <bitops32_count+0x37>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bitops32_count+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitops32_count>:
xor    %eax,%eax
test   %edi,%edi
je     1129 <bitops32_count+0x29>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
shr    $0x1f,%edx
add    %edi,%edx
and    $0xfffffffe,%edx
mov    %edi,%esi
sub    %edx,%esi
add    %esi,%eax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bitops32_count+0x10>
ret

LLVM IR (-O0):
define i32 @bitops32_count(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = srem i32 %8, 2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = ashr i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @bitops32_count(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 2
%7 = add nsw i32 %4, %6
%8 = ashr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ floorf(float);
int n_fchop(int /*<<< orphan*/);
int n_frnd(float f) { return n_fchop(floorf(f + 0.5f)); }


x86 assembly (clang, -O0):
<n_frnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xecb(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
call   1030 <floorf@plt>
mov    %eax,%edi
call   1040 <n_fchop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_frnd>:
push   %rax
addss  0xed7(%rip),%xmm0
call   1030 <floorf@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <n_fchop@plt>

LLVM IR (-O0):
define i32 @n_frnd(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fadd float %3, 5.000000e-01
%5 = call i32 @floorf(float %4)
%6 = call i32 @n_fchop(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @n_frnd(float %0) {
%2 = fadd float %0, 5.000000e-01
%3 = tail call i32 @floorf(float %2)
%4 = tail call i32 @n_fchop(i32 %3)
ret i32 %4
}
double linearlyInterpolate(double v1, double v2, double t1, double t2,
                           double t) {
  if (v1 == v2)
    return v2;
  return (t - t1) / (t2 - t1) * v2 + (t2 - t) / (t2 - t1) * v1;
}


x86 assembly (clang, -O0):
<linearlyInterpolate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    1142 <linearlyInterpolate+0x42>
jp     1142 <linearlyInterpolate+0x42>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1189 <linearlyInterpolate+0x89>
movsd  -0x30(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
subsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm3
subsd  -0x20(%rbp),%xmm3
divsd  %xmm3,%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<linearlyInterpolate>:
ucomisd %xmm1,%xmm0
jne    110d <linearlyInterpolate+0xd>
jp     110d <linearlyInterpolate+0xd>
movapd %xmm1,%xmm0
ret
movapd %xmm4,%xmm5
subsd  %xmm2,%xmm5
movapd %xmm3,%xmm6
subsd  %xmm2,%xmm6
divsd  %xmm6,%xmm5
subsd  %xmm4,%xmm3
divsd  %xmm6,%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm1,%xmm5
addsd  %xmm3,%xmm5
movapd %xmm5,%xmm0
ret

LLVM IR (-O0):
define double @linearlyInterpolate(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
%12 = load double, double* %7
%13 = load double, double* %8
%14 = fcmp oeq double %12, %13
br i1 %14, label %15, label %17
15: ; preds = %5
%16 = load double, double* %8
store double %16, double* %6
br label %36
17: ; preds = %5
%18 = load double, double* %11
%19 = load double, double* %9
%20 = fsub double %18, %19
%21 = load double, double* %10
%22 = load double, double* %9
%23 = fsub double %21, %22
%24 = fdiv double %20, %23
%25 = load double, double* %8
%26 = load double, double* %10
%27 = load double, double* %11
%28 = fsub double %26, %27
%29 = load double, double* %10
%30 = load double, double* %9
%31 = fsub double %29, %30
%32 = fdiv double %28, %31
%33 = load double, double* %7
%34 = fmul double %32, %33
%35 = call double @llvm.fmuladd.f64(double %24, double %25, double %34)
store double %35, double* %6
br label %36
36: ; preds = %17, %15
%37 = load double, double* %6
ret double %37
}

LLVM IR (-O2):
define double @linearlyInterpolate(double %0, double %1, double %2, double %3, double %4) {
%6 = fcmp oeq double %0, %1
br i1 %6, label %15, label %7
7: ; preds = %5
%8 = fsub double %4, %2
%9 = fsub double %3, %2
%10 = fdiv double %8, %9
%11 = fsub double %3, %4
%12 = fdiv double %11, %9
%13 = fmul double %12, %0
%14 = tail call double @llvm.fmuladd.f64(double %10, double %1, double %13)
br label %15
15: ; preds = %5, %7
%16 = phi double [ %14, %7 ], [ %1, %5 ]
ret double %16
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_set_priority(void *m, int64_t priority) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_set_priority>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_set_priority>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_set_priority(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
void intel_fbdev_restore_mode(struct drm_device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.drm_device = type opaque
define void @intel_fbdev_restore_mode(%struct.drm_device* nocapture %0) {
ret void
}
void rop3_91_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S | *D;
  stk3 = ~stk3;
  stk2 = T | stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_91_1_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 -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_91_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
or     %sil,%cl
not    %cl
or     %dl,%cl
xor    %al,%cl
xor    %cl,%al
and    %sil,%al
xor    %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_91_1_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* %5
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = or i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = xor i32 %18, -1
%20 = trunc i32 %19 to i8
store i8 %20, i8* %9
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %9
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %8
%27 = load i8*, i8** %4
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = load i8, i8* %8
%31 = zext i8 %30 to i32
%32 = xor i32 %29, %31
%33 = trunc i32 %32 to i8
store i8 %33, i8* %7
%34 = load i8, i8* %7
%35 = zext i8 %34 to i32
%36 = load i8, i8* %5
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = load i8*, i8** %4
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = load i8, i8* %5
%44 = zext i8 %43 to i32
%45 = and i32 %42, %44
%46 = or i32 %39, %45
%47 = trunc i32 %46 to i8
%48 = load i8*, i8** %4
store i8 %47, i8* %48
ret void
}

LLVM IR (-O2):
define void @rop3_91_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %1
%6 = xor i8 %5, -1
%7 = or i8 %6, %2
%8 = xor i8 %7, %4
%9 = xor i8 %1, -1
%10 = and i8 %8, %9
%11 = and i8 %4, %1
%12 = or i8 %10, %11
store i8 %12, i8* %0
ret void
}
int ft_isflag(char c) {
  if (c == '#' || c == '0' || c == '-' || c == '+' || c == ' ' || c == '\'')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isflag>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x23,%eax
je     1158 <ft_isflag+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
je     1158 <ft_isflag+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     1158 <ft_isflag+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     1158 <ft_isflag+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1158 <ft_isflag+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x27,%eax
jne    1164 <ft_isflag+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <ft_isflag+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isflag>:
cmp    $0x30,%dil
ja     1120 <ft_isflag+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x1288900000000,%rdx
bt     %rcx,%rdx
jae    1120 <ft_isflag+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ft_isflag(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 35
br i1 %6, label %27, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 48
br i1 %10, label %27, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 45
br i1 %14, label %27, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 43
br i1 %18, label %27, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 32
br i1 %22, label %27, label %23
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 39
br i1 %26, label %27, label %28
27: ; preds = %23, %19, %15, %11, %7, %1
store i32 1, i32* %2
br label %29
28: ; preds = %23
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @ft_isflag(i8 signext %0) {
switch i8 %0, label %2 [
i8 48, label %3
i8 45, label %3
i8 43, label %3
i8 39, label %3
i8 35, label %3
i8 32, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ Perror(char *);
int /*<<< orphan*/ do_lock(char *);
scalar_t__ fork();
int /*<<< orphan*/ sleep(int);
void test() {
  pid_t pid;
  if ((pid = fork()) < 0) {
    Perror("fork error");
  } else if (pid == 0) {
    do_lock("lock.dat");
  } else {
    sleep(2);
    do_lock("lock.dat");
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <fork@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jge    116e <test+0x2e>
lea    0xe9c(%rip),%rdi
call   1060 <Perror@plt>
jmp    11a5 <test+0x65>
cmpq   $0x0,-0x8(%rbp)
jne    118a <test+0x4a>
lea    0xe8b(%rip),%rdi
call   1030 <do_lock@plt>
jmp    11a0 <test+0x60>
mov    $0x2,%edi
call   1040 <sleep@plt>
lea    0xe70(%rip),%rdi
call   1030 <do_lock@plt>
jmp    11a5 <test+0x65>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
js     1166 <test+0x26>
je     1159 <test+0x19>
mov    $0x2,%edi
call   1040 <sleep@plt>
lea    0xeab(%rip),%rdi
pop    %rax
jmp    1030 <do_lock@plt>
lea    0xe93(%rip),%rdi
pop    %rax
jmp    1060 <Perror@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"fork error\00"
@.str.1 = [9 x i8] c"lock.dat\00"
define void @test() {
%1 = alloca i64
%2 = call i64 (...) @fork()
store i64 %2, i64* %1
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @Perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %15
6: ; preds = %0
%7 = load i64, i64* %1
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @do_lock(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %14
11: ; preds = %6
%12 = call i32 @sleep(i32 2)
%13 = call i32 @do_lock(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %11, %9
br label %15
15: ; preds = %14, %4
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"fork error\00"
@.str.1 = [9 x i8] c"lock.dat\00"
define void @test() {
%1 = tail call i64 (...) @fork()
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @Perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %12
5: ; preds = %0
%6 = icmp eq i64 %1, 0
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 @do_lock(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %12
9: ; preds = %5
%10 = tail call i32 @sleep(i32 2)
%11 = tail call i32 @do_lock(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %7, %9, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: eti2mpa N\n");
  fprintf(stderr, "          N = sub-channel ID to output to stdout\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee3(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Usage: eti2mpa N\0A\00"
@.str.1 = [50 x i8] c" N = sub-channel ID to output to stdout\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Usage: eti2mpa N\0A\00"
@.str.1 = [50 x i8] c" N = sub-channel ID to output to stdout\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_SETFL;
int /*<<< orphan*/ fcntl(int, int /*<<< orphan*/, int);
void restore_flags(int fd, int flags) { fcntl(fd, F_SETFL, flags); }


x86 assembly (clang, -O0):
<restore_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restore_flags>:
mov    %esi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_SETFL = global i32 0
define void @restore_flags(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @F_SETFL
%7 = load i32, i32* %4
%8 = call i32 @fcntl(i32 %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@F_SETFL = global i32 0
define void @restore_flags(i32 %0, i32 %1) {
%3 = load i32, i32* @F_SETFL
%4 = tail call i32 @fcntl(i32 %0, i32 %3, i32 %1)
ret void
}
/* Type definitions */
struct cmsghdr {
  int dummy;
};

/* Variables and functions */
scalar_t__ CMSG_DATA(struct cmsghdr const *);
int /*<<< orphan*/ printf(char *, unsigned int const);
void print_ttl(const struct cmsghdr *c) {
  const unsigned int *ttl = (const unsigned int *)CMSG_DATA(c);
  printf("IP_TTL, {ttl=%u}", *ttl);
}


x86 assembly (clang, -O0):
<print_ttl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <CMSG_DATA@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.cmsghdr = type { i32 }
@.str = [17 x i8] c"IP_TTL, {ttl=%u}\00"
define void @print_ttl(%struct.cmsghdr* %0) {
%2 = alloca %struct.cmsghdr*
%3 = alloca i32*
store %struct.cmsghdr* %0, %struct.cmsghdr** %2
%4 = load %struct.cmsghdr*, %struct.cmsghdr** %2
%5 = call i64 @CMSG_DATA(%struct.cmsghdr* %4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
%struct.cmsghdr = type { i32 }
@.str = [17 x i8] c"IP_TTL, {ttl=%u}\00"
define void @print_ttl(%struct.cmsghdr* %0) {
%2 = tail call i64 @CMSG_DATA(%struct.cmsghdr* %0)
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Type definitions */
struct vm_area_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ flush_tlb_page(struct vm_area_struct *, unsigned long);
void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr) {
  flush_tlb_page(vma, vmaddr);
}


x86 assembly (clang, -O0):
<local_flush_tlb_page>:
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 <flush_tlb_page@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_flush_tlb_page>:
jmp    1030 <flush_tlb_page@plt>

LLVM IR (-O0):
%struct.vm_area_struct = type { i32 }
define void @local_flush_tlb_page(%struct.vm_area_struct* %0, i64 %1) {
%3 = alloca %struct.vm_area_struct*
%4 = alloca i64
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %3
store i64 %1, i64* %4
%5 = load %struct.vm_area_struct*, %struct.vm_area_struct** %3
%6 = load i64, i64* %4
%7 = call i32 @flush_tlb_page(%struct.vm_area_struct* %5, i64 %6)
ret void
}

LLVM IR (-O2):
%struct.vm_area_struct = type { i32 }
define void @local_flush_tlb_page(%struct.vm_area_struct* %0, i64 %1) {
%3 = tail call i32 @flush_tlb_page(%struct.vm_area_struct* %0, i64 %1)
ret void
}
/* Variables and functions */
#define SIGUSR1 128
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void fork_sig_handler(int signum) {
  switch (signum) {
  case SIGUSR1:
    exit(0);
    break;
  }
}


x86 assembly (clang, -O0):
<fork_sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x80,%eax
jne    1135 <fork_sig_handler+0x25>
jmp    112e <fork_sig_handler+0x1e>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork_sig_handler>:
cmp    $0x80,%edi
je     1119 <fork_sig_handler+0x9>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @fork_sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 128, label %4
]
4: ; preds = %1
%5 = call i32 @exit(i32 0)
unreachable
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @fork_sig_handler(i32 %0) {
%2 = icmp eq i32 %0, 128
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %1
ret void
}
/* Variables and functions */
size_t queue_record_size(size_t devpath_len) {
  return sizeof(unsigned long long int) + sizeof(unsigned short int) +
         devpath_len;
}


x86 assembly (clang, -O0):
<queue_record_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xa,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<queue_record_size>:
lea    0xa(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @queue_record_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 10, %3
ret i64 %4
}

LLVM IR (-O2):
define i64 @queue_record_size(i64 %0) {
%2 = add i64 %0, 10
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Derived2_destroy(void *this) {
  printf("Derived2"
         "::destroy()\n");
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Derived2::destroy()\0A\00"
define void @Derived2_destroy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"Derived2::destroy()\00"
define void @Derived2_destroy(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
char *strcpyX20(char *dest, char *src, int maxlen) {
  while (maxlen-- && (*dest = *src) != 0x20)
    dest++, src++;
  return dest;
}


x86 assembly (clang, -O0):
<strcpyX20>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     1140 <strcpyX20+0x40>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1150 <strcpyX20+0x50>
jmp    116d <strcpyX20+0x6d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110f <strcpyX20+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpyX20>:
mov    %rdi,%rax
test   %edx,%edx
je     1127 <strcpyX20+0x27>
mov    %edx,%edi
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
cmp    $0x20,%dl
je     1124 <strcpyX20+0x24>
add    $0x1,%rcx
cmp    %ecx,%edi
jne    1110 <strcpyX20+0x10>
add    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @strcpyX20(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
br label %7
7: ; preds = %19, %3
%8 = load i32, i32* %6
%9 = add nsw i32 %8, -1
store i32 %9, i32* %6
%10 = icmp ne i32 %8, 0
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8*, i8** %5
%13 = load i8, i8* %12
%14 = load i8*, i8** %4
store i8 %13, i8* %14
%15 = sext i8 %13 to i32
%16 = icmp ne i32 %15, 32
br label %17
17: ; preds = %11, %7
%18 = phi i1 [ false, %7 ], [ %16, %11 ]
br i1 %18, label %19, label %24
19: ; preds = %17
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %4
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %5
br label %7
24: ; preds = %17
%25 = load i8*, i8** %4
ret i8* %25
}

LLVM IR (-O2):
define i8* @strcpyX20(i8* writeonly %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %16, label %5
5: ; preds = %3, %12
%6 = phi i32 [ %9, %12 ], [ %2, %3 ]
%7 = phi i8* [ %14, %12 ], [ %1, %3 ]
%8 = phi i8* [ %13, %12 ], [ %0, %3 ]
%9 = add nsw i32 %6, -1
%10 = load i8, i8* %7
store i8 %10, i8* %8
%11 = icmp eq i8 %10, 32
br i1 %11, label %16, label %12
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = getelementptr inbounds i8, i8* %7, i64 1
%15 = icmp eq i32 %9, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %12, %3
%17 = phi i8* [ %0, %3 ], [ %13, %12 ], [ %8, %5 ]
ret i8* %17
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int ObReferenceObjectByHandle(int Handle, int DesiredAccess, int ObjectType,
                              int AccessMode, int Object,
                              int HandleInformation) {
  {
    int tmp_ndt_10;
    tmp_ndt_10 = __VERIFIER_nondet_int();
    if (tmp_ndt_10 == 0) {
      goto switch_10_0;
    } else {
      goto switch_10_default;
      if (0) {
      switch_10_0:
        return (0);
      switch_10_default:;
        return (-1073741823);
      } else {
      }
    }
  }
}


x86 assembly (clang, -O0):
<ObReferenceObjectByHandle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    1145 <ObReferenceObjectByHandle+0x35>
jmp    114a <ObReferenceObjectByHandle+0x3a>
jmp    1156 <ObReferenceObjectByHandle+0x46>
movl   $0x0,-0x4(%rbp)
jmp    115d <ObReferenceObjectByHandle+0x4d>
movl   $0xc0000001,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ObReferenceObjectByHandle>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
mov    $0xc0000001,%ecx
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ObReferenceObjectByHandle(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
%15 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %15, i32* %14
%16 = load i32, i32* %14
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %6
br label %22
19: ; preds = %6
br label %23
20: ; No predecessors!
br i1 false, label %21, label %24
21: ; preds = %20
br label %22
22: ; preds = %21, %18
store i32 0, i32* %7
br label %26
23: ; preds = %19
store i32 -1073741823, i32* %7
br label %26
24: ; preds = %20
br label %25
25: ; preds = %24
br label %26
26: ; preds = %22, %23, %25
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @ObReferenceObjectByHandle(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 (...) @__VERIFIER_nondet_int()
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 0, i32 -1073741823
ret i32 %9
}
/* Variables and functions */
char *epur_expr(char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ my_putchar(char);
int /*<<< orphan*/ my_putstr(char *);
int main(int argc, char **argv) {
  char *res;
  if ((res = epur_expr("1 + 5 * ++++5 ", "0123456789")) != NULL)
    my_putstr(res);
  my_putchar('\n');
  free(res);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1050 <epur_expr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1180 <main+0x40>
mov    -0x18(%rbp),%rdi
call   1060 <my_putstr@plt>
mov    $0xa,%edi
call   1040 <my_putchar@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1050 <epur_expr@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1164 <main+0x24>
mov    %rbx,%rdi
call   1060 <my_putstr@plt>
mov    $0xa,%edi
call   1040 <my_putchar@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"1 + 5 * ++++5 \00"
@.str.1 = [11 x i8] c"0123456789\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @epur_expr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
store i8* %7, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %6
%11 = call i32 @my_putstr(i8* %10)
br label %12
12: ; preds = %9, %2
%13 = call i32 @my_putchar(i8 signext 10)
%14 = load i8*, i8** %6
%15 = call i32 @free(i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"1 + 5 * ++++5 \00"
@.str.1 = [11 x i8] c"0123456789\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @epur_expr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @my_putstr(i8* %3)
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @my_putchar(i8 signext 10)
%9 = tail call i32 @free(i8* %3)
ret i32 0
}