xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ft_putnbr(int);
int /*<<< orphan*/ ft_putstr(char *);
void mod(int a, int b) {
  if (b == 0)
    ft_putstr("Stop : modulo by zero");
  else
    ft_putnbr(a % b);
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1149 <mod+0x29>
lea    0xec1(%rip),%rdi
call   1040 <ft_putstr@plt>
jmp    1157 <mod+0x37>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%edi
call   1030 <ft_putnbr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
test   %esi,%esi
je     1130 <mod+0x10>
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%edi
jmp    1030 <ft_putnbr@plt>
lea    0xec9(%rip),%rdi
jmp    1040 <ft_putstr@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Stop : modulo by zero\00"
define void @mod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @ft_putstr(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %14
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = srem i32 %10, %11
%13 = call i32 @ft_putnbr(i32 %12)
br label %14
14: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Stop : modulo by zero\00"
define void @mod(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %9
6: ; preds = %2
%7 = srem i32 %0, %1
%8 = tail call i32 @ft_putnbr(i32 %7)
br label %9
9: ; preds = %6, %4
ret void
}
/* Variables and functions */
int add(int, int);
int main() {
  int x = 0;
  for (int i = 0; i < 1000000; i = i + 1) {
    x = add(x, 1);
    ;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xf4240,-0xc(%rbp)
jge    1158 <main+0x48>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
mov    $0xf4240,%ebx
nopl   0x0(%rax,%rax,1)
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 %5
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %6, %2 ]
%4 = phi i32 [ 0, %0 ], [ %5, %2 ]
%5 = tail call i32 @add(i32 %4, i32 1)
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 1000000
br i1 %7, label %1, label %2
}
long long power(int b) {
  long long p = 1;
  int i;
  for (i = 0; i < b; i++)
    p = p * 2;
  return p;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113c <power+0x3c>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1116 <power+0x16>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %edi,%edi
jle    1118 <power+0x18>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111e <power+0x1e>
mov    $0x1,%eax
jmp    1139 <power+0x39>
mov    $0x1,%eax
ret
and    $0xfffffff8,%edi
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
shl    $0x8,%rax
add    $0xfffffff8,%edi
jne    1130 <power+0x30>
test   %ecx,%ecx
je     1148 <power+0x48>
nopl   (%rax)
add    %rax,%rax
add    $0xffffffff,%ecx
jne    1140 <power+0x40>
ret

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

LLVM IR (-O2):
define i64 @power(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %25
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %15, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i64 [ 1, %7 ], [ %12, %9 ]
%11 = phi i32 [ 0, %7 ], [ %13, %9 ]
%12 = shl i64 %10, 8
%13 = add i32 %11, 8
%14 = icmp eq i32 %13, %8
br i1 %14, label %15, label %9
15: ; preds = %9, %3
%16 = phi i64 [ undef, %3 ], [ %12, %9 ]
%17 = phi i64 [ 1, %3 ], [ %12, %9 ]
%18 = icmp eq i32 %5, 0
br i1 %18, label %25, label %19
19: ; preds = %15, %19
%20 = phi i64 [ %22, %19 ], [ %17, %15 ]
%21 = phi i32 [ %23, %19 ], [ 0, %15 ]
%22 = shl nsw i64 %20, 1
%23 = add i32 %21, 1
%24 = icmp eq i32 %23, %5
br i1 %24, label %25, label %19
25: ; preds = %15, %19, %1
%26 = phi i64 [ 1, %1 ], [ %16, %15 ], [ %22, %19 ]
ret i64 %26
}
/* Type definitions */
struct drunkard {
  int dummy;
};

/* Variables and functions */
int drunkard_get_target_x(struct drunkard *);
int drunkard_get_x(struct drunkard *);
int drunkard_get_dx_to_target(struct drunkard *drunk) {
  return drunkard_get_target_x(drunk) - drunkard_get_x(drunk);
}


x86 assembly (clang, -O0):
<drunkard_get_dx_to_target>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <drunkard_get_target_x@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <drunkard_get_x@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drunkard_get_dx_to_target>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <drunkard_get_target_x@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <drunkard_get_x@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.drunkard = type { i32 }
define i32 @drunkard_get_dx_to_target(%struct.drunkard* %0) {
%2 = alloca %struct.drunkard*
store %struct.drunkard* %0, %struct.drunkard** %2
%3 = load %struct.drunkard*, %struct.drunkard** %2
%4 = call i32 @drunkard_get_target_x(%struct.drunkard* %3)
%5 = load %struct.drunkard*, %struct.drunkard** %2
%6 = call i32 @drunkard_get_x(%struct.drunkard* %5)
%7 = sub nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
%struct.drunkard = type { i32 }
define i32 @drunkard_get_dx_to_target(%struct.drunkard* %0) {
%2 = tail call i32 @drunkard_get_target_x(%struct.drunkard* %0)
%3 = tail call i32 @drunkard_get_x(%struct.drunkard* %0)
%4 = sub nsw i32 %2, %3
ret i32 %4
}
/* Variables and functions */
long lcm(int, long);
long smallestMultiple(int range) {
  int stop = range / 2;
  long l = range;
  while (range > stop) {
    l = lcm(--range, l);
  }
  return l;
}


x86 assembly (clang, -O0):
<smallestMultiple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1158 <smallestMultiple+0x48>
mov    -0x4(%rbp),%edi
add    $0xffffffff,%edi
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rsi
call   1030 <lcm@plt>
mov    %rax,-0x10(%rbp)
jmp    1131 <smallestMultiple+0x21>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smallestMultiple>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
shr    $0x1f,%ebp
add    %edi,%ebp
sar    %ebp
movslq %edi,%rax
cmp    %eax,%ebp
jge    1141 <smallestMultiple+0x31>
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0xffffffff,%ebx
mov    %ebx,%edi
mov    %rax,%rsi
call   1030 <lcm@plt>
cmp    %ebp,%ebx
jg     1130 <smallestMultiple+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @smallestMultiple(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 2
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
store i64 %8, i64* %4
br label %9
9: ; preds = %13, %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i32, i32* %2
%15 = add nsw i32 %14, -1
store i32 %15, i32* %2
%16 = load i64, i64* %4
%17 = call i64 @lcm(i32 %15, i64 %16)
store i64 %17, i64* %4
br label %9
18: ; preds = %9
%19 = load i64, i64* %4
ret i64 %19
}

LLVM IR (-O2):
define i64 @smallestMultiple(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = sext i32 %0 to i64
%4 = icmp slt i32 %2, %0
br i1 %4, label %5, label %11
5: ; preds = %1, %5
%6 = phi i64 [ %9, %5 ], [ %3, %1 ]
%7 = phi i32 [ %8, %5 ], [ %0, %1 ]
%8 = add nsw i32 %7, -1
%9 = tail call i64 @lcm(i32 %8, i64 %6)
%10 = icmp sgt i32 %8, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %1
%12 = phi i64 [ %3, %1 ], [ %9, %5 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i;
  for (i = 0; i <= 255; i++) {
    printf("%d ---> %c\n", i, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"%d ---> %c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
int strictly_smaller_name(char *s, char *t) {
  int ss, tt;
  while ((*s != '\0') || (*t != '\0')) {
    if (*s == '\0')
      ss = '*';
    else
      ss = *s++;
    if (*t != '\0')
      tt = *t;
    if (ss == tt)
      return 0;
  }
}


x86 assembly (clang, -O0):
<strictly_smaller_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x21(%rbp)
jne    1131 <strictly_smaller_name+0x31>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1141 <strictly_smaller_name+0x41>
jmp    11a9 <strictly_smaller_name+0xa9>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    115d <strictly_smaller_name+0x5d>
movl   $0x2a,-0x1c(%rbp)
jmp    1172 <strictly_smaller_name+0x72>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     118c <strictly_smaller_name+0x8c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    11a4 <strictly_smaller_name+0xa4>
movl   $0x0,-0x4(%rbp)
jmp    11a9 <strictly_smaller_name+0xa9>
jmp    110c <strictly_smaller_name+0xc>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @strictly_smaller_name(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %8
8: ; preds = %45, %2
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %18, label %13
13: ; preds = %8
%14 = load i8*, i8** %5
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %13, %8
%19 = phi i1 [ true, %8 ], [ %17, %13 ]
br i1 %19, label %20, label %46
20: ; preds = %18
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %20
store i32 42, i32* %6
br label %31
26: ; preds = %20
%27 = load i8*, i8** %4
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %4
%29 = load i8, i8* %27
%30 = sext i8 %29 to i32
store i32 %30, i32* %6
br label %31
31: ; preds = %26, %25
%32 = load i8*, i8** %5
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %40
36: ; preds = %31
%37 = load i8*, i8** %5
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
store i32 %39, i32* %7
br label %40
40: ; preds = %36, %31
%41 = load i32, i32* %6
%42 = load i32, i32* %7
%43 = icmp eq i32 %41, %42
br i1 %43, label %44, label %45
44: ; preds = %40
store i32 0, i32* %3
br label %46
45: ; preds = %40
br label %8
46: ; preds = %44, %18
%47 = load i32, i32* %3
ret i32 %47
}

LLVM IR (-O2):
define i32 @strictly_smaller_name(i8* nocapture %0, i8* nocapture %1) {
ret i32 0
}
const char *orph_get_title(void) { return "Create many open unlinked files"; }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"Create many open unlinked files\00"
define i8* @orph_get_title() {
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [32 x i8] c"Create many open unlinked files\00"
define i8* @orph_get_title() {
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int EAGAIN;
int idrnet_geteagain() { return EAGAIN; }


x86 assembly (clang, -O0):
<idrnet_geteagain>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<idrnet_geteagain>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EAGAIN = global i32 0
define i32 @idrnet_geteagain() {
%1 = load i32, i32* @EAGAIN
ret i32 %1
}

LLVM IR (-O2):
@EAGAIN = global i32 0
define i32 @idrnet_geteagain() {
%1 = load i32, i32* @EAGAIN
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void EXTI2_IRQHandler() { default_handler(); }


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

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

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

LLVM IR (-O2):
define weak void @EXTI2_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
int cmp_ints(const void *a, const void *b) {
  return *(const int *)a - *(const int *)b;
}


x86 assembly (clang, -O0):
<cmp_ints>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_ints>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @cmp_ints(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 i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmp_ints(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
char request_compare(void *i1, void *i2) {
  if (*((unsigned int *)i1) == *((unsigned int *)i2))
    return (0);
  else
    return (1);
}


x86 assembly (clang, -O0):
<request_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    1127 <request_compare+0x27>
movb   $0x0,-0x1(%rbp)
jmp    112b <request_compare+0x2b>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<request_compare>:
mov    (%rdi),%eax
cmp    (%rsi),%eax
setne  %al
ret

LLVM IR (-O0):
define signext i8 @request_compare(i8* %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = icmp eq i32 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i8 0, i8* %3
br label %15
14: ; preds = %2
store i8 1, i8* %3
br label %15
15: ; preds = %14, %13
%16 = load i8, i8* %3
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @request_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp ne i32 %4, %6
%8 = zext i1 %7 to i8
ret i8 %8
}
/* Type definitions */
struct utmp {
  int dummy;
};

/* Variables and functions */
struct utmp *getutent(void) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.utmp = type { i32 }
define %struct.utmp* @getutent() {
ret %struct.utmp* null
}

LLVM IR (-O2):
%struct.utmp = type { i32 }
define noalias %struct.utmp* @getutent() {
ret %struct.utmp* null
}
/* Variables and functions */
int epoll_create1(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int epoll_init() {
  int efd;
  efd = epoll_create1(0);
  if (efd == -1) {
    perror("epoll_create1");
    return efd;
  }
  return efd;
}


x86 assembly (clang, -O0):
<epoll_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <epoll_create1@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1153 <epoll_init+0x33>
lea    0xebd(%rip),%rdi
call   1030 <perror@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <epoll_init+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epoll_init>:
push   %rbx
xor    %edi,%edi
call   1040 <epoll_create1@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1133 <epoll_init+0x13>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec6(%rip),%rdi
call   1030 <perror@plt>
jmp    112f <epoll_init+0xf>

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

LLVM IR (-O2):
@.str = [14 x i8] c"epoll_create1\00"
define i32 @epoll_init() {
%1 = tail call i32 @epoll_create1(i32 0)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
ret i32 %1
}
/* Variables and functions */
int dcloadsyscall(int, char const *, int);
int creat(const char *path, int mode) {
  if (*(unsigned int *)0x8c004004 == 0xdeadbeef)
    return dcloadsyscall(4, path, mode);
  else
    return -1;
}


x86 assembly (clang, -O0):
<creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    1149 <creat+0x39>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x4,%edi
call   1030 <dcloadsyscall@plt>
mov    %eax,-0x4(%rbp)
jmp    1150 <creat+0x40>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creat>:
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    112c <creat+0x1c>
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x4,%edi
jmp    1030 <dcloadsyscall@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @creat(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%7 = icmp eq i32 %6, -559038737
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @dcloadsyscall(i32 4, i8* %9, i32 %10)
store i32 %11, i32* %3
br label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @creat(i8* %0, i32 %1) {
%3 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%4 = icmp eq i32 %3, -559038737
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @dcloadsyscall(i32 4, i8* %0, i32 %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %8
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRE7_get(void) { return U_WMRCORENONE_get("U_WMRE7"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRE7\00"
define i32 @U_WMRE7_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRE7\00"
define i32 @U_WMRE7_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void plus1(void) {
  extern int i;
  i += 1;
}


x86 assembly (clang, -O0):
<plus1>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    0x2ed1(%rip),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<plus1>:
mov    0x2ee1(%rip),%rax
addl   $0x1,(%rax)
ret

LLVM IR (-O0):
@i = external global i32
define void @plus1() {
%1 = load i32, i32* @i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @i
ret void
}

LLVM IR (-O2):
@i = external global i32
define void @plus1() {
%1 = load i32, i32* @i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @i
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *, char const *);
void usage(const char *progname) {
  errx(1,
       "Usage: %s output.png [-h height] "
       "[-c color] [-s scaling]",
       progname);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"Usage: %s output.png [-h height] [-c color] [-s scaling]\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @errx(i32 1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c"Usage: %s output.png [-h height] [-c color] [-s scaling]\00"
define void @usage(i8* %0) {
%2 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void f_void1(void) { return; }


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

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

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

LLVM IR (-O2):
define void @f_void1() {
ret void
}
void mobicore_log_free(void) {}


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

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

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

LLVM IR (-O2):
define void @mobicore_log_free() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_t;
typedef int mpfr_rnd_t;

/* Variables and functions */
int /*<<< orphan*/ mpfr_set_d(int /*<<< orphan*/, double, int);
void mpfrsetd(mpfr_t r1, double *d, mpfr_rnd_t *irnd) {
  double d1;
  int n1;
  d1 = *d;
  n1 = *irnd;
  mpfr_set_d(r1, d1, n1);
}


x86 assembly (clang, -O0):
<mpfrsetd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x20(%rbp),%xmm0
mov    -0x24(%rbp),%esi
call   1030 <mpfr_set_d@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpfrsetd>:
movsd  (%rsi),%xmm0
mov    (%rdx),%esi
jmp    1030 <mpfr_set_d@plt>

LLVM IR (-O0):
define void @mpfrsetd(i32 %0, double* %1, i32* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca i32*
%7 = alloca double
%8 = alloca i32
store i32 %0, i32* %4
store double* %1, double** %5
store i32* %2, i32** %6
%9 = load double*, double** %5
%10 = load double, double* %9
store double %10, double* %7
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
store i32 %12, i32* %8
%13 = load i32, i32* %4
%14 = load double, double* %7
%15 = load i32, i32* %8
%16 = call i32 @mpfr_set_d(i32 %13, double %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @mpfrsetd(i32 %0, double* nocapture %1, i32* nocapture %2) {
%4 = load double, double* %1
%5 = load i32, i32* %2
%6 = tail call i32 @mpfr_set_d(i32 %0, double %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void fputchar(int c) { putchar(c); }


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

x86 assembly (clang, -O2):
<fputchar>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @fputchar(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __SMLSDX(uint32_t x, uint32_t y,
                                           uint32_t sum) {
  return ((uint32_t)(((((int32_t)x << 16) >> 16) * (((int32_t)y) >> 16)) -
                     ((((int32_t)x) >> 16) * (((int32_t)y << 16) >> 16)) +
                     (((int32_t)sum))));
}


x86 assembly (clang, -O0):
<__SMLSDX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x10,%eax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
sar    $0x10,%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%rcx
sar    $0x10,%ecx
mov    -0x10(%rbp),%rdx
shl    $0x10,%edx
sar    $0x10,%edx
imul   %edx,%ecx
sub    %ecx,%eax
mov    -0x18(%rbp),%rcx
add    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<__SMLSDX>:
movswl %di,%eax
movswl %si,%ecx
sar    $0x10,%esi
imul   %eax,%esi
sar    $0x10,%edi
imul   %edi,%ecx
add    %esi,%edx
sub    %ecx,%edx
movslq %edx,%rax
ret

LLVM IR (-O0):
define i64 @__SMLSDX(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 16
%10 = ashr i32 %9, 16
%11 = load i64, i64* %5
%12 = trunc i64 %11 to i32
%13 = ashr i32 %12, 16
%14 = mul nsw i32 %10, %13
%15 = load i64, i64* %4
%16 = trunc i64 %15 to i32
%17 = ashr i32 %16, 16
%18 = load i64, i64* %5
%19 = trunc i64 %18 to i32
%20 = shl i32 %19, 16
%21 = ashr i32 %20, 16
%22 = mul nsw i32 %17, %21
%23 = sub nsw i32 %14, %22
%24 = load i64, i64* %6
%25 = trunc i64 %24 to i32
%26 = add nsw i32 %23, %25
%27 = sext i32 %26 to i64
ret i64 %27
}

LLVM IR (-O2):
define i64 @__SMLSDX(i64 %0, i64 %1, i64 %2) {
%4 = trunc i64 %0 to i32
%5 = shl i32 %4, 16
%6 = ashr exact i32 %5, 16
%7 = trunc i64 %1 to i32
%8 = ashr i32 %7, 16
%9 = mul nsw i32 %6, %8
%10 = ashr i32 %4, 16
%11 = shl i32 %7, 16
%12 = ashr exact i32 %11, 16
%13 = mul nsw i32 %12, %10
%14 = trunc i64 %2 to i32
%15 = add i32 %9, %14
%16 = sub i32 %15, %13
%17 = sext i32 %16 to i64
ret i64 %17
}
void spamm_omp_init() {}


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

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

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

LLVM IR (-O2):
define void @spamm_omp_init() {
ret void
}
main(a) {
  a = "main(a){a=%c%s%c;printf(a,34,a,34);}";
  printf(a, 34, a, 34);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rax
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    $0x22,%ecx
mov    %ecx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [37 x i8] c"main(a){a=%c%s%c;printf(a,34,a,34);}\00"
define i32 @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store i32 ptrtoint ([37 x i8]* @.str to i32), i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* %5, i32 34, i32 %6, i32 34)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"main(a){a=%c%s%c;printf(a,34,a,34);}\00"
define i32 @main(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) inttoptr (i64 sext (i32 ptrtoint ([37 x i8]* @.str to i32) to i64) to i8*), i32 34, i32 ptrtoint ([37 x i8]* @.str to i32), i32 34)
ret i32 0
}
void rop3_58_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D ^ S;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


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

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

LLVM IR (-O2):
define void @rop3_58_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Variables and functions */
char *date_get_now_time_hhmm_colon_ss(int);
char *date_get_now_hhmm_colon_ss(int utc_offset) {
  return date_get_now_time_hhmm_colon_ss(utc_offset);
}


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

x86 assembly (clang, -O2):
<date_get_now_hhmm_colon_ss>:
jmp    1030 <date_get_now_time_hhmm_colon_ss@plt>

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

LLVM IR (-O2):
define i8* @date_get_now_hhmm_colon_ss(i32 %0) {
%2 = tail call i8* @date_get_now_time_hhmm_colon_ss(i32 %0)
ret i8* %2
}
void soru_8() {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @soru_8() {
br label %1
1: ; preds = %0, %1
br label %1
}
void divend(void *(*DIV_import)(char *name),
            void (*DIV_export)(char *name, void *obj)) {}


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

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

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

LLVM IR (-O2):
define void @divend(i8* (i8*)* nocapture %0, void (i8*, i8*)* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void handler(int sig) { printf("recv a sig = %d\n", sig); }


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

x86 assembly (clang, -O2):
<handler>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"recv a sig = %d\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"recv a sig = %d\0A\00"
define void @handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void MergeUVRow_C() {}


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

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

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

LLVM IR (-O2):
define void @MergeUVRow_C() {
ret void
}
int vinicius(int x) { return x = 1; }


x86 assembly (clang, -O0):
<vinicius>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @vinicius(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ remove_duplicates(char *);
scalar_t__ strcmp(char *, char *);
int test_empty_input() {
  char input[] = "";
  remove_duplicates(input);
  return strcmp(input, "") == 0;
}


x86 assembly (clang, -O0):
<test_empty_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x1(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <memset@plt>
lea    -0x1(%rbp),%rdi
call   1050 <remove_duplicates@plt>
lea    -0x1(%rbp),%rdi
lea    0xea4(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_empty_input>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <remove_duplicates@plt>
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_empty_input() {
%1 = alloca [1 x i8]
%2 = bitcast [1 x i8]* %1 to i8*
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%4 = call i32 @remove_duplicates(i8* %3)
%5 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%6 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @test_empty_input() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = call i32 @remove_duplicates(i8* %2)
%4 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void RTLockValidatorRecExclSetOwner(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorRecExclSetOwner() {
ret void
}
/* Variables and functions */
int mt_cpu_dormant(unsigned long);
int mt_cpu_dormant_interruptible(unsigned long data) {
  return mt_cpu_dormant(data | (1 << 0));
}


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

x86 assembly (clang, -O2):
<mt_cpu_dormant_interruptible>:
or     $0x1,%rdi
jmp    1030 <mt_cpu_dormant@plt>

LLVM IR (-O0):
define i32 @mt_cpu_dormant_interruptible(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = or i64 %3, 1
%5 = call i32 @mt_cpu_dormant(i64 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @mt_cpu_dormant_interruptible(i64 %0) {
%2 = or i64 %0, 1
%3 = tail call i32 @mt_cpu_dormant(i64 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ WRITETEST(char *);
void SaveCursor() { WRITETEST("\0337"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"\1B7\00"
define void @SaveCursor() {
%1 = call i32 @WRITETEST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\1B7\00"
define void @SaveCursor() {
%1 = tail call i32 @WRITETEST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ perror(char *);
int send(int, char *, int, int /*<<< orphan*/);
void *user_worker_thread(void *fd) {
  int sockfd = *(int *)fd;
  if (send(sockfd, "Hello, world!", 13, 0) == -1) {
    perror("send");
  }
  close(sockfd);
  return 0;
}


x86 assembly (clang, -O0):
<user_worker_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    0xeb1(%rip),%rsi
mov    $0xd,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    $0xffffffff,%eax
jne    1170 <user_worker_thread+0x40>
lea    0xea3(%rip),%rdi
call   1050 <perror@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_worker_thread>:
push   %rbx
mov    (%rdi),%ebx
lea    0xec6(%rip),%rsi
mov    %ebx,%edi
mov    $0xd,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    $0xffffffff,%eax
je     1158 <user_worker_thread+0x28>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xeaf(%rip),%rdi
call   1050 <perror@plt>
jmp    114d <user_worker_thread+0x1d>

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
@.str.1 = [5 x i8] c"send\00"
define i8* @user_worker_thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @send(i32 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13, i32 0)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i32, i32* %3
%14 = call i32 @close(i32 %13)
ret i8* null
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
@.str.1 = [5 x i8] c"send\00"
define noalias i8* @user_worker_thread(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @send(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = tail call i32 @close(i32 %3)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ isalnum(int);
scalar_t__ isprint(int);
int /*<<< orphan*/ isspace(int);
int __ispunct_ascii(int ch) {
  return isprint(ch) && !isalnum(ch) && !isspace(ch);
}


x86 assembly (clang, -O0):
<__ispunct_ascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <isprint@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1180 <__ispunct_ascii+0x50>
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1180 <__ispunct_ascii+0x50>
mov    -0x4(%rbp),%edi
call   1040 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ispunct_ascii>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1050 <isprint@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     115a <__ispunct_ascii+0x2a>
mov    %ebp,%edi
call   1030 <isalnum@plt>
test   %eax,%eax
jne    115a <__ispunct_ascii+0x2a>
mov    %ebp,%edi
call   1040 <isspace@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__ispunct_ascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isprint(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @isalnum(i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 @isspace(i32 %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %10, %6, %1
%16 = phi i1 [ false, %6 ], [ false, %1 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @__ispunct_ascii(i32 %0) {
%2 = tail call i64 @isprint(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i32 @isalnum(i32 %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i32 @isspace(i32 %0)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %10, %7 ]
ret i32 %12
}