xunge/DecIR huggingface dataset:
/* 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, int whence, off_t offset, off_t len) {
  struct flock lock;
  lock.l_type = type;
  lock.l_whence = whence;
  lock.l_start = offset;
  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    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x38(%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    %ecx,0x4(%rsp)
mov    %r8,0x10(%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, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca %struct.flock
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8* %4, i8** %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 i32, i32* %10
%17 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 1
store i32 %16, i32* %17
%18 = load i8*, i8** %11
%19 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 3
store i8* %18, i8** %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, i32 %3, i8* %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 1
store i32 %3, i32* %10
%11 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 3
store i8* %4, i8** %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
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double currentime(void) {
  double res = 0;
  struct timeval tv;
  if (!gettimeofday(&tv, 0))
    res = 1e-6 * tv.tv_usec, res += tv.tv_sec;
  return res;
}


x86 assembly (clang, -O0):
<currentime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%eax
jne    115a <currentime+0x4a>
cvtsi2sdl -0x18(%rbp),%xmm1
movsd  0xebf(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<currentime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
xorps  %xmm0,%xmm0
test   %eax,%eax
je     112c <currentime+0x1c>
add    $0x18,%rsp
ret
cvtsi2sdl 0x8(%rsp),%xmm1
mulsd  0xec6(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdq 0x10(%rsp),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define double @currentime() {
%1 = alloca double
%2 = alloca %struct.timeval
store double 0.000000e+00, double* %1
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%4 = icmp ne i32 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fmul double 0x3EB0C6F7A0B5ED8D, %8
store double %9, double* %1
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to double
%13 = load double, double* %1
%14 = fadd double %13, %12
store double %14, double* %1
br label %15
15: ; preds = %5, %0
%16 = load double, double* %1
ret double %16
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define double @currentime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fmul double %8, 0x3EB0C6F7A0B5ED8D
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to double
%13 = fadd double %9, %12
br label %14
14: ; preds = %5, %0
%15 = phi double [ 0.000000e+00, %0 ], [ %13, %5 ]
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int logint(int l) {
  unsigned int v;
  unsigned r = 0;
  if (l < 0) {
    printf("Sorry, positive only\n");
    exit(-1);
  }
  v = l;
  while (v >>= 1) {
    r++;
  }
  return (r);
}


x86 assembly (clang, -O0):
<logint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1152 <logint+0x32>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1178 <logint+0x58>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1158 <logint+0x38>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logint>:
test   %edi,%edi
js     113d <logint+0x1d>
xor    %eax,%eax
cmp    $0x2,%edi
jb     113c <logint+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nop
shr    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1130 <logint+0x10>
ret
push   %rax
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Sorry, positive only\0A\00"
define i32 @logint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 -1)
unreachable
10: ; preds = %1
%11 = load i32, i32* %2
store i32 %11, i32* %3
br label %12
12: ; preds = %16, %10
%13 = load i32, i32* %3
%14 = lshr i32 %13, 1
store i32 %14, i32* %3
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i32, i32* %4
%18 = add i32 %17, 1
store i32 %18, i32* %4
br label %12
19: ; preds = %12
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@str = [21 x i8] c"Sorry, positive only\00"
define i32 @logint(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 2
br i1 %4, label %14, label %8
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %3, %8
%9 = phi i32 [ %12, %8 ], [ 0, %3 ]
%10 = phi i32 [ %11, %8 ], [ %0, %3 ]
%11 = lshr i32 %10, 1
%12 = add nuw nsw i32 %9, 1
%13 = icmp ult i32 %10, 4
br i1 %13, label %14, label %8
14: ; preds = %8, %3
%15 = phi i32 [ 0, %3 ], [ %12, %8 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __ioctl(int fd, unsigned long int request, ...) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__ioctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ioctl>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__ioctl(i32 %0, i64 %1, ...) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__ioctl(i32 %0, i64 %1, ...) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
void set(volatile unsigned char *reg, unsigned char flag) {
  unsigned char tmp = *reg;
  *reg = tmp | flag;
}


x86 assembly (clang, -O0):
<set>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set>:
or     %sil,(%rdi)
ret

LLVM IR (-O0):
define void @set(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = load volatile i8, i8* %6
store i8 %7, i8* %5
%8 = load i8, i8* %5
%9 = zext i8 %8 to i32
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
%12 = or i32 %9, %11
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
store volatile i8 %13, i8* %14
ret void
}

LLVM IR (-O2):
define void @set(i8* %0, i8 zeroext %1) {
%3 = load volatile i8, i8* %0
%4 = or i8 %3, %1
store volatile i8 %4, i8* %0
ret void
}
void bfq_bfqq_move(struct bfq_data *bfqd, struct bfq_queue *bfqq,
                   struct bfq_group *bfqg) {}


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

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

LLVM IR (-O0):
%struct.bfq_data = type opaque
%struct.bfq_queue = type opaque
%struct.bfq_group = type opaque
define void @bfq_bfqq_move(%struct.bfq_data* %0, %struct.bfq_queue* %1, %struct.bfq_group* %2) {
%4 = alloca %struct.bfq_data*
%5 = alloca %struct.bfq_queue*
%6 = alloca %struct.bfq_group*
store %struct.bfq_data* %0, %struct.bfq_data** %4
store %struct.bfq_queue* %1, %struct.bfq_queue** %5
store %struct.bfq_group* %2, %struct.bfq_group** %6
ret void
}

LLVM IR (-O2):
%struct.bfq_data = type opaque
%struct.bfq_queue = type opaque
%struct.bfq_group = type opaque
define void @bfq_bfqq_move(%struct.bfq_data* nocapture %0, %struct.bfq_queue* nocapture %1, %struct.bfq_group* nocapture %2) {
ret void
}
int FBTest_DisplayImage(int nPmemFd, int nOffset) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @FBTest_DisplayImage(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char **, char *, char *);
void print_addr_v2(char *pa) {
  printf("&pa: %p, &(pa[0]): %p, &(pa[1]): %p\n", &pa, &(pa[0]), &pa[1]);
}


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

x86 assembly (clang, -O2):
<print_addr_v2>:
push   %rax
mov    %rdi,%rdx
mov    %rdi,(%rsp)
lea    0x1(%rdi),%rcx
lea    0xedd(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [37 x i8] c"&pa: %p, &(pa[0]): %p, &(pa[1]): %p\0A\00"
define void @print_addr_v2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8** %2, i8* %0, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("\n Hello World!"); }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"\0A Hello World!\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned char fgetc(int /*<<< orphan*/ *);
unsigned long read_variable_length_quantity(FILE *in) {
  unsigned char b;
  unsigned long value = 0;
  do {
    b = fgetc(in);
    value = (value << 7) | (b & 0x7F);
  } while ((b & 0x80) == 0x80);
  return value;
}


x86 assembly (clang, -O0):
<read_variable_length_quantity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x9(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x7,%rax
movzbl -0x9(%rbp),%ecx
and    $0x7f,%ecx
movslq %ecx,%rcx
or     %rcx,%rax
mov    %rax,-0x18(%rbp)
movzbl -0x9(%rbp),%eax
and    $0x80,%eax
cmp    $0x80,%eax
je     1124 <read_variable_length_quantity+0x14>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_variable_length_quantity>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <fgetc@plt>
mov    %rbx,%rcx
shl    $0x7,%rcx
movzbl %al,%eax
mov    %eax,%ebx
and    $0x7f,%ebx
or     %rcx,%rbx
test   $0x80,%al
jne    1120 <read_variable_length_quantity+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @read_variable_length_quantity(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
%4 = alloca i64
store i32* %0, i32** %2
store i64 0, i64* %4
br label %5
5: ; preds = %15, %1
%6 = load i32*, i32** %2
%7 = call zeroext i8 @fgetc(i32* %6)
store i8 %7, i8* %3
%8 = load i64, i64* %4
%9 = shl i64 %8, 7
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = and i32 %11, 127
%13 = sext i32 %12 to i64
%14 = or i64 %9, %13
store i64 %14, i64* %4
br label %15
15: ; preds = %5
%16 = load i8, i8* %3
%17 = zext i8 %16 to i32
%18 = and i32 %17, 128
%19 = icmp eq i32 %18, 128
br i1 %19, label %5, label %20
20: ; preds = %15
%21 = load i64, i64* %4
ret i64 %21
}

LLVM IR (-O2):
define i64 @read_variable_length_quantity(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %9, %2 ]
%4 = tail call zeroext i8 @fgetc(i32* %0)
%5 = shl i64 %3, 7
%6 = zext i8 %4 to i32
%7 = and i32 %6, 127
%8 = zext i32 %7 to i64
%9 = or i64 %5, %8
%10 = and i32 %6, 128
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %2
12: ; preds = %2
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int main(int argc, char const *argv[]) {
  while (*argv[0] && argc)
    ft_putchar(*argv[0]++);
  ft_putchar('\n');
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1148 <main+0x38>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1158 <main+0x48>
jmp    1176 <main+0x66>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movsbl (%rax),%edi
call   1030 <ft_putchar@plt>
jmp    1126 <main+0x16>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
test   %edi,%edi
je     1139 <main+0x29>
mov    %rsi,%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%rax
cmpb   $0x0,(%rax)
je     1139 <main+0x29>
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl (%rax),%edi
call   1030 <ft_putchar@plt>
jmp    1120 <main+0x10>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp ne i32 %0, 0
%4 = load i8*, i8** %1
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
%7 = and i1 %3, %6
br i1 %7, label %8, label %16
8: ; preds = %2, %8
%9 = phi i8* [ %13, %8 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %1
%11 = load i8, i8* %9
%12 = tail call i32 @ft_putchar(i8 signext %11)
%13 = load i8*, i8** %1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %8
16: ; preds = %8, %2
%17 = tail call i32 @ft_putchar(i8 signext 10)
ret i32 0
}
void linkedlist_init_openmp(void) { return; }


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

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

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

LLVM IR (-O2):
define void @linkedlist_init_openmp() {
ret void
}
/* Variables and functions */
int INT_MAX;
int clamp(unsigned long a) {
  return a < (unsigned long)INT_MAX ? (int)a : INT_MAX;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ed5(%rip),%rcx
movslq (%rcx),%rcx
cmp    %rcx,%rax
jae    112b <clamp+0x2b>
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
jmp    1137 <clamp+0x37>
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
mov    %rdi,%rax
mov    0x2ede(%rip),%rcx
movslq (%rcx),%rcx
cmp    %rdi,%rcx
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @clamp(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i32, i32* @INT_MAX
%5 = sext i32 %4 to i64
%6 = icmp ult i64 %3, %5
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = trunc i64 %8 to i32
br label %12
10: ; preds = %1
%11 = load i32, i32* @INT_MAX
br label %12
12: ; preds = %10, %7
%13 = phi i32 [ %9, %7 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @clamp(i64 %0) {
%2 = load i32, i32* @INT_MAX
%3 = sext i32 %2 to i64
%4 = icmp ugt i64 %3, %0
%5 = trunc i64 %0 to i32
%6 = select i1 %4, i32 %5, i32 %2
ret i32 %6
}
/* Variables and functions */
scalar_t__ Pstring_maybe(char const *);
int /*<<< orphan*/ Psyntax(char const *);
void Pstring(const char *string, const char *emsg) {
  if (Pstring_maybe(string))
    return;
  Psyntax(emsg);
}


x86 assembly (clang, -O0):
<Pstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <Pstring_maybe@plt>
cmp    $0x0,%rax
je     1148 <Pstring+0x28>
jmp    1151 <Pstring+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <Psyntax@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pstring>:
push   %rbx
mov    %rsi,%rbx
call   1040 <Pstring_maybe@plt>
test   %rax,%rax
je     1130 <Pstring+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <Psyntax@plt>

LLVM IR (-O0):
define void @Pstring(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 = call i64 @Pstring_maybe(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i32 @Psyntax(i8* %10)
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @Pstring(i8* %0, i8* %1) {
%3 = tail call i64 @Pstring_maybe(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @Psyntax(i8* %1)
br label %7
7: ; preds = %2, %5
ret void
}
void Render_PutDataWordNULL(int HorizontalCount, unsigned long GraphicsWord,
                            int Line) {}


x86 assembly (clang, -O0):
<Render_PutDataWordNULL>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @Render_PutDataWordNULL(i32 %0, i64 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MyThreadExit();
int /*<<< orphan*/ printf(char *);
void t1(void *dummy) {
  printf("t1 start\n");
  MyThreadExit();
  printf("t1 did not exit");
}


x86 assembly (clang, -O0):
<t1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <MyThreadExit@plt>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <MyThreadExit@plt>
lea    0xeb5(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"t1 start\0A\00"
@.str.1 = [16 x i8] c"t1 did not exit\00"
define void @t1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @MyThreadExit()
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [16 x i8] c"t1 did not exit\00"
@str = [9 x i8] c"t1 start\00"
define void @t1(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @MyThreadExit()
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpc_key_press(int);
int /*<<< orphan*/ cpc_key_unpress(int);
void Joy_Beta_Down(int value) {
  if (value) {
    cpc_key_press(0x61);
  } else {
    cpc_key_unpress(0x61);
  };
}


x86 assembly (clang, -O0):
<Joy_Beta_Down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <Joy_Beta_Down+0x24>
mov    $0x61,%edi
call   1030 <cpc_key_press@plt>
jmp    114e <Joy_Beta_Down+0x2e>
mov    $0x61,%edi
call   1040 <cpc_key_unpress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Joy_Beta_Down>:
test   %edi,%edi
je     112e <Joy_Beta_Down+0xe>
mov    $0x61,%edi
jmp    1030 <cpc_key_press@plt>
mov    $0x61,%edi
jmp    1040 <cpc_key_unpress@plt>

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

LLVM IR (-O2):
define void @Joy_Beta_Down(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cpc_key_press(i32 97)
br label %7
5: ; preds = %1
%6 = tail call i32 @cpc_key_unpress(i32 97)
br label %7
7: ; preds = %5, %3
ret void
}
int ld_ble_rc1(long double a1) { return (__builtin_islessequal(a1, 100)); }


x86 assembly (clang, -O0):
<ld_ble_rc1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_ble_rc1>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setae  %al
ret

LLVM IR (-O0):
define i32 @ld_ble_rc1(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp ole x86_fp80 %3, 0xK4005C800000000000000
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ld_ble_rc1(x86_fp80 %0) {
%2 = fcmp ole x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ llib_sys_getpid();
scalar_t__ llib_sys_kill(int /*<<< orphan*/, int);
__attribute__((unused)) int raise(int sig) {
  return llib_sys_kill(llib_sys_getpid(), sig) ? 0 : -1;
}


x86 assembly (clang, -O0):
<raise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <llib_sys_getpid@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1040 <llib_sys_kill@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raise>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <llib_sys_getpid@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <llib_sys_kill@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @raise(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @llib_sys_getpid()
%4 = load i32, i32* %2
%5 = call i64 @llib_sys_kill(i32 %3, i32 %4)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 0, i32 -1
ret i32 %8
}

LLVM IR (-O2):
define i32 @raise(i32 %0) {
%2 = tail call i32 (...) @llib_sys_getpid()
%3 = tail call i64 @llib_sys_kill(i32 %2, i32 %0)
%4 = icmp eq i64 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memory_exhausted();
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t size) {
  ptr = realloc(ptr, size);
  if (!ptr)
    memory_exhausted();
  return ptr;
}


x86 assembly (clang, -O0):
<xrealloc>:
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   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1153 <xrealloc+0x33>
mov    $0x0,%al
call   1030 <memory_exhausted@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xrealloc+0x15>
xor    %eax,%eax
call   1030 <memory_exhausted@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @memory_exhausted()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ fenv_t;

/* Variables and functions */
int feupdateenv(const fenv_t *envp) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @feupdateenv(i32* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
main() {
  int c;
  while ((c = getchar()) != EOF) {
    if (c == ' ')
      putchar('\n');
    else
      putchar(c);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     116e <main+0x4e>
cmpl   $0x20,-0x8(%rbp)
jne    1161 <main+0x41>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1169 <main+0x49>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb7(%rip),%rbx
cmp    (%rbx),%eax
je     1158 <main+0x38>
mov    $0xa,%ebp
nopw   0x0(%rax,%rax,1)
cmp    $0x20,%eax
cmove  %ebp,%eax
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %12, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %9, %4 ], [ %1, %0 ]
%6 = icmp eq i32 %5, 32
%7 = select i1 %6, i32 10, i32 %5
%8 = tail call i32 @putchar(i32 %7)
%9 = tail call i32 (...) @getchar()
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %4
12: ; preds = %4, %0
ret i32 0
}
int isgraph(int c) { return ((((unsigned)c) > ' ') && (((unsigned)c) <= '~')); }


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jbe    1120 <isgraph+0x20>
cmpl   $0x7e,-0x4(%rbp)
setbe  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
add    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0x5e,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isgraph(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ugt i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp ule i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
int main(void) {
  char c1 = 0, c2 = 1;
  char *c_ptr;
  char **c_pptr;
  c_ptr = &c1;
  *c_ptr = c2;
  c_ptr = &c2;
  *c_ptr = 0;
  c_pptr = &c_ptr;
  *c_pptr = &c1;
  **c_pptr = 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movb   $0x1,-0x6(%rbp)
lea    -0x5(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x6(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
lea    -0x6(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
lea    -0x5(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movb   $0x1,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
unsigned char randomByte();
void randomBlob(int nBuf, unsigned char *zBuf) {
  int i;
  for (i = 0; i < nBuf; i++) {
    zBuf[i] = randomByte();
  }
}


x86 assembly (clang, -O0):
<randomBlob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1154 <randomBlob+0x44>
mov    $0x0,%al
call   1030 <randomByte@plt>
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <randomBlob+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomBlob>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1144 <randomBlob+0x34>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <randomByte@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <randomBlob+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @randomBlob(i32 %0, i8* nocapture writeonly %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = tail call zeroext i8 (...) @randomByte()
%9 = getelementptr inbounds i8, i8* %1, i64 %7
store i8 %8, i8* %9
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
float erff(float);
float erfcf(float x) { return 1.f - erff(x); }


x86 assembly (clang, -O0):
<erfcf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <erff@plt>
movaps %xmm0,%xmm1
movss  0xece(%rip),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erfcf>:
push   %rax
call   1030 <erff@plt>
movss  0xee2(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @erfcf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @erff(float %3)
%5 = fsub float 1.000000e+00, %4
ret float %5
}

LLVM IR (-O2):
define float @erfcf(float %0) {
%2 = tail call float @erff(float %0)
%3 = fsub float 1.000000e+00, %2
ret float %3
}
char sd_script_frame_to_letter(int frame_id) { return (char)(frame_id + 'A'); }


x86 assembly (clang, -O0):
<sd_script_frame_to_letter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x41,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_script_frame_to_letter>:
lea    0x41(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @sd_script_frame_to_letter(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 65
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @sd_script_frame_to_letter(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 65
ret i8 %3
}
/* Variables and functions */
const char *find_last_char(const char *b, const char *e, char c) {
  for (; e > b; e--)
    if (*e == c)
      return e;
  return NULL;
}


x86 assembly (clang, -O0):
<find_last_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1155 <find_last_char+0x55>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
jne    113f <find_last_char+0x3f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115d <find_last_char+0x5d>
jmp    1144 <find_last_char+0x44>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1111 <find_last_char+0x11>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_last_char>:
cmp    %rdi,%rsi
jbe    111d <find_last_char+0x1d>
mov    %rsi,%rax
nopl   0x0(%rax,%rax,1)
cmp    %dl,(%rax)
je     111f <find_last_char+0x1f>
add    $0xffffffffffffffff,%rax
cmp    %rdi,%rax
ja     1110 <find_last_char+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @find_last_char(i8* readnone %0, i8* %1, i8 signext %2) {
%4 = icmp ugt i8* %1, %0
br i1 %4, label %5, label %12
5: ; preds = %3, %9
%6 = phi i8* [ %10, %9 ], [ %1, %3 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, %2
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %6, i64 -1
%11 = icmp ugt i8* %10, %0
br i1 %11, label %5, label %12
12: ; preds = %5, %9, %3
%13 = phi i8* [ null, %3 ], [ null, %9 ], [ %6, %5 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ cleanUpAndFail(int);
void crcError(unsigned int crcStored, unsigned int crcComputed) {
  cleanUpAndFail(2);
}


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

x86 assembly (clang, -O2):
<crcError>:
mov    $0x2,%edi
jmp    1030 <cleanUpAndFail@plt>

LLVM IR (-O0):
define void @crcError(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @cleanUpAndFail(i32 2)
ret void
}

LLVM IR (-O2):
define void @crcError(i32 %0, i32 %1) {
%3 = tail call i32 @cleanUpAndFail(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ plugin_config_end();
int /*<<< orphan*/ plugin_config_write();
int /*<<< orphan*/ plugin_unload_all();
void plugin_end() {
  plugin_config_write();
  plugin_unload_all();
  plugin_config_end();
}


x86 assembly (clang, -O0):
<plugin_end>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <plugin_config_write@plt>
mov    $0x0,%al
call   1050 <plugin_unload_all@plt>
mov    $0x0,%al
call   1030 <plugin_config_end@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_end>:
push   %rax
xor    %eax,%eax
call   1040 <plugin_config_write@plt>
xor    %eax,%eax
call   1050 <plugin_unload_all@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <plugin_config_end@plt>

LLVM IR (-O0):
define void @plugin_end() {
%1 = call i32 (...) @plugin_config_write()
%2 = call i32 (...) @plugin_unload_all()
%3 = call i32 (...) @plugin_config_end()
ret void
}

LLVM IR (-O2):
define void @plugin_end() {
%1 = tail call i32 (...) @plugin_config_write()
%2 = tail call i32 (...) @plugin_unload_all()
%3 = tail call i32 (...) @plugin_config_end()
ret void
}
void sgg_runtask(const int task, const int local) {
  static struct {
    int cmd, opt, data[4];
    int eoc;
  } command = {0x0020, 0x80000000 + 4, 0x1243, 0x010c, 0, 0, 0x0000};
  command.data[2] = task;
  command.data[3] = local;
  sgg_execcmd(&command);
  return;
}


x86 assembly (clang, -O0):
<sgg_runtask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,0x2f11(%rip)
mov    -0x8(%rbp),%eax
mov    %eax,0x2f0c(%rip)
lea    0x2ef1(%rip),%rdi
mov    $0x0,%al
call   1030 <sgg_execcmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgg_runtask>:
mov    %edi,0x2f22(%rip)
lea    0x2f0b(%rip),%rdi
mov    %esi,0x2f19(%rip)
xor    %eax,%eax
jmp    1030 <sgg_execcmd@plt>

LLVM IR (-O0):
%struct.anon = type { i32, i32, [4 x i32], i32 }
@sgg_runtask.command = internal global %struct.anon { i32 32, i32 -2147483644, [4 x i32] [i32 4675, i32 268, i32 0, i32 0], i32 0 }
define void @sgg_runtask(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
store i32 %5, i32* getelementptr inbounds (%struct.anon, %struct.anon* @sgg_runtask.command, i32 0, i32 2, i64 2)
%6 = load i32, i32* %4
store i32 %6, i32* getelementptr inbounds (%struct.anon, %struct.anon* @sgg_runtask.command, i32 0, i32 2, i64 3)
%7 = call i32 (%struct.anon*, ...) bitcast (i32 (...)* @sgg_execcmd to i32 (%struct.anon*, ...)*)(%struct.anon* @sgg_runtask.command)
ret void
}

LLVM IR (-O2):
%struct.anon = type { i32, i32, [4 x i32], i32 }
@sgg_runtask.command = internal global %struct.anon { i32 32, i32 -2147483644, [4 x i32] [i32 4675, i32 268, i32 0, i32 0], i32 0 }
define void @sgg_runtask(i32 %0, i32 %1) {
store i32 %0, i32* getelementptr inbounds (%struct.anon, %struct.anon* @sgg_runtask.command, i64 0, i32 2, i64 2)
store i32 %1, i32* getelementptr inbounds (%struct.anon, %struct.anon* @sgg_runtask.command, i64 0, i32 2, i64 3)
%3 = tail call i32 (%struct.anon*, ...) bitcast (i32 (...)* @sgg_execcmd to i32 (%struct.anon*, ...)*)(%struct.anon* @sgg_runtask.command)
ret void
}
/* Type definitions */
typedef scalar_t__ uid_t;

/* Variables and functions */
scalar_t__ geteuid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  uid_t id;
  id = geteuid();
  printf("%d\n", (int)id);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <geteuid@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xeb9(%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 <geteuid@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() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 (...) @geteuid()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%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() {
%1 = tail call i64 (...) @geteuid()
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int _inb(int);
void __vga13_vsync(void) {
  while (_inb(0x3DA) & 0b100) {
  };
  while (!(_inb(0x3DA) & 0b100)) {
  };
}


x86 assembly (clang, -O0):
<__vga13_vsync>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <__vga13_vsync+0x9>
mov    $0x3da,%edi
call   1030 <_inb@plt>
and    $0x4,%eax
cmp    $0x0,%eax
je     1134 <__vga13_vsync+0x24>
jmp    1119 <__vga13_vsync+0x9>
jmp    1139 <__vga13_vsync+0x29>
mov    $0x3da,%edi
call   1030 <_inb@plt>
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115b <__vga13_vsync+0x4b>
jmp    1160 <__vga13_vsync+0x50>
jmp    1139 <__vga13_vsync+0x29>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__vga13_vsync>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3da,%edi
call   1030 <_inb@plt>
test   $0x4,%al
jne    1120 <__vga13_vsync+0x10>
xchg   %ax,%ax
mov    $0x3da,%edi
call   1030 <_inb@plt>
test   $0x4,%al
je     1130 <__vga13_vsync+0x20>
pop    %rax
ret

LLVM IR (-O0):
define void @__vga13_vsync() {
br label %1
1: ; preds = %5, %0
%2 = call i32 @_inb(i32 986)
%3 = and i32 %2, 4
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
br label %7
7: ; preds = %12, %6
%8 = call i32 @_inb(i32 986)
%9 = and i32 %8, 4
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br i1 %11, label %12, label %13
12: ; preds = %7
br label %7
13: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @__vga13_vsync() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @_inb(i32 986)
%3 = and i32 %2, 4
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1, %5
%6 = tail call i32 @_inb(i32 986)
%7 = and i32 %6, 4
%8 = icmp eq i32 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5
ret void
}