xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a, b;
  scanf("%d - %d", &a, &b);
  scanf("%d-%d", &a, &b);
  printf("%d, %d\n", a, b);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <scanf@plt>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d - %d\00"
@.str.1 = [6 x i8] c"%d-%d\00"
@.str.2 = [8 x i8] c"%d, %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int strcmp(char const *const, char const *const);
int argcmp(const void *a1, const void *a2) {
  return (strcmp(*(const char *const *)a1, *(const char *const *)a2));
}


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

x86 assembly (clang, -O2):
<argcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @argcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int a = 19, b = 29, c = 0, k;
  k = a < b ? b < c ? b : c : b > c ? b : c;
  printf("%d", k);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x13,-0x8(%rbp)
movl   $0x1d,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1168 <main+0x58>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1157 <main+0x47>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    115d <main+0x4d>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    118b <main+0x7b>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    117f <main+0x6f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1185 <main+0x75>
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 19, i32* %2
store i32 29, i32* %3
store i32 0, i32* %4
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %19
9: ; preds = %0
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i32, i32* %3
br label %17
15: ; preds = %9
%16 = load i32, i32* %4
br label %17
17: ; preds = %15, %13
%18 = phi i32 [ %14, %13 ], [ %16, %15 ]
br label %29
19: ; preds = %0
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = icmp sgt i32 %20, %21
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = load i32, i32* %3
br label %27
25: ; preds = %19
%26 = load i32, i32* %4
br label %27
27: ; preds = %25, %23
%28 = phi i32 [ %24, %23 ], [ %26, %25 ]
br label %29
29: ; preds = %27, %17
%30 = phi i32 [ %18, %17 ], [ %28, %27 ]
store i32 %30, i32* %5
%31 = load i32, i32* %5
%32 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
void free_conv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @free_conv() {
ret void
}
double ft_clamp(double i, double a, double b) {
  if (i < a)
    i = a;
  if (i > b)
    i = b;
  return (i);
}


x86 assembly (clang, -O0):
<ft_clamp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <ft_clamp+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    114b <ft_clamp+0x4b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @ft_clamp(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%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 *, char *, char *);
void g_error(char *message) { printf("%s: %s\n", "cat", message); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [4 x i8] c"cat\00"
define void @g_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [4 x i8] c"cat\00"
define void @g_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
unsigned long SDHostIntStatus(unsigned long ulBase) {
  unsigned long ulIntStatus;
  ulIntStatus = (*((volatile unsigned long *)(0x44026000 + 0x000000A4)));
  ulIntStatus = (ulIntStatus << 30);
  ulIntStatus |=
      ((*((volatile unsigned long *)(ulBase + 0x00000230))) & 0x3FFFFFFF);
  return (ulIntStatus);
}


x86 assembly (clang, -O0):
<SDHostIntStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x440260a4,%eax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x1e,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x230(%rax),%rax
and    $0x3fffffff,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDHostIntStatus>:
mov    0x440260a4,%rcx
44
shl    $0x1e,%rcx
mov    0x230(%rdi),%rax
and    $0x3fffffff,%eax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @SDHostIntStatus(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1141006500 to i64*)
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = shl i64 %5, 30
store i64 %6, i64* %3
%7 = load i64, i64* %2
%8 = add i64 %7, 560
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, 1073741823
%12 = load i64, i64* %3
%13 = or i64 %12, %11
store i64 %13, i64* %3
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @SDHostIntStatus(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1141006500 to i64*)
%3 = shl i64 %2, 30
%4 = add i64 %0, 560
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 1073741823
%8 = or i64 %7, %3
ret i64 %8
}
void gtk_text_tag_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_tag_get_type() {
ret void
}
/* Variables and functions */
void *ho_memset(void *b, int c, size_t n) {
  char *p = (char *)b;
  while (n--) {
    *p++ = c;
  }
  return b;
}


x86 assembly (clang, -O0):
<ho_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     114b <ho_memset+0x4b>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    1117 <ho_memset+0x17>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ho_memset>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <ho_memset+0x11>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ho_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ Primes(int);
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *);
int main(void) {
  int v = 0;
  int r = scanf("%d\n", &v);
  if (r != 1) {
    printf("r: %d", r);
  } else {
    Primes(v);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     1177 <main+0x47>
mov    -0xc(%rbp),%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
jmp    117f <main+0x4f>
mov    -0x8(%rbp),%edi
call   1040 <Primes@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    115a <main+0x2a>
mov    0x4(%rsp),%edi
call   1040 <Primes@plt>
jmp    1168 <main+0x38>
lea    0xea3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"r: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %3)
br label %10
7: ; preds = %0
%8 = load i32, i32* %1
%9 = call i32 @Primes(i32 %8)
br label %10
10: ; preds = %7, %5
ret i32 0
}
int test_imm_6Duint8_mem(unsigned char *val) {
  return ((*val) & (0x6D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Duint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x6d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Duint8_mem>:
testb  $0x6d,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_6Duint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 109
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_6Duint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 109
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double doy2epb(year, doy)
int year;
double doy;
{
  double dj;
  dj = doy2jd(year, doy);
  return (jd2epb(dj));
}


x86 assembly (clang, -O0):
<doy2epb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1030 <doy2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%al
call   1040 <jd2epb@plt>
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doy2epb>:
push   %rax
mov    $0x1,%al
call   1030 <doy2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    $0x1,%al
call   1040 <jd2epb@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @doy2epb(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%6 = load i32, i32* %3
%7 = load double, double* %4
%8 = call i32 (i32, double, ...) bitcast (i32 (...)* @doy2jd to i32 (i32, double, ...)*)(i32 %6, double %7)
%9 = sitofp i32 %8 to double
store double %9, double* %5
%10 = load double, double* %5
%11 = call i32 (double, ...) bitcast (i32 (...)* @jd2epb to i32 (double, ...)*)(double %10)
%12 = sitofp i32 %11 to double
ret double %12
}

LLVM IR (-O2):
define double @doy2epb(i32 %0, double %1) {
%3 = tail call i32 (i32, double, ...) bitcast (i32 (...)* @doy2jd to i32 (i32, double, ...)*)(i32 %0, double %1)
%4 = sitofp i32 %3 to double
%5 = tail call i32 (double, ...) bitcast (i32 (...)* @jd2epb to i32 (double, ...)*)(double %4)
%6 = sitofp i32 %5 to double
ret double %6
}
char CAS(volatile void *addr, volatile void *value, void *newvalue) {
  register char ret;
  __asm__ __volatile__("# CAS \n\t"
                       ""
                       "cmpxchg %2, (%1) \n\t"
                       "sete %0               \n\t"
                       : "=a"(ret)
                       : "c"(addr), "d"(newvalue), "a"(value));
  return ret;
}


x86 assembly (clang, -O0):
<CAS>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rax
cmpxchg %rdx,(%rcx)
sete   %al
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CAS>:
mov    %rsi,%rax
mov    %rdi,%rcx
cmpxchg %rdx,(%rcx)
sete   %al
ret

LLVM IR (-O0):
define signext i8 @CAS(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %6
%10 = load i8*, i8** %5
%11 = call i8 asm sideeffect "# CAS \0A\09cmpxchg $2, ($1) \0A\09sete $0 \0A\09", "={ax},{cx},{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i8* %8, i8* %9, i8* %10)
store i8 %11, i8* %7
%12 = load i8, i8* %7
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @CAS(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8 asm sideeffect "# CAS \0A\09cmpxchg $2, ($1) \0A\09sete $0 \0A\09", "={ax},{cx},{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %2, i8* %1)
ret i8 %4
}
void glGetBufferPointerv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetBufferPointerv() {
ret void
}
/* Type definitions */
union bpf_attr {
  int map_fd;
  int /*<<< orphan*/ key;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_DELETE_ELEM;
int /*<<< orphan*/ memset(union bpf_attr *, int /*<<< orphan*/, int);
int /*<<< orphan*/ ptr_to_u64(void const *);
int sys_bpf(int /*<<< orphan*/, union bpf_attr *, int);
int bpf_map_delete_elem(int fd, const void *key) {
  union bpf_attr attr;
  memset(&attr, 0, sizeof(attr));
  attr.map_fd = fd;
  attr.key = ptr_to_u64(key);
  return sys_bpf(BPF_MAP_DELETE_ELEM, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_map_delete_elem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1050 <memset@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ptr_to_u64@plt>
mov    %eax,-0x18(%rbp)
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_map_delete_elem>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0x8(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1050 <memset@plt>
mov    %ebp,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <ptr_to_u64@plt>
mov    %eax,0x8(%rsp)
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_MAP_DELETE_ELEM = global i32 0
define i32 @bpf_map_delete_elem(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %union.bpf_attr
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = call i32 @memset(%union.bpf_attr* %5, i32 0, i32 4)
%7 = load i32, i32* %3
%8 = bitcast %union.bpf_attr* %5 to i32*
store i32 %7, i32* %8
%9 = load i8*, i8** %4
%10 = call i32 @ptr_to_u64(i8* %9)
%11 = bitcast %union.bpf_attr* %5 to i32*
store i32 %10, i32* %11
%12 = load i32, i32* @BPF_MAP_DELETE_ELEM
%13 = call i32 @sys_bpf(i32 %12, %union.bpf_attr* %5, i32 4)
ret i32 %13
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_MAP_DELETE_ELEM = global i32 0
define i32 @bpf_map_delete_elem(i32 %0, i8* %1) {
%3 = alloca %union.bpf_attr
%4 = bitcast %union.bpf_attr* %3 to i8*
%5 = call i32 @memset(%union.bpf_attr* %3, i32 0, i32 4)
%6 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %3, i64 0, i32 0
store i32 %0, i32* %6
%7 = call i32 @ptr_to_u64(i8* %1)
store i32 %7, i32* %6
%8 = load i32, i32* @BPF_MAP_DELETE_ELEM
%9 = call i32 @sys_bpf(i32 %8, %union.bpf_attr* %3, i32 4)
ret i32 %9
}
void test() {
  union incomplete;
  union {
    int value;
    char byte[4];
  } data;
  data.value = 0;
  data.byte[0] = 255;
  union complete {
    union incomplete *i;
  } completed;
  union incomplete {
    int a;
  } incompleted = {255};
  completed.i = &incompleted;
  expecti(data.value, 255);
  expecti(completed.i->a, 255);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x8(%rbp)
movb   $0xff,-0x8(%rbp)
mov    0xed7(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    $0xff,%esi
mov    $0x0,%al
call   1030 <expecti@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    $0xff,%esi
mov    $0x0,%al
call   1030 <expecti@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0xff,%edi
mov    $0xff,%esi
xor    %eax,%eax
call   1030 <expecti@plt>
mov    $0xff,%edi
mov    $0xff,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <expecti@plt>

LLVM IR (-O0):
%union.incomplete = type { i32 }
%union.anon = type { i32 }
%union.complete = type { %union.incomplete* }
@__const.test.incompleted = %union.incomplete { i32 255 }
define void @test() {
%1 = alloca %union.anon
%2 = alloca %union.complete
%3 = alloca %union.incomplete
%4 = bitcast %union.anon* %1 to i32*
store i32 0, i32* %4
%5 = bitcast %union.anon* %1 to [4 x i8]*
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
store i8 -1, i8* %6
%7 = bitcast %union.incomplete* %3 to i8*
%8 = bitcast %union.complete* %2 to %union.incomplete**
store %union.incomplete* %3, %union.incomplete** %8
%9 = bitcast %union.anon* %1 to i32*
%10 = load i32, i32* %9
%11 = call i32 (i32, i32, ...) bitcast (i32 (...)* @expecti to i32 (i32, i32, ...)*)(i32 %10, i32 255)
%12 = bitcast %union.complete* %2 to %union.incomplete**
%13 = load %union.incomplete*, %union.incomplete** %12
%14 = bitcast %union.incomplete* %13 to i32*
%15 = load i32, i32* %14
%16 = call i32 (i32, i32, ...) bitcast (i32 (...)* @expecti to i32 (i32, i32, ...)*)(i32 %15, i32 255)
ret void
}

LLVM IR (-O2):
%union.incomplete = type { i32 }
define void @test() {
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @expecti to i32 (i32, i32, ...)*)(i32 255, i32 255)
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @expecti to i32 (i32, i32, ...)*)(i32 255, i32 255)
ret void
}
int test_imm_80uint16_reg(unsigned short val) {
  return ((val) & (0x80 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_80uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x80,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_80uint16_reg>:
test   $0x80,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_80uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 128
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_80uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 128
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ tempString;

/* Variables and functions */
int setStandardProcedure(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, double);
int setTrackFreq(double trackF) {
  char tempString[16];
  snprintf(tempString, sizeof(tempString), "#:ST %04.1f#", trackF);
  return (setStandardProcedure(tempString));
}


x86 assembly (clang, -O0):
<setTrackFreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
mov    $0x10,%esi
lea    0xebe(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <setStandardProcedure@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setTrackFreq>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <setStandardProcedure@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"#:ST %04.1f#\00"
define i32 @setTrackFreq(double %0) {
%2 = alloca double
%3 = alloca [16 x i8]
store double %0, double* %2
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = load double, double* %2
%6 = call i32 @snprintf(i8* %4, i32 16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %5)
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%8 = call i32 @setStandardProcedure(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [13 x i8] c"#:ST %04.1f#\00"
define i32 @setTrackFreq(double %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %0)
%5 = call i32 @setStandardProcedure(i8* %3)
ret i32 %5
}
/* Variables and functions */
const char *get_region_name_ST(int region_code) {
  switch (region_code) {
  case 1:
    return "Principe";
  case 2:
    return "Sao Tome";
  default:
    return NULL;
  }
}


x86 assembly (clang, -O0):
<get_region_name_ST>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     112c <get_region_name_ST+0x2c>
jmp    111b <get_region_name_ST+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     113c <get_region_name_ST+0x3c>
jmp    114c <get_region_name_ST+0x4c>
lea    0xecd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <get_region_name_ST+0x54>
lea    0xec6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <get_region_name_ST+0x54>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_region_name_ST>:
xor    %ecx,%ecx
cmp    $0x2,%edi
lea    0xefd(%rip),%rax
cmove  %rax,%rcx
cmp    $0x1,%edi
lea    0xee6(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Principe\00"
@.str.1 = [9 x i8] c"Sao Tome\00"
define i8* @get_region_name_ST(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 1, label %5
i32 2, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [9 x i8] c"Principe\00"
@.str.1 = [9 x i8] c"Sao Tome\00"
define i8* @get_region_name_ST(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
double cmp(double, int);
double dblCmp(double a, int b) { return cmp(a, b); }


x86 assembly (clang, -O0):
<dblCmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1030 <cmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dblCmp>:
jmp    1030 <cmp@plt>

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

LLVM IR (-O2):
define double @dblCmp(double %0, i32 %1) {
%3 = tail call double @cmp(double %0, i32 %1)
ret double %3
}
void rop3_200_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | T;
  stk1 = S & stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @rop3_200_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %2
%6 = and i8 %5, %1
%7 = xor i8 %1, -1
%8 = and i8 %7, %2
%9 = and i8 %8, %4
%10 = or i8 %6, %9
store i8 %10, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;
typedef int /*<<< orphan*/ u_int16_t;

/* Variables and functions */
int str_to_u16(char const *, int /*<<< orphan*/ *, int /*<<< orphan*/,
               int /*<<< orphan*/);
int str_to_u8(const char *str, u_int8_t *u8_out, u_int8_t min, u_int8_t max) {
  u_int16_t result;
  int error;
  error = str_to_u16(str, &result, min, max);
  if (error)
    return error;
  *u8_out = result;
  return 0;
}


x86 assembly (clang, -O0):
<str_to_u8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    -0x24(%rbp),%rsi
call   1030 <str_to_u16@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     1151 <str_to_u8+0x41>
mov    -0x28(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <str_to_u8+0x51>
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_to_u8>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xc(%rsp),%rsi
call   1030 <str_to_u16@plt>
test   %eax,%eax
jne    112c <str_to_u8+0x1c>
mov    0xc(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @str_to_u8(i8* %0, i32* nocapture writeonly %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
%7 = call i32 @str_to_u16(i8* %0, i32* %5, i32 %2, i32 %3)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = load i32, i32* %5
store i32 %10, i32* %1
br label %11
11: ; preds = %4, %9
ret i32 %7
}
int main(int argc, char **argv) {
  int var;
  __atomic_add_fetch(&var, 1, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
mov    %ecx,%eax
lock xadd %eax,-0x14(%rbp)
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lock addl $0x1,-0x4(%rsp)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
%9 = load i32, i32* %7
%10 = atomicrmw add i32* %6, i32 %9 monotonic
%11 = add i32 %10, %9
store i32 %11, i32* %8
%12 = load i32, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = atomicrmw add i32* %3, i32 1 monotonic
ret i32 0
}
struct s33 {
  float a;
  long long : 0;
} f33(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<f33>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <f33+0x9>
jmp    1109 <f33+0x9>

x86 assembly (clang, -O2):
<f33>:
jmp    1100 <f33>

LLVM IR (-O0):
define float @f33() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define float @f33() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void protobuf_c_system_free(void *allocator_data, void *data) { free(data); }


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

x86 assembly (clang, -O2):
<protobuf_c_system_free>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @protobuf_c_system_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cam16o(int /*<<< orphan*/, int, int /*<<< orphan*/, int,
                          int);
int /*<<< orphan*/ cam_interrupt_enable(int /*<<< orphan*/);
int /*<<< orphan*/ cam_lam_clear(int /*<<< orphan*/, int);
int /*<<< orphan*/ camc(int /*<<< orphan*/, int, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
void isr(void) {
  cam16o(0, 1, 0, 16, 0xFF);
  cam16o(0, 1, 0, 16, 0);
  camc(0, 1, 0, 10);
  cam_lam_clear(0, 1);
  cam_interrupt_enable(0);
  printf("ISR\n");
}


x86 assembly (clang, -O0):
<isr>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    $0x1,%esi
mov    $0x10,%ecx
mov    $0xff,%r8d
mov    %edx,%edi
call   1070 <cam16o@plt>
xor    %r8d,%r8d
mov    $0x1,%esi
mov    $0x10,%ecx
mov    %r8d,%edi
mov    %r8d,%edx
call   1070 <cam16o@plt>
xor    %edx,%edx
mov    $0x1,%esi
mov    $0xa,%ecx
mov    %edx,%edi
call   1030 <camc@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1060 <cam_lam_clear@plt>
xor    %edi,%edi
call   1050 <cam_interrupt_enable@plt>
lea    0xe4e(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<isr>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x10,%ecx
mov    $0xff,%r8d
call   1070 <cam16o@plt>
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x10,%ecx
xor    %r8d,%r8d
call   1070 <cam16o@plt>
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0xa,%ecx
call   1030 <camc@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1060 <cam_lam_clear@plt>
xor    %edi,%edi
call   1050 <cam_interrupt_enable@plt>
lea    0xe53(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"ISR\0A\00"
define void @isr() {
%1 = call i32 @cam16o(i32 0, i32 1, i32 0, i32 16, i32 255)
%2 = call i32 @cam16o(i32 0, i32 1, i32 0, i32 16, i32 0)
%3 = call i32 @camc(i32 0, i32 1, i32 0, i32 10)
%4 = call i32 @cam_lam_clear(i32 0, i32 1)
%5 = call i32 @cam_interrupt_enable(i32 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [4 x i8] c"ISR\00"
define void @isr() {
%1 = tail call i32 @cam16o(i32 0, i32 1, i32 0, i32 16, i32 255)
%2 = tail call i32 @cam16o(i32 0, i32 1, i32 0, i32 16, i32 0)
%3 = tail call i32 @camc(i32 0, i32 1, i32 0, i32 10)
%4 = tail call i32 @cam_lam_clear(i32 0, i32 1)
%5 = tail call i32 @cam_interrupt_enable(i32 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void task_c(void) {
  unsigned int n = 0;
  while (1) {
    printf("  task c: %i\n", n++);
    volatile int i;
    for (i = 0; i < 10000000; ++i)
      ;
  }
}


x86 assembly (clang, -O0):
<task_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x989680,%eax
jge    115e <task_c+0x4e>
jmp    1150 <task_c+0x40>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <task_c+0x2d>
jmp    111f <task_c+0xf>

x86 assembly (clang, -O2):
<task_c>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
jmp    1123 <task_c+0x13>
nop
add    $0x1,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
movl   $0x0,0x4(%rsp)
mov    0x4(%rsp),%eax
cmp    $0x98967f,%eax
jg     1120 <task_c+0x10>
addl   $0x1,0x4(%rsp)
mov    0x4(%rsp),%eax
cmp    $0x989680,%eax
jl     1140 <task_c+0x30>
jmp    1120 <task_c+0x10>

LLVM IR (-O0):
@.str = [14 x i8] c" task c: %i\0A\00"
define void @task_c() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %14
%4 = load i32, i32* %1
%5 = add i32 %4, 1
store i32 %5, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
store volatile i32 0, i32* %2
br label %7
7: ; preds = %11, %3
%8 = load volatile i32, i32* %2
%9 = icmp slt i32 %8, 10000000
br i1 %9, label %10, label %14
10: ; preds = %7
br label %11
11: ; preds = %10
%12 = load volatile i32, i32* %2
%13 = add nsw i32 %12, 1
store volatile i32 %13, i32* %2
br label %7
14: ; preds = %7
br label %3
}

LLVM IR (-O2):
@.str = [14 x i8] c" task c: %i\0A\00"
define void @task_c() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %14, %0
%4 = phi i32 [ 0, %0 ], [ %5, %14 ]
%5 = add i32 %4, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
store volatile i32 0, i32* %1
%7 = load volatile i32, i32* %1
%8 = icmp slt i32 %7, 10000000
br i1 %8, label %9, label %14
9: ; preds = %3, %9
%10 = load volatile i32, i32* %1
%11 = add nsw i32 %10, 1
store volatile i32 %11, i32* %1
%12 = load volatile i32, i32* %1
%13 = icmp slt i32 %12, 10000000
br i1 %13, label %9, label %14
14: ; preds = %9, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ check_size_t(size_t *, size_t *, char *);
void check_size_t_(size_t *x, size_t *y, char *ret) { check_size_t(x, y, ret); }


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

x86 assembly (clang, -O2):
<check_size_t_>:
jmp    1030 <check_size_t@plt>

LLVM IR (-O0):
define void @check_size_t_(i64* %0, i64* %1, i8* %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i8*
store i64* %0, i64** %4
store i64* %1, i64** %5
store i8* %2, i8** %6
%7 = load i64*, i64** %4
%8 = load i64*, i64** %5
%9 = load i8*, i8** %6
%10 = call i32 @check_size_t(i64* %7, i64* %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @check_size_t_(i64* %0, i64* %1, i8* %2) {
%4 = tail call i32 @check_size_t(i64* %0, i64* %1, i8* %2)
ret void
}
extern int isonum_733(p)
unsigned char *p;
{ return isonum_731(p); }


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

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

LLVM IR (-O0):
define i32 @isonum_733(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @isonum_731 to i32 (i8*, ...)*)(i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @isonum_733(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @isonum_731 to i32 (i8*, ...)*)(i8* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ pow(double, double);
int optimal_nside(double lb, double rmax, int np) {
  int nside1 = (int)(8.0 * lb / rmax);
  int nside2 = (int)(pow(0.5 * np, 0.3333333));
  return (((nside1) < (nside2)) ? (nside1) : (nside2));
}


x86 assembly (clang, -O0):
<optimal_nside>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  0xee3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xebd(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xea9(%rip),%xmm1
call   1030 <pow@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1176 <optimal_nside+0x66>
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    117c <optimal_nside+0x6c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<optimal_nside>:
push   %rbx
mulsd  0xee7(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
mulsd  0xed8(%rip),%xmm0
movsd  0xed8(%rip),%xmm1
call   1030 <pow@plt>
cmp    %eax,%ebx
cmovl  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @optimal_nside(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store double %0, double* %4
store double %1, double* %5
store i32 %2, i32* %6
%9 = load double, double* %4
%10 = fmul double 8.000000e+00, %9
%11 = load double, double* %5
%12 = fdiv double %10, %11
%13 = fptosi double %12 to i32
store i32 %13, i32* %7
%14 = load i32, i32* %6
%15 = sitofp i32 %14 to double
%16 = fmul double 5.000000e-01, %15
%17 = call i64 @pow(double %16, double 0x3FD55555318ABC87)
%18 = trunc i64 %17 to i32
store i32 %18, i32* %8
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %3
%23 = load i32, i32* %7
br label %26
24: ; preds = %3
%25 = load i32, i32* %8
br label %26
26: ; preds = %24, %22
%27 = phi i32 [ %23, %22 ], [ %25, %24 ]
ret i32 %27
}

LLVM IR (-O2):
define i32 @optimal_nside(double %0, double %1, i32 %2) {
%4 = fmul double %0, 8.000000e+00
%5 = fdiv double %4, %1
%6 = fptosi double %5 to i32
%7 = sitofp i32 %2 to double
%8 = fmul double %7, 5.000000e-01
%9 = tail call i64 @pow(double %8, double 0x3FD55555318ABC87)
%10 = trunc i64 %9 to i32
%11 = icmp slt i32 %6, %10
%12 = select i1 %11, i32 %6, i32 %10
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ system(char *);
int network_setup(pid_t pid) {
  char *set_pid_ns;
  asprintf(&set_pid_ns, "ip link set veth1 netns %d", pid);
  system(set_pid_ns);
  free(set_pid_ns);
  return 0;
}


x86 assembly (clang, -O0):
<network_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    -0x10(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1050 <asprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <system@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<network_setup>:
push   %rax
mov    %edi,%edx
lea    0xec6(%rip),%rsi
mov    %rsp,%rdi
call   1050 <asprintf@plt>
mov    (%rsp),%rdi
call   1040 <system@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"ip link set veth1 netns %d\00"
define i32 @network_setup(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i8*, i8** %3
%7 = call i32 @system(i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"ip link set veth1 netns %d\00"
define i32 @network_setup(i32 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = load i8*, i8** %2
%6 = call i32 @system(i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
ret i32 0
}