xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int i = 1, j = 7;
  while (i <= 9) {
    printf("I=%d J=7\nI=%d J=6\nI=%d J=5\n", i, i, i);
    i += 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
cmpl   $0x9,-0x8(%rbp)
jg     115a <main+0x4a>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
mov    $0x3,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x5,%edx
mov    $0x5,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x7,%edx
mov    $0x7,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0x9,%edx
mov    $0x9,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [28 x i8] c"I=%d J=7\0AI=%d J=6\0AI=%d J=5\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 3, i32 3, i32 3)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 5, i32 5, i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 7, i32 7, i32 7)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 9, i32 9, i32 9)
ret i32 0
}
/* Variables and functions */
size_t zCompBufSize(size_t uncompressedSize) {
  return 1.001 * uncompressedSize + 13;
}


x86 assembly (clang, -O0):
<zCompBufSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movaps 0xef1(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xef0(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xee9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee5(%rip),%xmm1
addsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
movsd  0xed2(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
and    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zCompBufSize>:
movq   %rdi,%xmm0
punpckldq 0xef3(%rip),%xmm0
subpd  0xefb(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
mulsd  0xef7(%rip),%xmm1
addsd  0xef7(%rip),%xmm1
cvttsd2si %xmm1,%rcx
mov    %rcx,%rdx
sar    $0x3f,%rdx
subsd  0xeeb(%rip),%xmm1
cvttsd2si %xmm1,%rax
and    %rdx,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @zCompBufSize(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = uitofp i64 %3 to double
%5 = call double @llvm.fmuladd.f64(double 1.001000e+00, double %4, double 1.300000e+01)
%6 = fptoui double %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @zCompBufSize(i64 %0) {
%2 = uitofp i64 %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 1.001000e+00, double 1.300000e+01)
%4 = fptoui double %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ echo_test(int, int, int /*<<< orphan*/);
void echo_test_10K_0(void) { echo_test(0x31, 0x1c, 0); }


x86 assembly (clang, -O0):
<echo_test_10K_0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x31,%edi
mov    $0x1c,%esi
xor    %edx,%edx
call   1030 <echo_test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<echo_test_10K_0>:
mov    $0x31,%edi
mov    $0x1c,%esi
xor    %edx,%edx
jmp    1030 <echo_test@plt>

LLVM IR (-O0):
define void @echo_test_10K_0() {
%1 = call i32 @echo_test(i32 49, i32 28, i32 0)
ret void
}

LLVM IR (-O2):
define void @echo_test_10K_0() {
%1 = tail call i32 @echo_test(i32 49, i32 28, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_board(char **);
int /*<<< orphan*/ set(char **, int, int, char);
int main(void) {
  char tictac[3][3] = {{' ', ' ', ' '}, {' ', ' ', ' '}, {' ', ' ', ' '}};
  print_board(tictac);
  set(tictac, 1, 1, 'X');
  print_board(tictac);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x9(%rbp)
mov    0xecf(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x9(%rbp),%rdi
call   1030 <print_board@plt>
lea    -0x9(%rbp),%rdi
mov    $0x1,%edx
mov    $0x58,%ecx
mov    %edx,%esi
call   1040 <set@plt>
lea    -0x9(%rbp),%rdi
call   1030 <print_board@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x2020202020202020,%rax
20 20 20
mov    %rax,(%rsp)
movb   $0x20,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <print_board@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x58,%ecx
call   1040 <set@plt>
mov    %rbx,%rdi
call   1030 <print_board@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.tictac = [3 x [3 x i8]] [[3 x i8] c" ", [3 x i8] c" ", [3 x i8] c" "]
define i32 @main() {
%1 = alloca [3 x [3 x i8]]
%2 = bitcast [3 x [3 x i8]]* %1 to i8*
%3 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %1, i64 0, i64 0
%4 = bitcast [3 x i8]* %3 to i8**
%5 = call i32 @print_board(i8** %4)
%6 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %1, i64 0, i64 0
%7 = bitcast [3 x i8]* %6 to i8**
%8 = call i32 @set(i8** %7, i32 1, i32 1, i8 signext 88)
%9 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %1, i64 0, i64 0
%10 = bitcast [3 x i8]* %9 to i8**
%11 = call i32 @print_board(i8** %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [3 x [3 x i8]]
%2 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %1, i64 0, i64 0, i64 0
%3 = bitcast [3 x [3 x i8]]* %1 to i8**
%4 = call i32 @print_board(i8** %3)
%5 = call i32 @set(i8** %3, i32 1, i32 1, i8 signext 88)
%6 = call i32 @print_board(i8** %3)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
void blPadchar(char *string, int length, char ch) {
  int i;
  for (i = strlen(string); i < length; i++)
    string[i] = ch;
  string[length] = '\0';
}


x86 assembly (clang, -O0):
<blPadchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <blPadchar+0x48>
mov    -0xd(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1130 <blPadchar+0x20>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blPadchar>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    %ebp,%eax
jge    114f <blPadchar+0x2f>
movslq %eax,%rdi
add    %rbx,%rdi
not    %eax
add    %ebp,%eax
add    $0x1,%rax
movzbl %r14b,%esi
mov    %rax,%rdx
call   1040 <memset@plt>
movslq %ebp,%rax
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @blPadchar(i8* %0, i32 %1, i8 signext %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp slt i32 %4, %1
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = sext i32 %4 to i64
%8 = getelementptr i8, i8* %0, i64 %7
%9 = xor i32 %4, -1
%10 = add i32 %9, %1
%11 = zext i32 %10 to i64
%12 = add nuw nsw i64 %11, 1
br label %13
13: ; preds = %6, %3
%14 = sext i32 %1 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
ret void
}
void adis16209_uninitialize_ring(struct iio_ring_buffer *ring) {}


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

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

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

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define void @adis16209_uninitialize_ring(%struct.iio_ring_buffer* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int f();
int main() {
  if (f() != 8192)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <f@plt>
cmp    $0x2000,%eax
je     1158 <main+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f@plt>
cmp    $0x2000,%eax
jne    1146 <main+0x16>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = icmp eq i32 %1, 8192
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
double div_1(double a, double b) { return a / b; }


x86 assembly (clang, -O0):
<div_1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_1>:
divsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @div_1(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_putstr(char *str) {
  int i;
  i = 0;
  while (str[i]) {
    write(1, &str[i], 1);
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115a <ft_putstr+0x4a>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ft_putstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
cmpb   $0x0,(%rdi)
je     113c <ft_putstr+0x2c>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = tail call i32 @write(i32 1, i8* %6, i32 1)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int SIGINT;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void trap(int sig) {
  if (sig == SIGINT) {
    endwin();
    exit(0);
  }
}


x86 assembly (clang, -O0):
<trap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%eax
jne    114b <trap+0x2b>
mov    $0x0,%al
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trap>:
push   %rax
mov    0x2ec0(%rip),%rax
cmp    %edi,(%rax)
je     112e <trap+0xe>
pop    %rax
ret
xor    %eax,%eax
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
define void @trap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 (...) @endwin()
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
define void @trap(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 (...) @endwin()
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %1
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void USBEndpointDataToggleClear(uint32_t ui32Base, uint32_t ui32Endpoint,
                                uint32_t ui32Flags) {
  ;

  ;
  if (ui32Flags & (0x00002000 | 0x00002000)) {
    (*((volatile uint8_t *)(ui32Base + 0x00000112 + (ui32Endpoint - 0x10)))) |=
        0x00000040;
  } else {
    (*((volatile uint8_t *)(ui32Base + 0x00000116 + (ui32Endpoint - 0x10)))) |=
        0x00000080;
  }
}


x86 assembly (clang, -O0):
<USBEndpointDataToggleClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x2000,%eax
cmp    $0x0,%eax
je     113c <USBEndpointDataToggleClear+0x3c>
mov    -0x4(%rbp),%eax
add    $0x112,%eax
mov    -0x8(%rbp),%ecx
sub    $0x10,%ecx
add    %ecx,%eax
cltq
mov    (%rax),%ecx
or     $0x40,%ecx
mov    %ecx,(%rax)
jmp    1158 <USBEndpointDataToggleClear+0x58>
mov    -0x4(%rbp),%eax
add    $0x116,%eax
mov    -0x8(%rbp),%ecx
sub    $0x10,%ecx
add    %ecx,%eax
cltq
mov    (%rax),%ecx
or     $0x80,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBEndpointDataToggleClear>:
xor    %eax,%eax
test   $0x2000,%edx
sete   %al
add    %esi,%edi
lea    (%rdi,%rax,4),%ecx
add    $0x102,%ecx
shl    $0x6,%eax
add    $0x40,%eax
movslq %ecx,%rcx
or     %eax,(%rcx)
ret

LLVM IR (-O0):
define void @USBEndpointDataToggleClear(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = and i32 %7, 8192
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %3
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 274
%13 = load i32, i32* %5
%14 = sub nsw i32 %13, 16
%15 = add nsw i32 %12, %14
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = load volatile i32, i32* %17
%19 = or i32 %18, 64
store volatile i32 %19, i32* %17
br label %30
20: ; preds = %3
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 278
%23 = load i32, i32* %5
%24 = sub nsw i32 %23, 16
%25 = add nsw i32 %22, %24
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i32*
%28 = load volatile i32, i32* %27
%29 = or i32 %28, 128
store volatile i32 %29, i32* %27
br label %30
30: ; preds = %20, %10
ret void
}

LLVM IR (-O2):
define void @USBEndpointDataToggleClear(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %2, 8192
%5 = icmp eq i32 %4, 0
%6 = add i32 %1, %0
%7 = select i1 %5, i32 262, i32 258
%8 = select i1 %5, i32 128, i32 64
%9 = add i32 %6, %7
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = or i32 %12, %8
store volatile i32 %13, i32* %11
ret void
}
int test_imm_D0uint8_reg(unsigned char val) {
  return ((val) & (-0xD0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D0uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff30,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_D0uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -208
%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_D0uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 48
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void proc(int *x, int *y) { *x = *y + 3; }


x86 assembly (clang, -O0):
<proc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x3,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc>:
mov    (%rsi),%eax
add    $0x3,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @proc(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 = load i32, i32* %5
%7 = add nsw i32 %6, 3
%8 = load i32*, i32** %3
store i32 %7, i32* %8
ret void
}

LLVM IR (-O2):
define void @proc(i32* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 3
store i32 %4, i32* %0
ret void
}
void yy_3_ValidXmlAttribute(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_3_ValidXmlAttribute(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BitMap(int *, int, int);
int main(int argc, const char *argv[]) {
  int nums[] = {9, 1, 4, 3, 2, 6, 7, 10, 8, 15, 13, 11, 19, 14, 20, 12, 17, 18};
  BitMap(nums, 18, 21);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xebf(%rip),%rsi
mov    $0x48,%edx
call   1030 <memcpy@plt>
lea    -0x60(%rbp),%rdi
mov    $0x12,%esi
mov    $0x15,%edx
call   1040 <BitMap@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
mov    0xf25(%rip),%rax
mov    %rax,0x40(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x12,%esi
mov    $0x15,%edx
call   1030 <BitMap@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.nums = [18 x i32] [i32 9, i32 1, i32 4, i32 3, i32 2, i32 6, i32 7, i32 10, i32 8, i32 15, i32 13, i32 11, i32 19, i32 14, i32 20, i32 12, i32 17, i32 18]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [18 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [18 x i32]* %6 to i8*
%8 = getelementptr inbounds [18 x i32], [18 x i32]* %6, i64 0, i64 0
%9 = call i32 @BitMap(i32* %8, i32 18, i32 21)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [18 x i32] [i32 9, i32 1, i32 4, i32 3, i32 2, i32 6, i32 7, i32 10, i32 8, i32 15, i32 13, i32 11, i32 19, i32 14, i32 20, i32 12, i32 17, i32 18]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [18 x i32]
%4 = bitcast [18 x i32]* %3 to i8*
%5 = getelementptr inbounds [18 x i32], [18 x i32]* %3, i64 0, i64 0
%6 = call i32 @BitMap(i32* %5, i32 18, i32 21)
ret i32 0
}
int nmcces(v)
struct vars *v;
{
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.vars = type opaque
define i32 @nmcces(%struct.vars* nocapture readnone %0) {
ret i32 0
}
__attribute__((visibility("default"))) const char *utf8proc_version(void) {
  return "2"
         "."
         "6"
         "."
         "1"
         "";
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"2.6.1\00"
define i8* @utf8proc_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"2.6.1\00"
define i8* @utf8proc_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
void tegra_smmu_remove(struct tegra_smmu *smmu) {}


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

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

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

LLVM IR (-O2):
%struct.tegra_smmu = type opaque
define void @tegra_smmu_remove(%struct.tegra_smmu* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  if (argc > 1)
    func(argv[1]);
  else
    printf("%s argument\n", argv[0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1152 <main+0x32>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <func@plt>
jmp    1165 <main+0x45>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     1131 <main+0x11>
mov    0x8(%rsi),%rdi
call   1040 <func@plt>
jmp    1140 <main+0x20>
mov    (%rsi),%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"%s argument\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @func(i8* %6)
br label %11
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %4
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
struct rusage {
  TYPE_1__ ru_stime;
};

/* Variables and functions */
long getElapsedSystemTime(struct rusage *ru) {
  return (1000000L * (long)ru->ru_stime.tv_sec + (long)ru->ru_stime.tv_usec);
}


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

x86 assembly (clang, -O2):
<getElapsedSystemTime>:
imul   $0xf4240,0x8(%rdi),%rax
add    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64, i64 }
define i64 @getElapsedSystemTime(%struct.rusage* %0) {
%2 = alloca %struct.rusage*
store %struct.rusage* %0, %struct.rusage** %2
%3 = load %struct.rusage*, %struct.rusage** %2
%4 = getelementptr inbounds %struct.rusage, %struct.rusage* %3, i32 0, i32 0
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 1
%6 = load i64, i64* %5
%7 = mul nsw i64 1000000, %6
%8 = load %struct.rusage*, %struct.rusage** %2
%9 = getelementptr inbounds %struct.rusage, %struct.rusage* %8, i32 0, i32 0
%10 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %9, i32 0, i32 0
%11 = load i64, i64* %10
%12 = add nsw i64 %7, %11
ret i64 %12
}

LLVM IR (-O2):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64, i64 }
define i64 @getElapsedSystemTime(%struct.rusage* nocapture %0) {
%2 = getelementptr inbounds %struct.rusage, %struct.rusage* %0, i64 0, i32 0, i32 1
%3 = load i64, i64* %2
%4 = mul nsw i64 %3, 1000000
%5 = getelementptr inbounds %struct.rusage, %struct.rusage* %0, i64 0, i32 0, i32 0
%6 = load i64, i64* %5
%7 = add nsw i64 %4, %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void m4_mode4_exit() { endwin(); }


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

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

LLVM IR (-O0):
define void @m4_mode4_exit() {
%1 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @m4_mode4_exit() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ hello();
int main(void) {
  hello();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <hello@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <hello@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @hello()
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @hello()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ write(int, char *, int);
void _Unwind_GetRegionStart() {
  char msg[] = "Aborting: "
               "_Unwind_GetRegionStart"
               " called "
               "(C++ exception handling is disabled)\n";
  write(2, msg, sizeof(msg) - 1);
  abort();
}


x86 assembly (clang, -O0):
<_Unwind_GetRegionStart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x4e,%edx
call   1050 <memcpy@plt>
lea    -0x50(%rbp),%rsi
mov    $0x2,%edi
mov    $0x4d,%edx
call   1040 <write@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_Unwind_GetRegionStart>:
sub    $0x58,%rsp
movups 0xf13(%rip),%xmm0
movups %xmm0,0x3e(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x2,%edi
mov    $0x4d,%edx
call   1040 <write@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@__const._Unwind_GetRegionStart.msg = [78 x i8] c"Aborting: _Unwind_GetRegionStart called (C++ exception handling is disabled)\0A\00"
define void @_Unwind_GetRegionStart() {
%1 = alloca [78 x i8]
%2 = bitcast [78 x i8]* %1 to i8*
%3 = getelementptr inbounds [78 x i8], [78 x i8]* %1, i64 0, i64 0
%4 = call i32 @write(i32 2, i8* %3, i32 77)
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@__const._Unwind_GetRegionStart.msg = [78 x i8] c"Aborting: _Unwind_GetRegionStart called (C++ exception handling is disabled)\0A\00"
define void @_Unwind_GetRegionStart() {
%1 = alloca [78 x i8]
%2 = getelementptr inbounds [78 x i8], [78 x i8]* %1, i64 0, i64 0
%3 = call i32 @write(i32 2, i8* %2, i32 77)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ test_truncate_nl();
int main(int argc, char *argv[]) {
  test_truncate_nl();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_truncate_nl@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_truncate_nl@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_truncate_nl()
ret i32 0
}
int security_socket_accept(struct socket *sock, struct socket *newsock) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.socket = type opaque
define i32 @security_socket_accept(%struct.socket* %0, %struct.socket* %1) {
%3 = alloca %struct.socket*
%4 = alloca %struct.socket*
store %struct.socket* %0, %struct.socket** %3
store %struct.socket* %1, %struct.socket** %4
ret i32 0
}

LLVM IR (-O2):
%struct.socket = type opaque
define i32 @security_socket_accept(%struct.socket* nocapture readnone %0, %struct.socket* nocapture readnone %1) {
ret i32 0
}
main() {
  typedef int int_t;
  { int int_t = 5; }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int func3(int);
int func2(int x) {
  int ret = 0;
  ret = func3(x + 2);
  return ret;
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x2,%edi
call   1030 <func3@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
add    $0x2,%edi
jmp    1030 <func3@plt>

LLVM IR (-O0):
define i32 @func2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 2
%6 = call i32 @func3(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @func2(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = tail call i32 @func3(i32 %2)
ret i32 %3
}
/* Variables and functions */
int test00(int, int);
int test01(int, int);
int main(int argc, char **argv) {
  return test00(argc, 123) + test01(argc, 123);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x7b,%esi
call   1040 <test00@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x7b,%esi
call   1030 <test01@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x7b,%esi
call   1040 <test00@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x7b,%esi
call   1030 <test01@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = call i32 @test00(i32 %6, i32 123)
%8 = load i32, i32* %4
%9 = call i32 @test01(i32 %8, i32 123)
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test00(i32 %0, i32 123)
%4 = tail call i32 @test01(i32 %0, i32 123)
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int psi_to_bar(double);
long rint(int);
long psi_to_mbar(double psi) { return rint(psi_to_bar(psi) * 1000); }


x86 assembly (clang, -O0):
<psi_to_mbar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <psi_to_bar@plt>
imul   $0x3e8,%eax,%edi
call   1030 <rint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psi_to_mbar>:
push   %rax
call   1040 <psi_to_bar@plt>
imul   $0x3e8,%eax,%edi
pop    %rax
jmp    1030 <rint@plt>

LLVM IR (-O0):
define i64 @psi_to_mbar(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @psi_to_bar(double %3)
%5 = mul nsw i32 %4, 1000
%6 = call i64 @rint(i32 %5)
ret i64 %6
}

LLVM IR (-O2):
define i64 @psi_to_mbar(double %0) {
%2 = tail call i32 @psi_to_bar(double %0)
%3 = mul nsw i32 %2, 1000
%4 = tail call i64 @rint(i32 %3)
ret i64 %4
}
/* Type definitions */
struct rlimit {
  scalar_t__ rlim_cur;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_NOFILE;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long long);
int /*<<< orphan*/ getrlimit(int /*<<< orphan*/, struct rlimit *);
int /*<<< orphan*/ stderr;
int main(void) {
  struct rlimit rlp;
  getrlimit(RLIMIT_NOFILE, &rlp);
  fprintf(stderr, "RLIMIT_NOFILE is %lld\n", (long long)rlp.rlim_cur);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1040 <getrlimit@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1040 <getrlimit@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
mov    (%rsp),%rdx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rlimit = type { i64 }
@RLIMIT_NOFILE = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"RLIMIT_NOFILE is %lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.rlimit
store i32 0, i32* %1
%3 = load i32, i32* @RLIMIT_NOFILE
%4 = call i32 @getrlimit(i32 %3, %struct.rlimit* %2)
%5 = load i32, i32* @stderr
%6 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %2, i32 0, i32 0
%7 = load i64, i64* %6
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %7)
ret i32 0
}

LLVM IR (-O2):
%struct.rlimit = type { i64 }
@RLIMIT_NOFILE = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"RLIMIT_NOFILE is %lld\0A\00"
define i32 @main() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = load i32, i32* @RLIMIT_NOFILE
%4 = call i32 @getrlimit(i32 %3, %struct.rlimit* %1)
%5 = load i32, i32* @stderr
%6 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %7)
ret i32 0
}
/* Variables and functions */
scalar_t__ Kill(int, int /*<<< orphan*/, char *, int /*<<< orphan*/);
int getppid();
int mother_is_dead(int mompid, char *s) {
  if (Kill(mompid, 0, s, 0))
    return ((1));
  else if (getppid() == 1)
    return ((1));
  else
    return ((0));
}


x86 assembly (clang, -O0):
<mother_is_dead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rdx
xor    %ecx,%ecx
mov    %ecx,%esi
call   1030 <Kill@plt>
cmp    $0x0,%rax
je     1155 <mother_is_dead+0x35>
movl   $0x1,-0x4(%rbp)
jmp    1178 <mother_is_dead+0x58>
mov    $0x0,%al
call   1040 <getppid@plt>
cmp    $0x1,%eax
jne    1171 <mother_is_dead+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1178 <mother_is_dead+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mother_is_dead>:
push   %rax
mov    %rsi,%rdx
xor    %esi,%esi
xor    %ecx,%ecx
call   1030 <Kill@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     113c <mother_is_dead+0x1c>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <getppid@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @mother_is_dead(i32 %0, i8* %1) {
%3 = tail call i64 @Kill(i32 %0, i32 0, i8* %1, i32 0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 (...) @getppid()
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
int test_171_16(int *mem) {
  int newval = 5;
  int prevval;
  __atomic_exchange(mem + 4, &newval, &prevval, 4);
  return prevval;
}


x86 assembly (clang, -O0):
<test_171_16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
xchg   %eax,0x10(%rcx)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_171_16>:
mov    $0x5,%eax
xchg   %eax,0x10(%rdi)
ret

LLVM IR (-O0):
define i32 @test_171_16(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 5, i32* %3
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 4
%7 = load i32, i32* %3
%8 = atomicrmw xchg i32* %6, i32 %7 acq_rel
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_171_16(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = atomicrmw xchg i32* %2, i32 5 acq_rel
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ bubble_sort(int *, int);
int /*<<< orphan*/ generate_array(int *, int);
int /*<<< orphan*/ start();
int /*<<< orphan*/ stop();
int main() {
  start();
  int array[30000];
  generate_array(array, 30000);
  bubble_sort(array, 30000);
  stop();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1d4d0,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <start@plt>
lea    -0x1d4d0(%rbp),%rdi
mov    $0x7530,%esi
call   1050 <generate_array@plt>
lea    -0x1d4d0(%rbp),%rdi
mov    $0x7530,%esi
call   1060 <bubble_sort@plt>
mov    $0x0,%al
call   1030 <stop@plt>
xor    %eax,%eax
add    $0x1d4d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x1d4c0,%rsp
xor    %eax,%eax
call   1040 <start@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7530,%esi
call   1050 <generate_array@plt>
mov    %rbx,%rdi
mov    $0x7530,%esi
call   1060 <bubble_sort@plt>
xor    %eax,%eax
call   1030 <stop@plt>
xor    %eax,%eax
add    $0x1d4c0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [30000 x i32]
store i32 0, i32* %1
%3 = call i32 (...) @start()
%4 = getelementptr inbounds [30000 x i32], [30000 x i32]* %2, i64 0, i64 0
%5 = call i32 @generate_array(i32* %4, i32 30000)
%6 = getelementptr inbounds [30000 x i32], [30000 x i32]* %2, i64 0, i64 0
%7 = call i32 @bubble_sort(i32* %6, i32 30000)
%8 = call i32 (...) @stop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [30000 x i32]
%2 = tail call i32 (...) @start()
%3 = bitcast [30000 x i32]* %1 to i8*
%4 = getelementptr inbounds [30000 x i32], [30000 x i32]* %1, i64 0, i64 0
%5 = call i32 @generate_array(i32* %4, i32 30000)
%6 = call i32 @bubble_sort(i32* %4, i32 30000)
%7 = call i32 (...) @stop()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led0On();
void TestSerialC__Leds__led0On(void) { LedsP__Leds__led0On(); }


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

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

LLVM IR (-O0):
define void @TestSerialC__Leds__led0On() {
%1 = call i32 (...) @LedsP__Leds__led0On()
ret void
}

LLVM IR (-O2):
define void @TestSerialC__Leds__led0On() {
%1 = tail call i32 (...) @LedsP__Leds__led0On()
ret void
}
int DOBLOCK(cond) {}


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

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

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

LLVM IR (-O2):
define i32 @DOBLOCK(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ k_error(int /*<<< orphan*/);
int /*<<< orphan*/ sysmsg(int);
void k_inva_task_lock_error() { k_error(sysmsg(1116)); }


x86 assembly (clang, -O0):
<k_inva_task_lock_error>:
push   %rbp
mov    %rsp,%rbp
mov    $0x45c,%edi
call   1030 <sysmsg@plt>
mov    %eax,%edi
call   1040 <k_error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_inva_task_lock_error>:
push   %rax
mov    $0x45c,%edi
call   1030 <sysmsg@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <k_error@plt>

LLVM IR (-O0):
define void @k_inva_task_lock_error() {
%1 = call i32 @sysmsg(i32 1116)
%2 = call i32 @k_error(i32 %1)
ret void
}

LLVM IR (-O2):
define void @k_inva_task_lock_error() {
%1 = tail call i32 @sysmsg(i32 1116)
%2 = tail call i32 @k_error(i32 %1)
ret void
}
void RTFsQuerySizes(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFsQuerySizes() {
ret void
}
/* Variables and functions */
unsigned int next_utf8(char const *, int *);
int fn_cl_48_57(const char *text) {
  int pos = 0;
  unsigned int c = next_utf8(text, &pos);
  if (c >= 48 && c <= 57)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_cl_48_57>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <next_utf8@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x30,-0x18(%rbp)
jb     1152 <fn_cl_48_57+0x42>
cmpl   $0x39,-0x18(%rbp)
ja     1152 <fn_cl_48_57+0x42>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <fn_cl_48_57+0x49>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_cl_48_57>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <next_utf8@plt>
mov    %eax,%ecx
add    $0xffffffd0,%ecx
mov    $0xffffffff,%eax
cmp    $0xa,%ecx
jae    1136 <fn_cl_48_57+0x26>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fn_cl_48_57(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @next_utf8(i8* %0, i32* %2)
%5 = add i32 %4, -48
%6 = icmp ult i32 %5, 10
%7 = load i32, i32* %2
%8 = select i1 %6, i32 %7, i32 -1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void growl_tcp_close(int sock) {
  if (sock != -1) {
    close(sock);
  }
}


x86 assembly (clang, -O0):
<growl_tcp_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     112d <growl_tcp_close+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<growl_tcp_close>:
cmp    $0xffffffff,%edi
je     111a <growl_tcp_close+0xa>
jmp    1030 <close@plt>
ret

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

LLVM IR (-O2):
define void @growl_tcp_close(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}