xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ matrix_multiply_ext(float *, float const *, float *);
float *matrix_multiply(float matrix1[4 * 4], const float matrix2[4 * 4]) {
  float temp[4 * 4];
  int i = 0;
  matrix_multiply_ext(matrix1, matrix2, temp);
  for (i = 0; i < 4 * 4; i++)
    matrix1[i] = temp[i];
  return matrix1;
}


x86 assembly (clang, -O0):
<matrix_multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x54(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1030 <matrix_multiply_ext@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0x10,-0x54(%rbp)
jge    116e <matrix_multiply+0x5e>
movslq -0x54(%rbp),%rax
movss  -0x50(%rbp,%rax,4),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x54(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    113f <matrix_multiply+0x2f>
mov    -0x8(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_multiply>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdx
call   1030 <matrix_multiply_ext@plt>
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
movaps 0x20(%rsp),%xmm2
movaps 0x30(%rsp),%xmm3
movups %xmm0,(%rbx)
movups %xmm1,0x10(%rbx)
movups %xmm2,0x20(%rbx)
movups %xmm3,0x30(%rbx)
mov    %rbx,%rax
add    $0x40,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define float* @matrix_multiply(float* returned %0, float* %1) {
%3 = bitcast float* %0 to i8*
%4 = alloca [16 x float]
%5 = bitcast [16 x float]* %4 to i8*
%6 = getelementptr inbounds [16 x float], [16 x float]* %4, i64 0, i64 0
%7 = call i32 @matrix_multiply_ext(float* %0, float* %1, float* %6)
ret float* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ XLeaveWindowEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XLeaveWindowEvent(void) {
  XLeaveWindowEvent *_p =
      (XLeaveWindowEvent *)malloc(sizeof(XLeaveWindowEvent));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XLeaveWindowEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XLeaveWindowEvent+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XLeaveWindowEvent>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XLeaveWindowEvent+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XLeaveWindowEvent() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XLeaveWindowEvent() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
/* Variables and functions */
unsigned char *encode32(unsigned char *, unsigned int);
unsigned char *encode(unsigned char *buffer, int data) {
  return encode32(buffer, (unsigned int)data);
}


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

x86 assembly (clang, -O2):
<encode>:
jmp    1030 <encode32@plt>

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

LLVM IR (-O2):
define i8* @encode(i8* %0, i32 %1) {
%3 = tail call i8* @encode32(i8* %0, i32 %1)
ret i8* %3
}
int c013(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @c013() {
ret i32 0
}

LLVM IR (-O2):
define i32 @c013() {
ret i32 0
}
int find(char *s, char c, long l) {
  for (int i = 0; i < l; i++) {
    if (*(s + i) == c) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    115d <find+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    114a <find+0x4a>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <find+0x64>
jmp    114f <find+0x4f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1119 <find+0x19>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
mov    $0xffffffff,%eax
test   %rdx,%rdx
jle    111f <find+0x1f>
xor    %ecx,%ecx
nopl   0x0(%rax)
cmp    %sil,(%rdi,%rcx,1)
je     1120 <find+0x20>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <find+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @find(i8* nocapture %0, i8 signext %1, i64 %2) {
%4 = icmp sgt i64 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3, %10
%6 = phi i64 [ %11, %10 ], [ 0, %3 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, %1
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = add nuw nsw i64 %6, 1
%12 = icmp eq i64 %11, %2
br i1 %12, label %15, label %5
13: ; preds = %5
%14 = trunc i64 %6 to i32
br label %15
15: ; preds = %10, %13, %3
%16 = phi i32 [ -1, %3 ], [ %14, %13 ], [ -1, %10 ]
ret i32 %16
}
/* Variables and functions */
char *strrchr(char const *, char);
char *n_basenam(const char *path) {
  char *s = strrchr(path, '/');
  if (s)
    return ++s;
  return (char *)path;
}


x86 assembly (clang, -O0):
<n_basenam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114e <n_basenam+0x3e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x8(%rbp)
jmp    1156 <n_basenam+0x46>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_basenam>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @n_basenam(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
void g_pattern_match_simple() {}


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

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

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

LLVM IR (-O2):
define void @g_pattern_match_simple() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct timespec {
  int /*<<< orphan*/ member_0;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ timespec_to_ns(struct timespec *);
uint64_t gettime_ns(clockid_t clk_id) {
  struct timespec ts = {0};
  clock_gettime(clk_id, &ts);
  return timespec_to_ns(&ts);
}


x86 assembly (clang, -O0):
<gettime_ns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
lea    -0x8(%rbp),%rdi
call   1050 <timespec_to_ns@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime_ns>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1030 <clock_gettime@plt>
mov    %rbx,%rdi
call   1040 <timespec_to_ns@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @gettime_ns(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = bitcast %struct.timespec* %3 to i8*
%5 = load i32, i32* %2
%6 = call i32 @clock_gettime(i32 %5, %struct.timespec* %3)
%7 = call i32 @timespec_to_ns(%struct.timespec* %3)
ret i32 %7
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @gettime_ns(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 0, i32* %4
%5 = call i32 @clock_gettime(i32 %0, %struct.timespec* %2)
%6 = call i32 @timespec_to_ns(%struct.timespec* %2)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(void *, size_t, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ invertsmp(void *, size_t, size_t);
size_t freadsmp(void *buf, size_t ss, size_t count, FILE *stream, int neg) {
  size_t rd;
  rd = fread(buf, ss, count, stream);
  if (neg)
    invertsmp(buf, ss, count);
  return rd;
}


x86 assembly (clang, -O0):
<freadsmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <fread@plt>
mov    %rax,-0x30(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1170 <freadsmp+0x50>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <invertsmp@plt>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freadsmp>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%ebp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <fread@plt>
mov    %rax,%r12
test   %ebp,%ebp
je     114e <freadsmp+0x2e>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <invertsmp@plt>
mov    %r12,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @freadsmp(i8* %0, i64 %1, i64 %2, i32* nocapture %3, i32 %4) {
%6 = tail call i64 @fread(i8* %0, i64 %1, i64 %2, i32* %3)
%7 = icmp eq i32 %4, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @invertsmp(i8* %0, i64 %1, i64 %2)
br label %10
10: ; preds = %8, %5
ret i64 %6
}
/* Variables and functions */
int pipe(int *);
int arch_create_pipe(int pipefd[2]) { return (pipe(pipefd)); }


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

x86 assembly (clang, -O2):
<arch_create_pipe>:
jmp    1030 <pipe@plt>

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

LLVM IR (-O2):
define i32 @arch_create_pipe(i32* %0) {
%2 = tail call i32 @pipe(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test2() { printf("test2\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"test2\00"
define void @test2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int /*<<< orphan*/ strcat(char *, char const *);
size_t strlen(char const *);
void get_strcat_objname(char *iface_objname, const char *objname,
                        const char *iface_name) {
  memcpy(&iface_objname[0], objname, strlen(objname));
  iface_objname[strlen(objname)] = '\0';
  strcat(iface_objname, iface_name);
  return;
}


x86 assembly (clang, -O0):
<get_strcat_objname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %rax,%rdx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strcat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_strcat_objname>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
movb   $0x0,(%r15,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <strcat@plt>

LLVM IR (-O0):
define void @get_strcat_objname(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8*, i8** %5
%10 = load i8*, i8** %5
%11 = call i64 @strlen(i8* %10)
%12 = call i32 @memcpy(i8* %8, i8* %9, i64 %11)
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = call i64 @strlen(i8* %14)
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %4
%18 = load i8*, i8** %6
%19 = call i32 @strcat(i8* %17, i8* %18)
ret void
}

LLVM IR (-O2):
define void @get_strcat_objname(i8* %0, i8* %1, i8* %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %4)
%6 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
%8 = tail call i32 @strcat(i8* %0, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EVP_chacha20_poly1305();
int do_test_bio_cipher(int /*<<< orphan*/, int);
int test_bio_enc_chacha20_poly1305(int idx) {
  return do_test_bio_cipher(EVP_chacha20_poly1305(), idx);
}


x86 assembly (clang, -O0):
<test_bio_enc_chacha20_poly1305>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <EVP_chacha20_poly1305@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1040 <do_test_bio_cipher@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bio_enc_chacha20_poly1305>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <EVP_chacha20_poly1305@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <do_test_bio_cipher@plt>

LLVM IR (-O0):
define i32 @test_bio_enc_chacha20_poly1305(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @EVP_chacha20_poly1305()
%4 = load i32, i32* %2
%5 = call i32 @do_test_bio_cipher(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_bio_enc_chacha20_poly1305(i32 %0) {
%2 = tail call i32 (...) @EVP_chacha20_poly1305()
%3 = tail call i32 @do_test_bio_cipher(i32 %2, i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
void printnum(long long x) { printf("%lld ", x); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%lld \00"
define void @printnum(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
int cmp_char_des(const void *x, const void *y) {
  if (*(char *)x > *(char *)y) {
    return -1;
  } else if (*(char *)x < *(char *)y) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmp_char_des>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jle    112e <cmp_char_des+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <cmp_char_des+0x5c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jge    1150 <cmp_char_des+0x50>
movl   $0x1,-0x4(%rbp)
jmp    115c <cmp_char_des+0x5c>
jmp    1155 <cmp_char_des+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_char_des>:
mov    (%rdi),%al
xor    %ecx,%ecx
cmp    (%rsi),%al
setl   %cl
mov    $0xffffffff,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_char_des(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp sgt i8 %3, %4
%6 = icmp slt i8 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World");
  getchar();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret i32 0
}
double hoursSpent(void) { return 96.0; }


x86 assembly (clang, -O0):
<hoursSpent>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hoursSpent>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @hoursSpent() {
ret double 9.600000e+01
}

LLVM IR (-O2):
define double @hoursSpent() {
ret double 9.600000e+01
}
/* Variables and functions */
int kprintf(char *, char const *);
int kputs(const char *s) { return kprintf("%s\n", s); }


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

x86 assembly (clang, -O2):
<kputs>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <kprintf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @kputs(i8* %0) {
%2 = tail call i32 @kprintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
void loc() {
  asm volatile("movq (%%rbp), %%rax\n\t"
               "popq %%rbx\n\t"
               "lea (%%rax, %%rbx, 8), %%rax\n\t"
               "pushq %%rax\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<loc>:
push   %rbp
mov    %rsp,%rbp
mov    0x0(%rbp),%rax
pop    %rbx
lea    (%rax,%rbx,8),%rax
push   %rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<loc>:
mov    0x0(%rbp),%rax
pop    %rbx
lea    (%rax,%rbx,8),%rax
push   %rax
ret

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

LLVM IR (-O2):
define void @loc() {
tail call void asm sideeffect "movq (%rbp), %rax\0A\09popq %rbx\0A\09lea (%rax, %rbx, 8), %rax\0A\09pushq %rax\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
scalar_t__ fmaf(float, float, float);
int /*<<< orphan*/ link_failure_fmaf();
void test_fmaf(float f1, float f2, float f3) {
  if (fmaf(f1, f2, f3) != fmaf(f1, f2, f3))
    link_failure_fmaf();
}


x86 assembly (clang, -O0):
<test_fmaf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <fmaf@plt>
mov    %rax,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <fmaf@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     117a <test_fmaf+0x5a>
mov    $0x0,%al
call   1040 <link_failure_fmaf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fmaf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm2,0xc(%rsp)
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0x4(%rsp)
call   1030 <fmaf@plt>
mov    %rax,%rbx
movss  0x4(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movss  0xc(%rsp),%xmm2
call   1030 <fmaf@plt>
cmp    %rax,%rbx
jne    1161 <test_fmaf+0x41>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_fmaf@plt>

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

LLVM IR (-O2):
define void @test_fmaf(float %0, float %1, float %2) {
%4 = tail call i64 @fmaf(float %0, float %1, float %2)
%5 = tail call i64 @fmaf(float %0, float %1, float %2)
%6 = icmp eq i64 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 (...) @link_failure_fmaf()
br label %9
9: ; preds = %7, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void USB_EndPoint10(uint32_t event) {}


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

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

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

LLVM IR (-O2):
define void @USB_EndPoint10(i32 %0) {
ret void
}
/* Type definitions */
struct Event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ manage_setup_arrival(struct Event *);
int setup_busy(struct Event *ev) {
  manage_setup_arrival(ev);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.Event = type { i32 }
define i32 @setup_busy(%struct.Event* %0) {
%2 = alloca %struct.Event*
store %struct.Event* %0, %struct.Event** %2
%3 = load %struct.Event*, %struct.Event** %2
%4 = call i32 @manage_setup_arrival(%struct.Event* %3)
ret i32 0
}

LLVM IR (-O2):
%struct.Event = type { i32 }
define i32 @setup_busy(%struct.Event* %0) {
%2 = tail call i32 @manage_setup_arrival(%struct.Event* %0)
ret i32 0
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) {
  if (isupper(c))
    return ('a' - 'A' + c);
  return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113b <tolower+0x2b>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <tolower+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t onTimeout(void *context) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @onTimeout(i8* nocapture readnone %0) {
ret i32 0
}
void SPI2_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @SPI2_IRQHandler() {
ret void
}
/* Variables and functions */
bool alwaysTrue(void) { return true; }


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

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

LLVM IR (-O0):
define i32 @alwaysTrue() {
ret i32 1
}

LLVM IR (-O2):
define i32 @alwaysTrue() {
ret i32 1
}
unsigned int inl(unsigned short int port) {
  unsigned int _v;
  __asm__ __volatile__("inl %w1,%0" : "=a"(_v) : "Nd"(port));
  return _v;
}


x86 assembly (clang, -O0):
<inl>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inl>:
mov    %edi,%edx
in     (%dx),%eax
ret

LLVM IR (-O0):
define i32 @inl(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i32 asm sideeffect "inl ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @inl(i16 zeroext %0) {
%2 = tail call i32 asm sideeffect "inl ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ping();
int main() {
  ping();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ping()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PCI_DEV(int /*<<< orphan*/, int, int /*<<< orphan*/);
int /*<<< orphan*/ outb(int, int);
unsigned int pci_read_config8(int /*<<< orphan*/, int);
int /*<<< orphan*/ pci_write_config8(int /*<<< orphan*/, int, unsigned int);
void full_reset(void) {
  unsigned byte;
  byte = pci_read_config8(PCI_DEV(0, 0x1f, 0), 0xa4);
  byte &= 0xfe;
  pci_write_config8(PCI_DEV(0, 0x1f, 0), 0xa4, byte);
  outb(0x0e, 0xcf9);
}


x86 assembly (clang, -O0):
<full_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edx,%edx
mov    $0x1f,%esi
mov    %edx,%edi
call   1060 <PCI_DEV@plt>
mov    %eax,%edi
mov    $0xa4,%esi
call   1050 <pci_read_config8@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfe,%eax
mov    %eax,-0x4(%rbp)
xor    %edx,%edx
mov    $0x1f,%esi
mov    %edx,%edi
call   1060 <PCI_DEV@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%edx
mov    $0xa4,%esi
call   1040 <pci_write_config8@plt>
mov    $0xe,%edi
mov    $0xcf9,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<full_reset>:
push   %rbx
xor    %edi,%edi
mov    $0x1f,%esi
xor    %edx,%edx
call   1060 <PCI_DEV@plt>
mov    %eax,%edi
mov    $0xa4,%esi
call   1050 <pci_read_config8@plt>
mov    %eax,%ebx
and    $0xfe,%ebx
xor    %edi,%edi
mov    $0x1f,%esi
xor    %edx,%edx
call   1060 <PCI_DEV@plt>
mov    %eax,%edi
mov    $0xa4,%esi
mov    %ebx,%edx
call   1040 <pci_write_config8@plt>
mov    $0xe,%edi
mov    $0xcf9,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @full_reset() {
%1 = alloca i32
%2 = call i32 @PCI_DEV(i32 0, i32 31, i32 0)
%3 = call i32 @pci_read_config8(i32 %2, i32 164)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = and i32 %4, 254
store i32 %5, i32* %1
%6 = call i32 @PCI_DEV(i32 0, i32 31, i32 0)
%7 = load i32, i32* %1
%8 = call i32 @pci_write_config8(i32 %6, i32 164, i32 %7)
%9 = call i32 @outb(i32 14, i32 3321)
ret void
}

LLVM IR (-O2):
define void @full_reset() {
%1 = tail call i32 @PCI_DEV(i32 0, i32 31, i32 0)
%2 = tail call i32 @pci_read_config8(i32 %1, i32 164)
%3 = and i32 %2, 254
%4 = tail call i32 @PCI_DEV(i32 0, i32 31, i32 0)
%5 = tail call i32 @pci_write_config8(i32 %4, i32 164, i32 %3)
%6 = tail call i32 @outb(i32 14, i32 3321)
ret void
}
int domul(int a, int b) { return a * b; }


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

x86 assembly (clang, -O2):
<domul>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @domul(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @domul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Quick(int);
int main() {
  int i;
  for (i = 0; i < 5; i++)
    Quick(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <Quick@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <Quick@plt>
mov    $0x1,%edi
call   1030 <Quick@plt>
mov    $0x2,%edi
call   1030 <Quick@plt>
mov    $0x3,%edi
call   1030 <Quick@plt>
mov    $0x4,%edi
call   1030 <Quick@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @Quick(i32 0)
%2 = tail call i32 @Quick(i32 1)
%3 = tail call i32 @Quick(i32 2)
%4 = tail call i32 @Quick(i32 3)
%5 = tail call i32 @Quick(i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PI_toplevel();
PI_main() { PI_toplevel(); }


x86 assembly (clang, -O0):
<PI_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <PI_toplevel@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @PI_main() {
%1 = alloca i32
%2 = call i32 (...) @PI_toplevel()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @PI_main() {
%1 = tail call i32 (...) @PI_toplevel()
ret i32 undef
}
void _dbg(int efd, const char *err_src, const char *fmt, ...) { return; }


x86 assembly (clang, -O0):
<_dbg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @_dbg(i32 %0, i8* %1, i8* %2, ...) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @_dbg(i32 %0, i8* nocapture %1, i8* nocapture %2, ...) {
ret void
}
long __syscall0(long __n) {
  unsigned long __ret;
  __asm__ __volatile__("syscall"
                       : "=a"(__ret)
                       : "a"(__n)
                       : "rcx", "r11", "memory");
  return __ret;
}


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

x86 assembly (clang, -O2):
<__syscall0>:
mov    %rdi,%rax
syscall
ret

LLVM IR (-O0):
define i64 @__syscall0(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 asm sideeffect "syscall", "={ax},{ax},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @__syscall0(i64 %0) {
%2 = tail call i64 asm sideeffect "syscall", "={ax},{ax},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret i64 %2
}
int balloon_to_color(char balloon) {
  switch (balloon) {
  case '^':
    return 1;
  case '=':
    return 2;
  case '+':
    return 3;
  case 'o':
    return 4;
  case '-':
    return 5;
  default:
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<balloon_to_color>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2b,%eax
je     117b <balloon_to_color+0x7b>
jmp    111f <balloon_to_color+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     1193 <balloon_to_color+0x93>
jmp    1130 <balloon_to_color+0x30>
mov    -0xc(%rbp),%eax
sub    $0x3d,%eax
je     116f <balloon_to_color+0x6f>
jmp    1141 <balloon_to_color+0x41>
mov    -0xc(%rbp),%eax
sub    $0x5e,%eax
je     1163 <balloon_to_color+0x63>
jmp    1152 <balloon_to_color+0x52>
mov    -0xc(%rbp),%eax
sub    $0x6f,%eax
je     1187 <balloon_to_color+0x87>
jmp    119f <balloon_to_color+0x9f>
movl   $0x1,-0x4(%rbp)
jmp    11a6 <balloon_to_color+0xa6>
movl   $0x2,-0x4(%rbp)
jmp    11a6 <balloon_to_color+0xa6>
movl   $0x3,-0x4(%rbp)
jmp    11a6 <balloon_to_color+0xa6>
movl   $0x4,-0x4(%rbp)
jmp    11a6 <balloon_to_color+0xa6>
movl   $0x5,-0x4(%rbp)
jmp    11a6 <balloon_to_color+0xa6>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<balloon_to_color>:
cmp    $0x3c,%edi
jle    111f <balloon_to_color+0x1f>
cmp    $0x6f,%edi
je     112f <balloon_to_color+0x2f>
mov    $0x1,%eax
cmp    $0x5e,%edi
je     113d <balloon_to_color+0x3d>
cmp    $0x3d,%edi
jne    113b <balloon_to_color+0x3b>
mov    $0x2,%eax
ret
cmp    $0x2b,%edi
je     1135 <balloon_to_color+0x35>
cmp    $0x2d,%edi
jne    113b <balloon_to_color+0x3b>
mov    $0x5,%eax
ret
mov    $0x4,%eax
ret
mov    $0x3,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @balloon_to_color(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %11 [
i32 94, label %6
i32 61, label %7
i32 43, label %8
i32 111, label %9
i32 45, label %10
]
6: ; preds = %1
store i32 1, i32* %2
br label %12
7: ; preds = %1
store i32 2, i32* %2
br label %12
8: ; preds = %1
store i32 3, i32* %2
br label %12
9: ; preds = %1
store i32 4, i32* %2
br label %12
10: ; preds = %1
store i32 5, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @balloon_to_color(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %7 [
i32 94, label %8
i32 61, label %3
i32 43, label %4
i32 111, label %5
i32 45, label %6
]
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4, %3
%9 = phi i32 [ 0, %7 ], [ 5, %6 ], [ 4, %5 ], [ 3, %4 ], [ 2, %3 ], [ 1, %1 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ GLeeInit();
int pglXWaitVideoSyncSGI(int, int, unsigned int *);
int _Lazy_glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count) {
  if (GLeeInit())
    return pglXWaitVideoSyncSGI(divisor, remainder, count);
  return (int)0;
}


x86 assembly (clang, -O0):
<_Lazy_glXWaitVideoSyncSGI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <GLeeInit@plt>
cmp    $0x0,%rax
je     115a <_Lazy_glXWaitVideoSyncSGI+0x3a>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <pglXWaitVideoSyncSGI@plt>
mov    %eax,-0x4(%rbp)
jmp    1161 <_Lazy_glXWaitVideoSyncSGI+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Lazy_glXWaitVideoSyncSGI>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <GLeeInit@plt>
test   %rax,%rax
je     1147 <_Lazy_glXWaitVideoSyncSGI+0x27>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <pglXWaitVideoSyncSGI@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @_Lazy_glXWaitVideoSyncSGI(i32 %0, i32 %1, i32* %2) {
%4 = tail call i64 (...) @GLeeInit()
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @pglXWaitVideoSyncSGI(i32 %0, i32 %1, i32* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ 0, %3 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void llio_free_fdset(fd_set *set) { free(set); }


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

x86 assembly (clang, -O2):
<llio_free_fdset>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @llio_free_fdset(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_dobldobl_container_to_target_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(256, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_dobldobl_container_to_target_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x100,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_dobldobl_container_to_target_solutions>:
mov    $0x100,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_dobldobl_container_to_target_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 256, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_dobldobl_container_to_target_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 256, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int is_unary_operator(char c) { return (c == '`' || c == '~'); }


x86 assembly (clang, -O0):
<is_unary_operator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x60,%ecx
mov    %al,-0x2(%rbp)
je     1129 <is_unary_operator+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x7e,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_unary_operator>:
cmp    $0x60,%dil
sete   %al
cmp    $0x7e,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_unary_operator(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 96
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 126
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_unary_operator(i8 signext %0) {
%2 = icmp eq i8 %0, 96
%3 = icmp eq i8 %0, 126
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct YsGLSL3DRenderer {
  int dummy;
};

/* Variables and functions */
struct YsGLSL3DRenderer *YsGLSLCreateVariColorPerVtxShading3DRenderer();
struct YsGLSL3DRenderer *
YsGLSLCreateMonoColorPerVtxShadingWithTexCoord3DRenderer(void) {
  return YsGLSLCreateVariColorPerVtxShading3DRenderer();
}


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

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

LLVM IR (-O0):
%struct.YsGLSL3DRenderer = type { i32 }
define %struct.YsGLSL3DRenderer* @YsGLSLCreateMonoColorPerVtxShadingWithTexCoord3DRenderer() {
%1 = call %struct.YsGLSL3DRenderer* (...) @YsGLSLCreateVariColorPerVtxShading3DRenderer()
ret %struct.YsGLSL3DRenderer* %1
}

LLVM IR (-O2):
%struct.YsGLSL3DRenderer = type { i32 }
define %struct.YsGLSL3DRenderer* @YsGLSLCreateMonoColorPerVtxShadingWithTexCoord3DRenderer() {
%1 = tail call %struct.YsGLSL3DRenderer* (...) @YsGLSLCreateVariColorPerVtxShading3DRenderer()
ret %struct.YsGLSL3DRenderer* %1
}