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

/* Variables and functions */
int /*<<< orphan*/ __NR_perf_event_open;
int syscall(int /*<<< orphan*/, struct perf_event_attr *, int /*<<< orphan*/,
            int, int, unsigned long);
int perf_event_open(struct perf_event_attr *hw, pid_t pid, int cpu, int grp,
                    unsigned long flags) {
  return syscall(__NR_perf_event_open, hw, pid, cpu, grp, flags);
}


x86 assembly (clang, -O0):
<perf_event_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perf_event_open>:
mov    %r8,%r9
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.perf_event_attr = type { i32 }
@__NR_perf_event_open = global i32 0
define i32 @perf_event_open(%struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4) {
%6 = alloca %struct.perf_event_attr*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
store %struct.perf_event_attr* %0, %struct.perf_event_attr** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i64 %4, i64* %10
%11 = load i32, i32* @__NR_perf_event_open
%12 = load %struct.perf_event_attr*, %struct.perf_event_attr** %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i64, i64* %10
%17 = call i32 @syscall(i32 %11, %struct.perf_event_attr* %12, i32 %13, i32 %14, i32 %15, i64 %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.perf_event_attr = type { i32 }
@__NR_perf_event_open = global i32 0
define i32 @perf_event_open(%struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4) {
%6 = load i32, i32* @__NR_perf_event_open
%7 = tail call i32 @syscall(i32 %6, %struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4)
ret i32 %7
}
_Complex double test_ccos(_Complex double x) { return __builtin_ccos(x); }


x86 assembly (clang, -O0):
<test_ccos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  %xmm1,-0x30(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1030 <ccos@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ccos>:
jmp    1030 <ccos@plt>

LLVM IR (-O0):
define { double, double } @test_ccos(double %0, double %1) {
%3 = alloca { double, double }
%4 = alloca { double, double }
%5 = alloca { double, double }
%6 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
store double %0, double* %6
%7 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %1, double* %7
%8 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%9 = load double, double* %8
%10 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
%11 = load double, double* %10
%12 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%13 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
store double %9, double* %12
store double %11, double* %13
%14 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%15 = load double, double* %14
%16 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
%17 = load double, double* %16
%18 = call { double, double } @ccos(double %15, double %17)
%19 = extractvalue { double, double } %18, 0
%20 = extractvalue { double, double } %18, 1
%21 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%22 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %19, double* %21
store double %20, double* %22
%23 = load { double, double }, { double, double }* %3
ret { double, double } %23
}

LLVM IR (-O2):
define { double, double } @test_ccos(double %0, double %1) {
%3 = tail call { double, double } @ccos(double %0, double %1)
ret { double, double } %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void print_asi(void) {
  static int i = 0;
  printf("(%d)", i++);
  if (i >= 255)
    i = 0;
}


x86 assembly (clang, -O0):
<print_asi>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f12(%rip),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,0x2f07(%rip)
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0xff,0x2ef1(%rip)
jl     114b <print_asi+0x3b>
movl   $0x0,0x2ee1(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_asi>:
push   %rax
mov    0x2f15(%rip),%esi
lea    0x1(%rsi),%eax
mov    %eax,0x2f0c(%rip)
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0xff,0x2ef6(%rip)
jl     1142 <print_asi+0x32>
movl   $0x0,0x2eea(%rip)
pop    %rax
ret

LLVM IR (-O0):
@print_asi.i = internal global i32 0
@.str = [5 x i8] c"(%d)\00"
define void @print_asi() {
%1 = load i32, i32* @print_asi.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @print_asi.i
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = load i32, i32* @print_asi.i
%5 = icmp sge i32 %4, 255
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* @print_asi.i
br label %7
7: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@print_asi.i = internal unnamed_addr global i32 0
@.str = [5 x i8] c"(%d)\00"
define void @print_asi() {
%1 = load i32, i32* @print_asi.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @print_asi.i
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = load i32, i32* @print_asi.i
%5 = icmp sgt i32 %4, 254
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* @print_asi.i
br label %7
7: ; preds = %6, %0
ret void
}
char *strdup(const char *s) {
  char *ret;
  int i = 0;
  for (i = 0; s[i]; i++)
    ret[i] = s[i];
  ret[i] = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     114c <strdup+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%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    1116 <strdup+0x16>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O2):
void g_trash_stack_pop() {}


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

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

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

LLVM IR (-O2):
define void @g_trash_stack_pop() {
ret void
}
/* Variables and functions */
void unimpl(char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @unimpl(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
void *_talloc_named_const(void const *, size_t, char const *);
int /*<<< orphan*/ lock();
int /*<<< orphan*/ unlock();
void *talloc_named_const(const void *context, size_t size, const char *name) {
  void *p;
  lock();
  p = _talloc_named_const(context, size, name);
  unlock();
  return p;
}


x86 assembly (clang, -O0):
<talloc_named_const>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <lock@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <_talloc_named_const@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <unlock@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<talloc_named_const>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <lock@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1050 <_talloc_named_const@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <unlock@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @talloc_named_const(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = call i32 (...) @lock()
%9 = load i8*, i8** %4
%10 = load i64, i64* %5
%11 = load i8*, i8** %6
%12 = call i8* @_talloc_named_const(i8* %9, i64 %10, i8* %11)
store i8* %12, i8** %7
%13 = call i32 (...) @unlock()
%14 = load i8*, i8** %7
ret i8* %14
}

LLVM IR (-O2):
define i8* @talloc_named_const(i8* %0, i64 %1, i8* %2) {
%4 = tail call i32 (...) @lock()
%5 = tail call i8* @_talloc_named_const(i8* %0, i64 %1, i8* %2)
%6 = tail call i32 (...) @unlock()
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, long);
int sscanf(char const *, char *, long *);
long copy_binary(FILE *to, FILE *from, const char *line) {
  long count;
  if (sscanf(line + 14, "%ld", &count) == 1)
    fcpy(to, from, count);
  else
    count = 0;
  return count;
}


x86 assembly (clang, -O0):
<copy_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0xe,%rdi
lea    0xebd(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    116b <copy_binary+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <fcpy@plt>
jmp    1173 <copy_binary+0x53>
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_binary>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xe(%rdx),%rdi
lea    0xecb(%rip),%rsi
mov    %rsp,%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    1157 <copy_binary+0x37>
mov    (%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <fcpy@plt>
mov    (%rsp),%rax
jmp    1159 <copy_binary+0x39>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i64 @copy_binary(i32* %0, i32* %1, i8* nocapture %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
%6 = getelementptr inbounds i8, i8* %2, i64 14
%7 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %4)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i64, i64* %4
%11 = call i32 @fcpy(i32* %0, i32* %1, i64 %10)
%12 = load i64, i64* %4
br label %13
13: ; preds = %3, %9
%14 = phi i64 [ %12, %9 ], [ 0, %3 ]
ret i64 %14
}
unsigned xrop3_91_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S | D;
  stk3 = ~stk3;
  stk2 = T | stk3;
  stk1 = D ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_91_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_91_0_0>:
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
not    %edi
shl    $0x8,%edi
or     %edi,%eax
xor    $0xff,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_91_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = xor i32 %26, -1
store i32 %27, i32* %10
%28 = load i32, i32* %7
%29 = load i32, i32* %10
%30 = or i32 %28, %29
store i32 %30, i32* %9
%31 = load i32, i32* %5
%32 = load i32, i32* %9
%33 = xor i32 %31, %32
store i32 %33, i32* %8
%34 = load i32, i32* %8
ret i32 %34
}

LLVM IR (-O2):
define i32 @xrop3_91_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = mul nuw nsw i32 %4, 257
%6 = xor i32 %3, -1
%7 = shl nsw i32 %6, 8
%8 = or i32 %5, %7
%9 = xor i32 %8, 255
ret i32 %9
}
void myvm_getlit(int n, struct myvm_vm *vm) {}


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

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

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

LLVM IR (-O2):
%struct.myvm_vm = type opaque
define void @myvm_getlit(i32 %0, %struct.myvm_vm* nocapture %1) {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long time;
};
struct TYPE_4__ {
  TYPE_1__ xcrossing;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xcrossing_time(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xcrossing.time = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xcrossing_time(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xcrossing_time(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
int HelpItem51(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem51() {
ret i32 0
}
int transform_int(const int in) { return 23 * in; }


x86 assembly (clang, -O0):
<transform_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x17,-0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<transform_int>:
lea    (%rdi,%rdi,2),%eax
shl    $0x3,%eax
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @transform_int(i32 %0) {
%2 = mul nsw i32 %0, 23
ret i32 %2
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double getTime() {
  struct timeval t;
  int rc = gettimeofday(&t, NULL);
  assert(rc == 0);
  return (double)t.tv_sec + (double)t.tv_usec / 1e6;
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xea3(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xead(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @getTime() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%12 = load i64, i64* %11
%13 = sitofp i64 %12 to double
%14 = fdiv double %13, 1.000000e+06
%15 = fadd double %10, %14
ret double %15
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @getTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to double
%13 = fdiv double %12, 1.000000e+06
%14 = fadd double %13, %9
ret double %14
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int next_standard_solution(int k) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc(506, &k, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<next_standard_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1fa,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_standard_solution>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1fa,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @next_standard_solution(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 506, i32* %2, i32* undef, double* undef)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ byteswap2(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char const *, int);
uint16_t sas_read2(const char *data, int bswap) {
  uint16_t tmp;
  memcpy(&tmp, data, 2);
  return bswap ? byteswap2(tmp) : tmp;
}


x86 assembly (clang, -O0):
<sas_read2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
mov    $0x2,%edx
call   1040 <memcpy@plt>
cmpl   $0x0,-0xc(%rbp)
je     115b <sas_read2+0x3b>
mov    -0x10(%rbp),%edi
call   1030 <byteswap2@plt>
mov    %eax,-0x14(%rbp)
jmp    1161 <sas_read2+0x41>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sas_read2>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xc(%rsp),%rdi
mov    $0x2,%edx
call   1040 <memcpy@plt>
mov    0xc(%rsp),%eax
test   %ebx,%ebx
je     1148 <sas_read2+0x28>
mov    %eax,%edi
call   1030 <byteswap2@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sas_read2(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @memcpy(i32* %5, i8* %6, i32 2)
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %5
%12 = call i32 @byteswap2(i32 %11)
br label %15
13: ; preds = %2
%14 = load i32, i32* %5
br label %15
15: ; preds = %13, %10
%16 = phi i32 [ %12, %10 ], [ %14, %13 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @sas_read2(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @memcpy(i32* %3, i8* %0, i32 2)
%6 = icmp eq i32 %1, 0
%7 = load i32, i32* %3
br i1 %6, label %10, label %8
8: ; preds = %2
%9 = call i32 @byteswap2(i32 %7)
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ %9, %8 ], [ %7, %2 ]
ret i32 %11
}
void vs6451_start(struct camera_info *caminfo) {}


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

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

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

LLVM IR (-O2):
%struct.camera_info = type opaque
define void @vs6451_start(%struct.camera_info* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ random_double();
float random_float() { return (float)random_double(); }


x86 assembly (clang, -O0):
<random_float>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random_double@plt>
cvtsi2ss %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_float>:
push   %rax
xor    %eax,%eax
call   1030 <random_double@plt>
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @random_float() {
%1 = call i64 (...) @random_double()
%2 = sitofp i64 %1 to float
ret float %2
}

LLVM IR (-O2):
define float @random_float() {
%1 = tail call i64 (...) @random_double()
%2 = sitofp i64 %1 to float
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ LZ4_compressBound(int);
int LZ4_compress_limitedOutput(char const *, char *, int, int /*<<< orphan*/);
int LZ4_compress(const char *source, char *dest, int isize) {
  return LZ4_compress_limitedOutput(source, dest, isize,
                                    LZ4_compressBound(isize));
}


x86 assembly (clang, -O0):
<LZ4_compress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <LZ4_compressBound@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    %eax,%ecx
call   1040 <LZ4_compress_limitedOutput@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_compress>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%edi
call   1030 <LZ4_compressBound@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <LZ4_compress_limitedOutput@plt>

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

LLVM IR (-O2):
define i32 @LZ4_compress(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @LZ4_compressBound(i32 %2)
%5 = tail call i32 @LZ4_compress_limitedOutput(i8* %0, i8* %1, i32 %2, i32 %4)
ret i32 %5
}
/* Variables and functions */
int EOF;
int getchar();
void flushinput() {
  int c;
  while ((c = getchar()) != '\n' && c != EOF)
    ;
}


x86 assembly (clang, -O0):
<flushinput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x5(%rbp)
je     1144 <flushinput+0x34>
mov    -0x4(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1154 <flushinput+0x44>
jmp    1159 <flushinput+0x49>
jmp    1118 <flushinput+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flushinput>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1130 <flushinput+0x20>
cmp    (%rbx),%eax
jne    1120 <flushinput+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @flushinput() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br label %9
9: ; preds = %5, %2
%10 = phi i1 [ false, %2 ], [ %8, %5 ]
br i1 %10, label %11, label %12
11: ; preds = %9
br label %2
12: ; preds = %9
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @flushinput() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp ne i32 %2, 10
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, double);
int main() {
  double nc;
  for (nc = 0; getchar() != EOF; ++nc)
    ;
  printf("NC: %.0f\n", nc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%rax
je     116a <main+0x4a>
jmp    1153 <main+0x33>
movsd  0xea5(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1137 <main+0x17>
movsd  -0x10(%rbp),%xmm0
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb5(%rip),%rbx
xorpd  %xmm0,%xmm0
cmp    (%rbx),%rax
je     1160 <main+0x40>
xorpd  %xmm0,%xmm0
addsd  0xeb8(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1040 <getchar@plt>
movsd  0x8(%rsp),%xmm0
cmp    (%rbx),%rax
jne    1140 <main+0x20>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [10 x i8] c"NC: %.0f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
br label %3
3: ; preds = %8, %0
%4 = call i64 (...) @getchar()
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
br label %8
8: ; preds = %7
%9 = load double, double* %2
%10 = fadd double %9, 1.000000e+00
store double %10, double* %2
br label %3
11: ; preds = %3
%12 = load double, double* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %12)
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [10 x i8] c"NC: %.0f\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi double [ %6, %4 ], [ 0.000000e+00, %0 ]
%6 = fadd double %5, 1.000000e+00
%7 = tail call i64 (...) @getchar()
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
%11 = phi double [ 0.000000e+00, %0 ], [ %6, %4 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %11)
ret i32 0
}
/* Variables and functions */
int ehPar(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int imparPar;
  int num;
  printf("\nEntre com um numero: ");
  scanf("%d", &num);
  imparPar = ehPar(num, imparPar);
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"\0AEntre com um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %1
%7 = call i32 @ehPar(i32 %5, i32 %6)
store i32 %7, i32* %1
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0AEntre com um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @ehPar(i32 %5, i32 undef)
ret i32 0
}
int main(void) { (int)1; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void uart_puts_p(const char *progmem_s) {
  printf("uart_puts_P(%s)\n", progmem_s);
}


x86 assembly (clang, -O0):
<uart_puts_p>:
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):
<uart_puts_p>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"uart_puts_P(%s)\0A\00"
define void @uart_puts_p(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void closesocket(int s) { close(s); }


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

x86 assembly (clang, -O2):
<closesocket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @closesocket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
int h(int b) { return (b >> 30) >> 30; }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1e,%eax
sar    $0x1e,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
mov    %edi,%eax
sar    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @h(i32 %0) {
%2 = ashr i32 %0, 31
ret i32 %2
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int do_signalfd(struct tcb *, int);
int sys_signalfd4(struct tcb *tcp) { return do_signalfd(tcp, 3); }


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

x86 assembly (clang, -O2):
<sys_signalfd4>:
mov    $0x3,%esi
jmp    1030 <do_signalfd@plt>

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

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_signalfd4(%struct.tcb* %0) {
%2 = tail call i32 @do_signalfd(%struct.tcb* %0, i32 3)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ hostapi_putc(int);
void put_d(uint8_t byte) {
  hostapi_putc(byte / 100 + '0');
  byte %= 100;
  hostapi_putc(byte / 10 + '0');
  byte %= 10;
  hostapi_putc(byte + '0');
}


x86 assembly (clang, -O0):
<put_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
add    $0x30,%edi
call   1030 <hostapi_putc@plt>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
add    $0x30,%edi
call   1030 <hostapi_putc@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x30,%edi
call   1030 <hostapi_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_d>:
push   %r15
push   %r14
push   %rbx
movslq %edi,%r14
imul   $0x51eb851f,%r14,%rbx
mov    %rbx,%r15
shr    $0x3f,%r15
sar    $0x25,%rbx
lea    (%rbx,%r15,1),%edi
add    $0x30,%edi
call   1030 <hostapi_putc@plt>
add    %r15d,%ebx
imul   $0x64,%ebx,%eax
sub    %eax,%r14d
movsbl %r14b,%eax
imul   $0x67,%eax,%eax
movzwl %ax,%eax
movswl %ax,%ebx
shr    $0xf,%eax
shr    $0xa,%ebx
add    %al,%bl
lea    0x30(%rbx),%eax
movzbl %al,%edi
call   1030 <hostapi_putc@plt>
movzbl %bl,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %al,%r14b
add    $0x30,%r14b
movzbl %r14b,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <hostapi_putc@plt>

LLVM IR (-O0):
define void @put_d(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 100
%5 = add nsw i32 %4, 48
%6 = call i32 @hostapi_putc(i32 %5)
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = sdiv i32 %9, 10
%11 = add nsw i32 %10, 48
%12 = call i32 @hostapi_putc(i32 %11)
%13 = load i32, i32* %2
%14 = srem i32 %13, 10
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 48
%17 = call i32 @hostapi_putc(i32 %16)
ret void
}

LLVM IR (-O2):
define void @put_d(i32 %0) {
%2 = sdiv i32 %0, 100
%3 = add nsw i32 %2, 48
%4 = tail call i32 @hostapi_putc(i32 %3)
%5 = srem i32 %0, 100
%6 = trunc i32 %5 to i8
%7 = sdiv i8 %6, 10
%8 = add nsw i8 %7, 48
%9 = zext i8 %8 to i32
%10 = tail call i32 @hostapi_putc(i32 %9)
%11 = srem i8 %6, 10
%12 = add nsw i8 %11, 48
%13 = zext i8 %12 to i32
%14 = tail call i32 @hostapi_putc(i32 %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int main(void) {
  int *p = malloc(1024 * 1024 * 1024);
  memset(p, 0, 1024 * 1024 * 1024);
  free(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x40000000,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x40000000,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x40000000,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x40000000,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @malloc(i32 1073741824)
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @memset(i32* %4, i32 0, i32 1073741824)
%6 = load i32*, i32** %2
%7 = call i32 @free(i32* %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 1073741824)
%2 = tail call i32 @memset(i32* %1, i32 0, i32 1073741824)
%3 = tail call i32 @free(i32* %1)
ret i32 0
}
/* Variables and functions */
double kbessel(int /*<<< orphan*/, double);
double K0(double x) { return kbessel(0, x); }


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

x86 assembly (clang, -O2):
<K0>:
xor    %edi,%edi
jmp    1030 <kbessel@plt>

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

LLVM IR (-O2):
define double @K0(double %0) {
%2 = tail call double @kbessel(i32 0, double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, C World!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"Hello, C World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int base_to_10(char *str, int base) {
  int sum = 0;
  for (int i = 0; str[i] != 0; i++)
    sum = sum * base + (str[i] - '0');
  return sum;
}


x86 assembly (clang, -O0):
<base_to_10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <base_to_10+0x57>
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <base_to_10+0x19>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base_to_10>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <base_to_10+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
imul   %esi,%eax
add    %ecx,%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <base_to_10+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @base_to_10(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %7, %2
%6 = phi i32 [ 0, %2 ], [ %14, %7 ]
ret i32 %6
7: ; preds = %2, %7
%8 = phi i64 [ %15, %7 ], [ 0, %2 ]
%9 = phi i8 [ %17, %7 ], [ %3, %2 ]
%10 = phi i32 [ %14, %7 ], [ 0, %2 ]
%11 = sext i8 %9 to i32
%12 = mul nsw i32 %10, %1
%13 = add i32 %12, -48
%14 = add i32 %13, %11
%15 = add nuw nsw i64 %8, 1
%16 = getelementptr inbounds i8, i8* %0, i64 %15
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %5, label %7
}
/* Type definitions */
struct lock {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __disable_interrupt();
void lock(struct lock *lock) { __disable_interrupt(); }


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

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

LLVM IR (-O0):
%struct.lock = type { i32 }
define void @lock(%struct.lock* %0) {
%2 = alloca %struct.lock*
store %struct.lock* %0, %struct.lock** %2
%3 = call i32 (...) @__disable_interrupt()
ret void
}

LLVM IR (-O2):
%struct.lock = type { i32 }
define void @lock(%struct.lock* nocapture readnone %0) {
%2 = tail call i32 (...) @__disable_interrupt()
ret void
}
int test_52_4(int *mem) { return __atomic_or_fetch(mem + 0, 1, 4); }


x86 assembly (clang, -O0):
<test_52_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
or     %esi,%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    114b <test_52_4+0x4b>
jmp    1122 <test_52_4+0x22>
mov    -0x18(%rbp),%ecx
mov    -0x24(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_52_4>:
mov    (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
or     $0x1,%ecx
lock cmpxchg %ecx,(%rdi)
jne    1110 <test_52_4+0x10>
or     $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @test_52_4(i32* nocapture %0) {
%2 = atomicrmw or i32* %0, i32 1 acq_rel
%3 = or i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
scalar_t__ isspace(int);
char ungetc(int, int /*<<< orphan*/ *);
void goto_EOF(FILE *inputfile) {
  int whitespace;
  char ctmp;
  do {
    whitespace = fgetc(inputfile);
    if (whitespace == EOF)
      break;
  } while (isspace(whitespace));
  ctmp = ungetc(whitespace, inputfile);
}


x86 assembly (clang, -O0):
<goto_EOF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e96(%rip),%rcx
cmp    (%rcx),%eax
jne    115f <goto_EOF+0x2f>
jmp    1176 <goto_EOF+0x46>
jmp    1164 <goto_EOF+0x34>
mov    -0xc(%rbp),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
jne    113c <goto_EOF+0xc>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1050 <ungetc@plt>
mov    %al,-0xd(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<goto_EOF>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2eaa(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
cmp    (%r14),%eax
je     115b <goto_EOF+0x2b>
mov    %ebp,%edi
call   1040 <isspace@plt>
test   %rax,%rax
jne    1140 <goto_EOF+0x10>
mov    %ebp,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <ungetc@plt>

LLVM IR (-O0):
@EOF = global i32 0
define void @goto_EOF(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i8
store i32* %0, i32** %2
br label %5
5: ; preds = %13, %1
%6 = load i32*, i32** %2
%7 = call i32 @fgetc(i32* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %5
br label %17
12: ; preds = %5
br label %13
13: ; preds = %12
%14 = load i32, i32* %3
%15 = call i64 @isspace(i32 %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %5, label %17
17: ; preds = %13, %11
%18 = load i32, i32* %3
%19 = load i32*, i32** %2
%20 = call signext i8 @ungetc(i32 %18, i32* %19)
store i8 %20, i8* %4
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @goto_EOF(i32* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = tail call i32 @fgetc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i64 @isspace(i32 %3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %2
9: ; preds = %2, %6
%10 = tail call signext i8 @ungetc(i32 %3, i32* %0)
ret void
}