xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime_r(int /*<<< orphan*/ const *, struct tm *);
struct tm *localtime(const time_t *timep) {
  static struct tm tm;
  return localtime_r(timep, &tm);
}


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

x86 assembly (clang, -O2):
<localtime>:
lea    0x2f15(%rip),%rsi
jmp    1030 <localtime_r@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@localtime.tm = internal global %struct.tm zeroinitializer
define %struct.tm* @localtime(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call %struct.tm* @localtime_r(i32* %3, %struct.tm* @localtime.tm)
ret %struct.tm* %4
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@localtime.tm = internal global %struct.tm zeroinitializer
define %struct.tm* @localtime(i32* %0) {
%2 = tail call %struct.tm* @localtime_r(i32* %0, %struct.tm* @localtime.tm)
ret %struct.tm* %2
}
/* Type definitions */
struct flock {
  int l_type;
  int l_whence;
  void *l_len;
  void *l_start;
};
typedef void *off_t;

/* Variables and functions */
int fcntl(int, int, struct flock *);
int lock_reg(int fd, int cmd, int type, off_t offset, int whence, off_t len) {
  struct flock lock;
  lock.l_type = type;
  lock.l_start = offset;
  lock.l_whence = whence;
  lock.l_len = len;
  return fcntl(fd, cmd, &lock);
}


x86 assembly (clang, -O0):
<lock_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x40(%rbp),%rdx
call   1030 <fcntl@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock_reg>:
sub    $0x18,%rsp
mov    %edx,(%rsp)
mov    %rcx,0x10(%rsp)
mov    %r8d,0x4(%rsp)
mov    %r9,0x8(%rsp)
mov    %rsp,%rdx
call   1030 <fcntl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.flock = type { i32, i32, i8*, i8* }
define i32 @lock_reg(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca %struct.flock
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i8* %5, i8** %12
%14 = load i32, i32* %9
%15 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 0
store i32 %14, i32* %15
%16 = load i8*, i8** %10
%17 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 3
store i8* %16, i8** %17
%18 = load i32, i32* %11
%19 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 1
store i32 %18, i32* %19
%20 = load i8*, i8** %12
%21 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 2
store i8* %20, i8** %21
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = call i32 @fcntl(i32 %22, i32 %23, %struct.flock* %13)
ret i32 %24
}

LLVM IR (-O2):
%struct.flock = type { i32, i32, i8*, i8* }
define i32 @lock_reg(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4, i8* %5) {
%7 = alloca %struct.flock
%8 = bitcast %struct.flock* %7 to i8*
%9 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 0
store i32 %2, i32* %9
%10 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 3
store i8* %3, i8** %10
%11 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 1
store i32 %4, i32* %11
%12 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 2
store i8* %5, i8** %12
%13 = call i32 @fcntl(i32 %0, i32 %1, %struct.flock* %7)
ret i32 %13
}
void vec2_set(float *dst, float x, float y) {
  dst[0] = x;
  dst[1] = y;
}


x86 assembly (clang, -O0):
<vec2_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_set>:
movss  %xmm0,(%rdi)
movss  %xmm1,0x4(%rdi)
ret

LLVM IR (-O0):
define void @vec2_set(float* %0, float %1, float %2) {
%4 = alloca float*
%5 = alloca float
%6 = alloca float
store float* %0, float** %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load float, float* %6
%11 = load float*, float** %4
%12 = getelementptr inbounds float, float* %11, i64 1
store float %10, float* %12
ret void
}

LLVM IR (-O2):
define void @vec2_set(float* nocapture writeonly %0, float %1, float %2) {
store float %1, float* %0
%4 = getelementptr inbounds float, float* %0, i64 1
store float %2, float* %4
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main(void) {
  int i;
  int size = 65536;
  for (i = 0; i < 9999999999; i++) {
    char *q = malloc(size);
    printf("Malloced: %ld\n", size * i);
  }
  sleep(9999999);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x10000,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movabs $0x2540be3ff,%rcx
cmp    %rcx,%rax
jge    1191 <main+0x61>
mov    -0xc(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114d <main+0x1d>
mov    $0x98967f,%edi
call   1050 <sleep@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%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
call   1030 <printf@plt>
add    $0x10000,%ebx
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [15 x i8] c"Malloced: %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 0, i32* %1
store i32 65536, i32* %3
store i32 0, i32* %2
br label %5
5: ; preds = %16, %0
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = icmp slt i64 %7, 9999999999
br i1 %8, label %9, label %19
9: ; preds = %5
%10 = load i32, i32* %3
%11 = call i8* @malloc(i32 %10)
store i8* %11, i8** %4
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = mul nsw i32 %12, %13
%15 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %9
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %5
19: ; preds = %5
%20 = call i32 @sleep(i32 9999999)
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
@.str = [15 x i8] c"Malloced: %ld\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = shl nsw i32 %2, 16
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = add nuw nsw i32 %2, 1
br label %1
}
int main() {
  int arr[4] = {0, 1, 2, 3};
#pragma omp target data map(alloc : arr [0:2])
#pragma omp target data map(alloc : arr [1:2])
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.arr = [4 x i32] [i32 0, i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
store i32 0, i32* %1
%3 = bitcast [4 x i32]* %2 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int NextVertexList(Schema, A)
struct frvStruct *Schema;
struct Vertex **A;
{
  (*A) = AccessVertexVertexListNext(*A);
  if ((*A) == 0)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<NextVertexList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1030 <AccessVertexVertexListNext@plt>
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1152 <NextVertexList+0x42>
movl   $0x0,-0x4(%rbp)
jmp    1159 <NextVertexList+0x49>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NextVertexList>:
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%rdi
xor    %eax,%eax
call   1030 <AccessVertexVertexListNext@plt>
movslq %eax,%rcx
mov    %rcx,(%rbx)
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
%struct.frvStruct = type opaque
%struct.Vertex = type opaque
define i32 @NextVertexList(%struct.frvStruct* %0, %struct.Vertex** %1) {
%3 = alloca i32
%4 = alloca %struct.frvStruct*
%5 = alloca %struct.Vertex**
store %struct.frvStruct* %0, %struct.frvStruct** %4
store %struct.Vertex** %1, %struct.Vertex*** %5
%6 = load %struct.Vertex**, %struct.Vertex*** %5
%7 = load %struct.Vertex*, %struct.Vertex** %6
%8 = call i32 (%struct.Vertex*, ...) bitcast (i32 (...)* @AccessVertexVertexListNext to i32 (%struct.Vertex*, ...)*)(%struct.Vertex* %7)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to %struct.Vertex*
%11 = load %struct.Vertex**, %struct.Vertex*** %5
store %struct.Vertex* %10, %struct.Vertex** %11
%12 = load %struct.Vertex**, %struct.Vertex*** %5
%13 = load %struct.Vertex*, %struct.Vertex** %12
%14 = icmp eq %struct.Vertex* %13, null
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 0, i32* %3
br label %17
16: ; preds = %2
store i32 1, i32* %3
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.frvStruct = type opaque
%struct.Vertex = type opaque
define i32 @NextVertexList(%struct.frvStruct* nocapture readnone %0, %struct.Vertex** nocapture %1) {
%3 = load %struct.Vertex*, %struct.Vertex** %1
%4 = tail call i32 (%struct.Vertex*, ...) bitcast (i32 (...)* @AccessVertexVertexListNext to i32 (%struct.Vertex*, ...)*)(%struct.Vertex* %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to %struct.Vertex*
store %struct.Vertex* %6, %struct.Vertex** %1
%7 = icmp ne i32 %4, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
char *fgets_or_exit(char *buffer, int size, FILE *stream) {
  if (fgets(buffer, size, stream) != NULL) {
    return buffer;
  }
  exit(1);
}


x86 assembly (clang, -O0):
<fgets_or_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <fgets@plt>
cmp    $0x0,%rax
je     1157 <fgets_or_exit+0x37>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fgets_or_exit>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fgets@plt>
test   %rax,%rax
je     1133 <fgets_or_exit+0x13>
mov    %rbx,%rax
pop    %rbx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i8* @fgets_or_exit(i8* returned %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32* @fgets(i8* %0, i32 %1, i32* %2)
%5 = icmp eq i32* %4, null
br i1 %5, label %7, label %6
6: ; preds = %3
ret i8* %0
7: ; preds = %3
%8 = tail call i32 @exit(i32 1)
unreachable
}
int foo(int x) { return ((x << 8) & 65535) | 255; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
and    $0xffff,%eax
or     $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
shl    $0x8,%edi
or     $0xff,%edi
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = and i32 %4, 65535
%6 = or i32 %5, 255
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = shl i32 %0, 8
%3 = and i32 %2, 65280
%4 = or i32 %3, 255
ret i32 %4
}
int v1(int n) {
  if (n == 1)
    return 1;
  return n + v1(n - 1);
}


x86 assembly (clang, -O0):
<v1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1131 <v1+0x21>
movl   $0x1,-0x4(%rbp)
jmp    114c <v1+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <v1@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v1>:
mov    $0x1,%eax
cmp    $0x1,%edi
je     1124 <v1+0x24>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %ecx,%eax
lea    -0x3(%rdi),%edx
imul   %rcx,%rdx
shr    %rdx
add    %edi,%eax
sub    %edx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @v1(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = add i32 %0, -2
%6 = mul i32 %4, %5
%7 = zext i32 %5 to i33
%8 = add i32 %0, -3
%9 = zext i32 %8 to i33
%10 = mul i33 %7, %9
%11 = lshr i33 %10, 1
%12 = trunc i33 %11 to i32
%13 = add i32 %6, %0
%14 = sub i32 %13, %12
%15 = add i32 %14, 1
br label %16
16: ; preds = %3, %1
%17 = phi i32 [ 1, %1 ], [ %15, %3 ]
ret i32 %17
}
int track_bbox_width(int ch, int i) {}


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

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

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

LLVM IR (-O2):
define i32 @track_bbox_width(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ print_backtrace();
void foo() { print_backtrace(); }


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

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

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

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 (...) @print_backtrace()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fprintf(stderr, "Usage: unatomappend [-A] file pattern iterations\n");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: unatomappend [-A] file pattern iterations\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: unatomappend [-A] file pattern iterations\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
char *asctime(struct tm *);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  time_t t;
  struct tm *tm_ptr;
  char *str;
  t = time(NULL);
  tm_ptr = localtime(&t);
  str = asctime(tm_ptr);
  printf("%s", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <asctime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe80(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    %rax,%rdi
call   1040 <asctime@plt>
lea    0xe9b(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.tm*
%4 = alloca i8*
store i32 0, i32* %1
%5 = call i32 @time(i32* null)
store i32 %5, i32* %2
%6 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %6, %struct.tm** %3
%7 = load %struct.tm*, %struct.tm** %3
%8 = call i8* @asctime(%struct.tm* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
%5 = call i8* @asctime(%struct.tm* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void sar_reg32_imm8(unsigned long reg32, unsigned char imm8) {
  put8(0xC1);
  put8(0xF8 + reg32);
  put8(imm8);
}


x86 assembly (clang, -O0):
<sar_reg32_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0xc1,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
add    $0xf8,%rax
movzbl %al,%edi
call   1030 <put8@plt>
movzbl -0x9(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sar_reg32_imm8>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0xc1,%edi
call   1030 <put8@plt>
add    $0xf8,%bl
movzbl %bl,%edi
call   1030 <put8@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @sar_reg32_imm8(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = call i32 @put8(i8 zeroext -63)
%6 = load i64, i64* %3
%7 = add i64 248, %6
%8 = trunc i64 %7 to i8
%9 = call i32 @put8(i8 zeroext %8)
%10 = load i8, i8* %4
%11 = call i32 @put8(i8 zeroext %10)
ret void
}

LLVM IR (-O2):
define void @sar_reg32_imm8(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @put8(i8 zeroext -63)
%4 = trunc i64 %0 to i8
%5 = add i8 %4, -8
%6 = tail call i32 @put8(i8 zeroext %5)
%7 = tail call i32 @put8(i8 zeroext %1)
ret void
}
/* Variables and functions */
char *strpbrk(char const *, char const *);
char *mc_strpbrk(const char *s1, const char *s2) { return strpbrk(s1, s2); }


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

x86 assembly (clang, -O2):
<mc_strpbrk>:
jmp    1030 <strpbrk@plt>

LLVM IR (-O0):
define i8* @mc_strpbrk(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 = load i8*, i8** %4
%7 = call i8* @strpbrk(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @mc_strpbrk(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strpbrk(i8* %0, i8* %1)
ret i8* %3
}
int func(void) {
  int class = 0;
  return class;
}


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

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

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

LLVM IR (-O2):
define i32 @func() {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t get_le32(const uint8_t *p) {
  return (((uint32_t)p[3]) << 24) | (((uint32_t)p[2]) << 16) |
         (((uint32_t)p[1]) << 8) | p[0];
}


x86 assembly (clang, -O0):
<get_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_le32>:
mov    0xc(%rdi),%ecx
shl    $0x18,%ecx
mov    0x4(%rdi),%eax
mov    0x8(%rdi),%edx
shl    $0x10,%edx
or     %ecx,%edx
shl    $0x8,%eax
or     %edx,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_le32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 0
%19 = load i32, i32* %18
%20 = or i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @get_le32(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = shl i32 %6, 16
%8 = or i32 %7, %4
%9 = getelementptr inbounds i32, i32* %0, i64 1
%10 = load i32, i32* %9
%11 = shl i32 %10, 8
%12 = or i32 %8, %11
%13 = load i32, i32* %0
%14 = or i32 %12, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand_i();
int main(int argc, char *argv[]) { printf("%d\n", rand_i()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rand_i@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand_i()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int f2(int a, int b) {
  assert(a - b == 0);
  assert(a == b);
  return 48;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x30,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbx
xor    %ebx,%ebx
cmp    %esi,%edi
sete   %bl
mov    %ebx,%edi
call   1030 <assert@plt>
mov    %ebx,%edi
call   1030 <assert@plt>
mov    $0x30,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = icmp eq i32 %11, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret i32 48
}

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @assert(i32 %4)
ret i32 48
}
void foo403() {}


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

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

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

LLVM IR (-O2):
define void @foo403() {
ret void
}
/* Type definitions */
struct packit_record {
  int dummy;
};
struct packit {
  int dummy;
};
typedef int /*<<< orphan*/ ns;

/* Variables and functions */
struct packit_record *packit_add_header(struct packit *, char const *,
                                        char const *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
struct packit_record *packit_add_int_header(struct packit *p, const char *key,
                                            int val) {
  char ns[21];
  snprintf((char *)&ns, sizeof(ns), "%d", val);
  return packit_add_header(p, key, (const char *)&ns);
}


x86 assembly (clang, -O0):
<packit_add_int_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%ecx
mov    $0x15,%esi
lea    0xeba(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1030 <packit_add_header@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<packit_add_int_header>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edx,%ecx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec8(%rip),%rdx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x15,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <packit_add_header@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.packit_record = type { i32 }
%struct.packit = type { i32 }
@.str = [3 x i8] c"%d\00"
define %struct.packit_record* @packit_add_int_header(%struct.packit* %0, i8* %1, i32 %2) {
%4 = alloca %struct.packit*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [21 x i8]
store %struct.packit* %0, %struct.packit** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = bitcast [21 x i8]* %7 to i8*
%9 = load i32, i32* %6
%10 = call i32 @snprintf(i8* %8, i32 21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load %struct.packit*, %struct.packit** %4
%12 = load i8*, i8** %5
%13 = bitcast [21 x i8]* %7 to i8*
%14 = call %struct.packit_record* @packit_add_header(%struct.packit* %11, i8* %12, i8* %13)
ret %struct.packit_record* %14
}

LLVM IR (-O2):
%struct.packit_record = type { i32 }
%struct.packit = type { i32 }
@.str = [3 x i8] c"%d\00"
define %struct.packit_record* @packit_add_int_header(%struct.packit* %0, i8* %1, i32 %2) {
%4 = alloca [21 x i8]
%5 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%7 = call %struct.packit_record* @packit_add_header(%struct.packit* %0, i8* %1, i8* %5)
ret %struct.packit_record* %7
}
/* Variables and functions */
int foo(int);
int xxx(void) {
  int x = 45;
  int sum = 0;
  while (x >>= 1)
    sum += foo(x) * 2;
  return sum;
}


x86 assembly (clang, -O0):
<xxx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2d,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     114e <xxx+0x3e>
mov    -0x4(%rbp),%edi
call   1030 <foo@plt>
shl    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <xxx+0x16>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xxx>:
push   %rbp
push   %rbx
push   %rax
mov    $0x16,%edi
call   1030 <foo@plt>
mov    %eax,%ebx
mov    $0xb,%edi
call   1030 <foo@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x5,%edi
call   1030 <foo@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    $0x2,%edi
call   1030 <foo@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x1,%edi
call   1030 <foo@plt>
add    %ebp,%eax
add    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @xxx() {
%1 = tail call i32 @foo(i32 22)
%2 = tail call i32 @foo(i32 11)
%3 = add i32 %2, %1
%4 = tail call i32 @foo(i32 5)
%5 = add i32 %4, %3
%6 = tail call i32 @foo(i32 2)
%7 = add i32 %6, %5
%8 = tail call i32 @foo(i32 1)
%9 = add i32 %8, %7
%10 = shl i32 %9, 1
ret i32 %10
}
void EVP_DecodeUpdate(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_DecodeUpdate() {
ret void
}
int test_imm_F6uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xF6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F6uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xf6,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_F6uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 246
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void foo572(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo572(i32 %0) {
ret void
}
unsigned long getNextAmplitudeSquare(unsigned long currentAmplitude,
                                     unsigned long currentTime,
                                     unsigned long currentFrequency) {}


x86 assembly (clang, -O0):
<getNextAmplitudeSquare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @getNextAmplitudeSquare(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64, i64* %4
ret i64 %8
}

LLVM IR (-O2):
define i64 @getNextAmplitudeSquare(i64 %0, i64 %1, i64 %2) {
ret i64 undef
}
int strcmp(const char *s1, const char *s2) {
  int r;
  while (
      ((r = ((int)(*((unsigned char *)s1))) - *((unsigned char *)s2++)) == 0) &&
      *s1++)
    ;
  return r;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movzbl (%rax),%eax
sub    %eax,%ecx
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
jne    1153 <strcmp+0x53>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1163 <strcmp+0x63>
jmp    1168 <strcmp+0x68>
jmp    110c <strcmp+0xc>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rcx,1),%edx
movzbl (%rsi,%rcx,1),%r8d
mov    %edx,%eax
sub    %r8d,%eax
jne    1128 <strcmp+0x28>
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcmp+0x10>
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %12, %3 ]
%5 = phi i8* [ %0, %2 ], [ %13, %3 ]
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = sub nsw i32 %7, %9
%11 = icmp ne i32 %10, 0
%12 = getelementptr inbounds i8, i8* %4, i64 1
%13 = getelementptr inbounds i8, i8* %5, i64 1
%14 = icmp eq i8 %6, 0
%15 = select i1 %11, i1 true, i1 %14
br i1 %15, label %16, label %3
16: ; preds = %3
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ Emit1(int);
void emit_popad(void) { Emit1(0x61); }


x86 assembly (clang, -O0):
<emit_popad>:
push   %rbp
mov    %rsp,%rbp
mov    $0x61,%edi
call   1030 <Emit1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_popad>:
mov    $0x61,%edi
jmp    1030 <Emit1@plt>

LLVM IR (-O0):
define void @emit_popad() {
%1 = call i32 @Emit1(i32 97)
ret void
}

LLVM IR (-O2):
define void @emit_popad() {
%1 = tail call i32 @Emit1(i32 97)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Proc0();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char **argv) {
  Proc0();
  exit(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 <Proc0@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <Proc0@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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 (...) @Proc0()
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Proc0()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void print_line(int item, int value) { printf("Item %d: %d\n", item, value); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"Item %d: %d\0A\00"
define void @print_line(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
unsigned int ft_strlen_num(int num) {
  int div;
  unsigned int i;
  div = 10;
  i = 1;
  while (num / div) {
    div *= 10;
    i += 1;
  }
  return (i);
}


x86 assembly (clang, -O0):
<ft_strlen_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%eax
je     113a <ft_strlen_num+0x3a>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <ft_strlen_num+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen_num>:
lea    0x9(%rdi),%eax
mov    $0x1,%ecx
cmp    $0x13,%eax
jb     1131 <ft_strlen_num+0x31>
mov    $0xa,%esi
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
add    %esi,%esi
lea    (%rsi,%rsi,4),%esi
add    $0x1,%ecx
mov    %edi,%eax
cltd
idiv   %esi
test   %eax,%eax
jne    1120 <ft_strlen_num+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_strlen_num(i32 %0) {
%2 = add i32 %0, 9
%3 = icmp ult i32 %2, 19
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i32 [ %7, %4 ], [ 10, %1 ]
%7 = mul nuw nsw i32 %6, 10
%8 = add i32 %5, 1
%9 = sdiv i32 %0, %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_mulhi_epi16(int /*<<< orphan*/ const,
                                   int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm_slli_epi32(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_srli_epi32(int /*<<< orphan*/ const, int);
__m128i ColorTransformDelta(__m128i color_pred, __m128i color) {
  const __m128i color_pred_shifted = _mm_slli_epi32(color_pred, 8);
  const __m128i color_shifted = _mm_slli_epi32(color, 8);
  const __m128i signed_mult =
      _mm_mulhi_epi16(color_pred_shifted, color_shifted);
  return _mm_srli_epi32(signed_mult, 5);
}


x86 assembly (clang, -O0):
<ColorTransformDelta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1040 <_mm_slli_epi32@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x8,%esi
call   1040 <_mm_slli_epi32@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <_mm_mulhi_epi16@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x5,%esi
call   1050 <_mm_srli_epi32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ColorTransformDelta>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    $0x8,%esi
call   1040 <_mm_slli_epi32@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x8,%esi
call   1040 <_mm_slli_epi32@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <_mm_mulhi_epi16@plt>
mov    %eax,%edi
mov    $0x5,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <_mm_srli_epi32@plt>

LLVM IR (-O0):
define i32 @ColorTransformDelta(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = call i32 @_mm_slli_epi32(i32 %8, i32 8)
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = call i32 @_mm_slli_epi32(i32 %10, i32 8)
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @_mm_mulhi_epi16(i32 %12, i32 %13)
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = call i32 @_mm_srli_epi32(i32 %15, i32 5)
ret i32 %16
}

LLVM IR (-O2):
define i32 @ColorTransformDelta(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_slli_epi32(i32 %0, i32 8)
%4 = tail call i32 @_mm_slli_epi32(i32 %1, i32 8)
%5 = tail call i32 @_mm_mulhi_epi16(i32 %3, i32 %4)
%6 = tail call i32 @_mm_srli_epi32(i32 %5, i32 5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ writel(int, void *);
void set__PIO_PCx__INPUT_HIGH_IMPEDANCE(void *base, int pin) {
  writel(((0x1) & 0x1) << pin, base + (0x24 + (2) * 0x10));
  writel(((0x1) & 0x1) << pin, base + (0x28 + (1) * 0x10));
  writel(((0x1) & 0x1) << pin, base + (0x28 + (0) * 0x10));
}


x86 assembly (clang, -O0):
<set__PIO_PCx__INPUT_HIGH_IMPEDANCE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%edi
shl    %cl,%edi
mov    -0x8(%rbp),%rsi
add    $0x44,%rsi
call   1030 <writel@plt>
mov    -0xc(%rbp),%ecx
mov    $0x1,%edi
shl    %cl,%edi
mov    -0x8(%rbp),%rsi
add    $0x38,%rsi
call   1030 <writel@plt>
mov    -0xc(%rbp),%ecx
mov    $0x1,%edi
shl    %cl,%edi
mov    -0x8(%rbp),%rsi
add    $0x28,%rsi
call   1030 <writel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set__PIO_PCx__INPUT_HIGH_IMPEDANCE>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ecx
mov    %rdi,%rbx
mov    $0x1,%ebp
shl    %cl,%ebp
lea    0x44(%rdi),%rsi
mov    %ebp,%edi
call   1030 <writel@plt>
lea    0x38(%rbx),%rsi
mov    %ebp,%edi
call   1030 <writel@plt>
add    $0x28,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <writel@plt>

LLVM IR (-O0):
define void @set__PIO_PCx__INPUT_HIGH_IMPEDANCE(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = load i8*, i8** %3
%8 = getelementptr i8, i8* %7, i64 68
%9 = call i32 @writel(i32 %6, i8* %8)
%10 = load i32, i32* %4
%11 = shl i32 1, %10
%12 = load i8*, i8** %3
%13 = getelementptr i8, i8* %12, i64 56
%14 = call i32 @writel(i32 %11, i8* %13)
%15 = load i32, i32* %4
%16 = shl i32 1, %15
%17 = load i8*, i8** %3
%18 = getelementptr i8, i8* %17, i64 40
%19 = call i32 @writel(i32 %16, i8* %18)
ret void
}

LLVM IR (-O2):
define void @set__PIO_PCx__INPUT_HIGH_IMPEDANCE(i8* %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = getelementptr i8, i8* %0, i64 68
%5 = tail call i32 @writel(i32 %3, i8* %4)
%6 = getelementptr i8, i8* %0, i64 56
%7 = tail call i32 @writel(i32 %3, i8* %6)
%8 = getelementptr i8, i8* %0, i64 40
%9 = tail call i32 @writel(i32 %3, i8* %8)
ret void
}
void swap(struct stats_record **a, struct stats_record **b) {
  struct stats_record *tmp;
  tmp = *a;
  *a = *b;
  *b = tmp;
}


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

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
%struct.stats_record = type opaque
define void @swap(%struct.stats_record** %0, %struct.stats_record** %1) {
%3 = alloca %struct.stats_record**
%4 = alloca %struct.stats_record**
%5 = alloca %struct.stats_record*
store %struct.stats_record** %0, %struct.stats_record*** %3
store %struct.stats_record** %1, %struct.stats_record*** %4
%6 = load %struct.stats_record**, %struct.stats_record*** %3
%7 = load %struct.stats_record*, %struct.stats_record** %6
store %struct.stats_record* %7, %struct.stats_record** %5
%8 = load %struct.stats_record**, %struct.stats_record*** %4
%9 = load %struct.stats_record*, %struct.stats_record** %8
%10 = load %struct.stats_record**, %struct.stats_record*** %3
store %struct.stats_record* %9, %struct.stats_record** %10
%11 = load %struct.stats_record*, %struct.stats_record** %5
%12 = load %struct.stats_record**, %struct.stats_record*** %4
store %struct.stats_record* %11, %struct.stats_record** %12
ret void
}

LLVM IR (-O2):
%struct.stats_record = type opaque
define void @swap(%struct.stats_record** nocapture %0, %struct.stats_record** nocapture %1) {
%3 = load %struct.stats_record*, %struct.stats_record** %0
%4 = load %struct.stats_record*, %struct.stats_record** %1
store %struct.stats_record* %4, %struct.stats_record** %0
store %struct.stats_record* %3, %struct.stats_record** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_freq_to_ICR10(double);
void plugin_set_downlink_frequency(double frequency) {
  send_freq_to_ICR10(frequency);
}


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

x86 assembly (clang, -O2):
<plugin_set_downlink_frequency>:
jmp    1030 <send_freq_to_ICR10@plt>

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

LLVM IR (-O2):
define void @plugin_set_downlink_frequency(double %0) {
%2 = tail call i32 @send_freq_to_ICR10(double %0)
ret void
}