xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
int /*<<< orphan*/ puts(char *);
void *xmemdup(const void *mem, size_t bytes) {
  void *p = malloc(bytes);
  if (!p) {
    puts("Failed: "
         "xmemdup");
    exit(-1);
  }
  memcpy(p, mem, bytes);
  return p;
}


x86 assembly (clang, -O0):
<xmemdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117e <xmemdup+0x3e>
lea    0xe91(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmemdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     1172 <xmemdup+0x32>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe87(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Failed: xmemdup\00"
define i8* @xmemdup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 -1)
unreachable
13: ; preds = %2
%14 = load i8*, i8** %5
%15 = load i8*, i8** %3
%16 = load i64, i64* %4
%17 = call i32 @memcpy(i8* %14, i8* %15, i64 %16)
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@.str = [16 x i8] c"Failed: xmemdup\00"
define i8* @xmemdup(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
%9 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
ret i8* %3
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void CRCSeedSet(uint32_t ui32Base, uint32_t ui32Seed) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000410))) = ui32Seed;
}


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

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

LLVM IR (-O0):
define void @CRCSeedSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 1040
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @CRCSeedSet(i64 %0, i64 %1) {
%3 = add i64 %0, 1040
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
int check_push_cb(void *cb_ctx) {
  int *depth = (int *)cb_ctx;
  if (*depth == -1)
    *depth = 0;
  if (++(*depth) >= 7) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_push_cb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    1127 <check_push_cb+0x27>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rcx
mov    (%rcx),%eax
add    $0x1,%eax
mov    %eax,(%rcx)
cmp    $0x7,%eax
jl     1147 <check_push_cb+0x47>
movl   $0x0,-0x4(%rbp)
jmp    114e <check_push_cb+0x4e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_push_cb>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
cmovne %eax,%ecx
lea    0x1(%rcx),%eax
mov    %eax,(%rdi)
xor    %eax,%eax
cmp    $0x6,%ecx
setl   %al
ret

LLVM IR (-O0):
define i32 @check_push_cb(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32*, i32** %4
store i32 0, i32* %11
br label %12
12: ; preds = %10, %1
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
store i32 %15, i32* %13
%16 = icmp sge i32 %15, 7
br i1 %16, label %17, label %18
17: ; preds = %12
store i32 0, i32* %2
br label %19
18: ; preds = %12
store i32 1, i32* %2
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @check_push_cb(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1
%5 = select i1 %4, i32 0, i32 %3
%6 = add nuw nsw i32 %5, 1
store i32 %6, i32* %2
%7 = icmp slt i32 %5, 6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
long long n_choose_k(int, long long);
long long int catalan(long long int n) {
  long long int i, j, k;
  long long int ans;
  ans = n_choose_k(2 * n, n);
  ans = ans / (n + 1);
  return ans;
}


x86 assembly (clang, -O0):
<catalan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <n_choose_k@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    $0x1,%rcx
cqto
idiv   %rcx
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catalan>:
push   %rbx
mov    %rdi,%rbx
add    %edi,%edi
mov    %rbx,%rsi
call   1030 <n_choose_k@plt>
add    $0x1,%rbx
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     1135 <catalan+0x25>
cqto
idiv   %rbx
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
pop    %rbx
ret

LLVM IR (-O0):
define i64 @catalan(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %2
%7 = load i64, i64* %2
%8 = mul nsw i64 2, %7
%9 = trunc i64 %8 to i32
%10 = load i64, i64* %2
%11 = call i64 @n_choose_k(i32 %9, i64 %10)
store i64 %11, i64* %6
%12 = load i64, i64* %6
%13 = load i64, i64* %2
%14 = add nsw i64 %13, 1
%15 = sdiv i64 %12, %14
store i64 %15, i64* %6
%16 = load i64, i64* %6
ret i64 %16
}

LLVM IR (-O2):
define i64 @catalan(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = shl i32 %2, 1
%4 = tail call i64 @n_choose_k(i32 %3, i64 %0)
%5 = add nsw i64 %0, 1
%6 = sdiv i64 %4, %5
ret i64 %6
}
int reduce(char **in, char op) {
  int i;
  for (i = 0; (*in)[i] == op; i++)
    ;
  *in += i - 1;
  return i;
}


x86 assembly (clang, -O0):
<reduce>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1143 <reduce+0x43>
jmp    1135 <reduce+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <reduce+0x15>
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reduce>:
mov    (%rdi),%r8
movabs $0xfffffffe00000000,%rdx
ff ff ff
mov    $0xffffffff,%eax
movabs $0x100000000,%r9
mov    %r8,%rcx
nop
add    %r9,%rdx
add    $0x1,%eax
lea    0x1(%rcx),%r10
cmp    %sil,(%rcx)
mov    %r10,%rcx
je     1120 <reduce+0x20>
sar    $0x20,%rdx
add    %rdx,%r8
mov    %r8,(%rdi)
ret

LLVM IR (-O0):
define i32 @reduce(i8** %0, i8 signext %1) {
%3 = alloca i8**
%4 = alloca i8
%5 = alloca i32
store i8** %0, i8*** %3
store i8 %1, i8* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
%9 = load i32, i32* %5
%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 = load i8, i8* %4
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %13, %15
br i1 %16, label %17, label %21
17: ; preds = %6
br label %18
18: ; preds = %17
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
%22 = load i32, i32* %5
%23 = sub nsw i32 %22, 1
%24 = load i8**, i8*** %3
%25 = load i8*, i8** %24
%26 = sext i32 %23 to i64
%27 = getelementptr inbounds i8, i8* %25, i64 %26
store i8* %27, i8** %24
%28 = load i32, i32* %5
ret i32 %28
}

LLVM IR (-O2):
define i32 @reduce(i8** nocapture %0, i8 signext %1) {
%3 = load i8*, i8** %0
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %3, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, %1
%9 = add nuw i64 %5, 1
br i1 %8, label %4, label %10
10: ; preds = %4
%11 = trunc i64 %5 to i32
%12 = shl i64 %5, 32
%13 = add i64 %12, -4294967296
%14 = ashr exact i64 %13, 32
%15 = getelementptr inbounds i8, i8* %3, i64 %14
store i8* %15, i8** %0
ret i32 %11
}
int test_imm_65uint8_reg(unsigned char val) {
  return ((val) & (0x65 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_65uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 101
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void RTLockValidatorRecExclDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorRecExclDestroy() {
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int getpid();
int test(void) {
  pid_t pid;
  pid = getpid();
  return pid;
}


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

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

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

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ exitc(int, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
long get_file_size(FILE *fp) {
  long lSize;
  if (fp == NULL)
    exitc(2, "Can't open file!");
  fseek(fp, 0, SEEK_END);
  lSize = ftell(fp);
  rewind(fp);
  return lSize;
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1168 <get_file_size+0x28>
mov    $0x2,%edi
lea    0xe9d(%rip),%rsi
call   1060 <exitc@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e75(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %rdi,%rdi
jne    115d <get_file_size+0x1d>
lea    0xead(%rip),%rsi
mov    $0x2,%edi
call   1060 <exitc@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <rewind@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Can't open file!\00"
@SEEK_END = global i32 0
define i64 @get_file_size(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @exitc(i32 2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i32*, i32** %2
%10 = load i32, i32* @SEEK_END
%11 = call i32 @fseek(i32* %9, i32 0, i32 %10)
%12 = load i32*, i32** %2
%13 = call i64 @ftell(i32* %12)
store i64 %13, i64* %3
%14 = load i32*, i32** %2
%15 = call i32 @rewind(i32* %14)
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
@.str = [17 x i8] c"Can't open file!\00"
@SEEK_END = global i32 0
define i64 @get_file_size(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @exitc(i32 2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = load i32, i32* @SEEK_END
%7 = tail call i32 @fseek(i32* %0, i32 0, i32 %6)
%8 = tail call i64 @ftell(i32* %0)
%9 = tail call i32 @rewind(i32* %0)
ret i64 %8
}
/* Variables and functions */
int get4(char const);
unsigned char get8(const char *ptr) { return get4(ptr[0]) << 4 | get4(ptr[1]); }


x86 assembly (clang, -O0):
<get8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <get4@plt>
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <get4@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get8>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <get4@plt>
mov    %eax,%ebp
shl    $0x4,%ebp
movsbl 0x1(%rbx),%edi
call   1030 <get4@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @get8(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* %4
%6 = call i32 @get4(i8 signext %5)
%7 = shl i32 %6, 4
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = call i32 @get4(i8 signext %10)
%12 = or i32 %7, %11
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @get8(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @get4(i8 signext %2)
%4 = shl i32 %3, 4
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = tail call i32 @get4(i8 signext %6)
%8 = or i32 %7, %4
%9 = trunc i32 %8 to i8
ret i8 %9
}
/* Type definitions */
struct S {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
void wrong_target_4(struct S *s) { abort(); }


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

x86 assembly (clang, -O2):
<wrong_target_4>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.S = type { i32 }
define void @wrong_target_4(%struct.S* %0) {
%2 = alloca %struct.S*
store %struct.S* %0, %struct.S** %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.S = type { i32 }
define void @wrong_target_4(%struct.S* nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
int bar(int y) {
  int z = -1;
  return z >> y;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
ret i32 -1
}
int slice_array(int *array, int new_array[]) { return 0; }


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

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

LLVM IR (-O0):
define i32 @slice_array(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 @slice_array(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void EscreveNoArquivo(FILE *arq, char palavra_linha[]) {
  fprintf(arq, "%s\n", palavra_linha);
}


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

x86 assembly (clang, -O2):
<EscreveNoArquivo>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @EscreveNoArquivo(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
int _close(int fd) {
  (void)fd;
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @_close(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __inc_remove_counter();
int __rmdir(char const *);
int rmdir(const char *path) {
  int res = __rmdir(path);
  if (res == 0) {
    __inc_remove_counter();
  }
  return res;
}


x86 assembly (clang, -O0):
<rmdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__rmdir@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1149 <rmdir+0x29>
mov    $0x0,%al
call   1030 <__inc_remove_counter@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmdir>:
push   %rbx
call   1040 <__rmdir@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1133 <rmdir+0x13>
xor    %eax,%eax
call   1030 <__inc_remove_counter@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rmdir(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @__rmdir(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @__inc_remove_counter()
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @rmdir(i8* %0) {
%2 = tail call i32 @__rmdir(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @__inc_remove_counter()
br label %6
6: ; preds = %4, %1
ret i32 %2
}
int CheckEnd() {
  union {
    int a;
    char b;
  } u;
  u.a = 1;
  if (u.b == 1)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<CheckEnd>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
cmp    $0x1,%eax
jne    1124 <CheckEnd+0x24>
movl   $0x0,-0x4(%rbp)
jmp    112b <CheckEnd+0x2b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @CheckEnd() {
%1 = alloca i32
%2 = alloca %union.anon
%3 = bitcast %union.anon* %2 to i32*
store i32 1, i32* %3
%4 = bitcast %union.anon* %2 to i8*
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 0, i32* %1
br label %10
9: ; preds = %0
store i32 1, i32* %1
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @CheckEnd() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x77() {
  Assert_real((isxdigit(119) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              600, ("isxdigit should be 0 for w"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x77>:
push   %rbp
mov    %rsp,%rbp
mov    $0x77,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x258,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x77>:
push   %rax
mov    $0x77,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x258,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for w\00"
define void @t_isxdigit_0x77() {
%1 = call i64 @isxdigit(i32 119)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 600, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for w\00"
define void @t_isxdigit_0x77() {
%1 = tail call i64 @isxdigit(i32 119)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 600, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int, int, int,
                           char *);
char *pS(char *);
void genInfix(FILE *out, char *op, int left, int prior, int right, char *cmt) {
  fprintf(out, "  infOp(\'%s\',%d,%d,%d).\t\t-- %s\n", pS(op), left, prior,
          right, cmt);
}


x86 assembly (clang, -O0):
<genInfix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <pS@plt>
mov    -0x30(%rbp),%rdi
mov    %rax,%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    -0x28(%rbp),%rax
lea    0xe94(%rip),%rsi
mov    %rax,(%rsp)
call   1030 <fprintf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genInfix>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %r9,%rbx
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %rdi,%rbp
mov    %rsi,%rdi
call   1040 <pS@plt>
mov    %rbx,(%rsp)
lea    0xeb2(%rip),%rsi
mov    %rbp,%rdi
mov    %rax,%rdx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c" infOp('%s',%d,%d,%d).\09\09-- %s\0A\00"
define void @genInfix(i32* %0, i8* %1, i32 %2, i32 %3, i32 %4, i8* %5) {
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
store i32* %0, i32** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i8* %5, i8** %12
%13 = load i32*, i32** %7
%14 = load i8*, i8** %8
%15 = call i8* @pS(i8* %14)
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i8*, i8** %12
%20 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %16, i32 %17, i32 %18, i8* %19)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c" infOp('%s',%d,%d,%d).\09\09-- %s\0A\00"
define void @genInfix(i32* nocapture %0, i8* %1, i32 %2, i32 %3, i32 %4, i8* %5) {
%7 = tail call i8* @pS(i8* %1)
%8 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %2, i32 %3, i32 %4, i8* %5)
ret void
}
/* Type definitions */
typedef scalar_t__ cl_sampler;
typedef int /*<<< orphan*/ cl_int;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, unsigned int *);
cl_int clRetainSampler(cl_sampler sampler) {
  unsigned int sys_args[1];
  sys_args[0] = (unsigned int)sampler;
  return (cl_int)syscall(325, 1025, sys_args);
}


x86 assembly (clang, -O0):
<clRetainSampler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdx
mov    $0x145,%edi
mov    $0x401,%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clRetainSampler>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x145,%edi
mov    $0x401,%esi
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @clRetainSampler(i64 %0) {
%2 = alloca i64
%3 = alloca [1 x i32]
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 %5, i32* %6
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%8 = call i32 @syscall(i32 325, i32 1025, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @clRetainSampler(i64 %0) {
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %2 to i8*
%4 = trunc i64 %0 to i32
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 %4, i32* %5
%6 = call i32 @syscall(i32 325, i32 1025, i32* %5)
ret i32 %6
}
double sgn(double a, double b) {
  double x = 0;
  x = (double)(a >= 0) ? a : -a;
  return (double)(b >= 0) ? x : -x;
}


x86 assembly (clang, -O0):
<sgn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1146 <sgn+0x46>
jp     1146 <sgn+0x46>
jmp    1155 <sgn+0x55>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1176 <sgn+0x76>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11b0 <sgn+0xb0>
jp     11b0 <sgn+0xb0>
jmp    11bf <sgn+0xbf>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    11e0 <sgn+0xe0>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgn>:
movapd 0xef8(%rip),%xmm2
movapd %xmm0,%xmm3
xorpd  %xmm2,%xmm3
xorpd  %xmm4,%xmm4
xorpd  %xmm5,%xmm5
cmplesd %xmm0,%xmm5
andpd  %xmm5,%xmm0
andnpd %xmm3,%xmm5
orpd   %xmm5,%xmm0
xorpd  %xmm0,%xmm2
cmplesd %xmm1,%xmm4
andpd  %xmm4,%xmm0
andnpd %xmm2,%xmm4
orpd   %xmm4,%xmm0
ret

LLVM IR (-O0):
define double @sgn(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 0.000000e+00, double* %5
%6 = load double, double* %3
%7 = fcmp oge double %6, 0.000000e+00
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
%10 = fcmp une double %9, 0.000000e+00
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load double, double* %3
br label %16
13: ; preds = %2
%14 = load double, double* %3
%15 = fneg double %14
br label %16
16: ; preds = %13, %11
%17 = phi double [ %12, %11 ], [ %15, %13 ]
store double %17, double* %5
%18 = load double, double* %4
%19 = fcmp oge double %18, 0.000000e+00
%20 = zext i1 %19 to i32
%21 = sitofp i32 %20 to double
%22 = fcmp une double %21, 0.000000e+00
br i1 %22, label %23, label %25
23: ; preds = %16
%24 = load double, double* %5
br label %28
25: ; preds = %16
%26 = load double, double* %5
%27 = fneg double %26
br label %28
28: ; preds = %25, %23
%29 = phi double [ %24, %23 ], [ %27, %25 ]
ret double %29
}

LLVM IR (-O2):
define double @sgn(double %0, double %1) {
%3 = fcmp oge double %0, 0.000000e+00
%4 = fneg double %0
%5 = select i1 %3, double %0, double %4
%6 = fcmp oge double %1, 0.000000e+00
%7 = fneg double %5
%8 = select i1 %6, double %5, double %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ HWVAD0_DriverIRQHandler();
__attribute__((weak)) void HWVAD0_IRQHandler(void) {
  HWVAD0_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @HWVAD0_IRQHandler() {
%1 = call i32 (...) @HWVAD0_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @HWVAD0_IRQHandler() {
%1 = tail call i32 (...) @HWVAD0_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ExtAccumulator(int);
void CP(void) { ExtAccumulator(7); }


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

x86 assembly (clang, -O2):
<CP>:
mov    $0x7,%edi
jmp    1030 <ExtAccumulator@plt>

LLVM IR (-O0):
define void @CP() {
%1 = call i32 @ExtAccumulator(i32 7)
ret void
}

LLVM IR (-O2):
define void @CP() {
%1 = tail call i32 @ExtAccumulator(i32 7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int syscall(int, char const *, int /*<<< orphan*/);
int chmod(const char *path, mode_t mode) { return syscall(15, path, mode); }


x86 assembly (clang, -O0):
<chmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0xf,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chmod>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0xf,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @chmod(i8* %0, i32 %1) {
%3 = tail call i32 @syscall(i32 15, i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _strcat_ptr(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char str1[7 + 7] = "hello ";
  char str2[7] = "world!";
  _strcat_ptr(str1, str2);
  printf("string = \'%s\'\n", str1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec2(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xeba(%rip),%eax
mov    %eax,-0x19(%rbp)
mov    0xeb4(%rip),%ax
mov    %ax,-0x15(%rbp)
mov    0xeac(%rip),%al
mov    %al,-0x13(%rbp)
lea    -0x12(%rbp),%rdi
lea    -0x19(%rbp),%rsi
call   1040 <_strcat_ptr@plt>
lea    -0x12(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movabs $0x206f6c6c6568,%rax
mov    %rax,0x10(%rsp)
movq   $0x0,0x16(%rsp)
movl   $0x21646c,0xb(%rsp)
movl   $0x6c726f77,0x8(%rsp)
6c
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <_strcat_ptr@plt>
lea    0xeaf(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str1 = [14 x i8] c"hello \00\00\00\00\00\00\00\00"
@__const.main.str2 = [7 x i8] c"world!\00"
@.str = [15 x i8] c"string = '%s'\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [14 x i8]
%3 = alloca [7 x i8]
store i32 0, i32* %1
%4 = bitcast [14 x i8]* %2 to i8*
%5 = bitcast [7 x i8]* %3 to i8*
%6 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%8 = call i32 @_strcat_ptr(i8* %6, i8* %7)
%9 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str1 = [14 x i8] c"hello \00\00\00\00\00\00\00\00"
@__const.main.str2 = [7 x i8] c"world!\00"
@.str = [15 x i8] c"string = '%s'\0A\00"
define i32 @main() {
%1 = alloca [14 x i8]
%2 = alloca [7 x i8]
%3 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%5 = call i32 @_strcat_ptr(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
void f1() {
  typedef int __attribute__((__mode__(__QI__))) qi_int_type;
  qi_int_type qi_int;
  __sync_bool_compare_and_swap(&qi_int, (qi_int_type)0, (qi_int_type)1);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    $0x1,%cl
lock cmpxchg %cl,-0x1(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    $0x1,%cl
xor    %eax,%eax
lock cmpxchg %cl,-0x1(%rsp)
ret

LLVM IR (-O0):
define void @f1() {
%1 = alloca i8
%2 = cmpxchg i8* %1, i8 0, i8 1 seq_cst seq_cst
%3 = extractvalue { i8, i1 } %2, 1
ret void
}

LLVM IR (-O2):
define void @f1() {
%1 = alloca i8
%2 = cmpxchg i8* %1, i8 0, i8 1 seq_cst seq_cst
ret void
}
int ld_lt_rm2(long double a1, long double *a2) { return !(((a1) < (*a2))); }


x86 assembly (clang, -O0):
<ld_lt_rm2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    -0x18(%rbp),%rax
fldt   (%rax)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_lt_rm2>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setbe  %al
ret

LLVM IR (-O0):
define i32 @ld_lt_rm2(x86_fp80 %0, x86_fp80* %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80*
store x86_fp80 %0, x86_fp80* %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80*, x86_fp80** %4
%7 = load x86_fp80, x86_fp80* %6
%8 = fcmp olt x86_fp80 %5, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ld_lt_rm2(x86_fp80 %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %1
%4 = fcmp ule x86_fp80 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned int addu(int register2, int register3) {
  return register2 + register3;
}


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

x86 assembly (clang, -O2):
<addu>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @addu(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t readnu16(const uint8_t *p) { return (p[0] << 8 | p[1]); }


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

x86 assembly (clang, -O2):
<readnu16>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @readnu16(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int i2cslave_Read(int);
unsigned i2c1slave_Read(void) { return i2cslave_Read(1); }


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

x86 assembly (clang, -O2):
<i2c1slave_Read>:
mov    $0x1,%edi
jmp    1030 <i2cslave_Read@plt>

LLVM IR (-O0):
define i32 @i2c1slave_Read() {
%1 = call i32 @i2cslave_Read(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @i2c1slave_Read() {
%1 = tail call i32 @i2cslave_Read(i32 1)
ret i32 %1
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int is_devfs(void) {
  static int yesno = 0;
  struct stat st;
  if (!yesno) {
    if (stat("/dev"
             "/.devfsd",
             &st) < 0)
      yesno = 1;
    else
      yesno = 2;
  }
  return yesno - 1;
}


x86 assembly (clang, -O0):
<is_devfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f0d(%rip)
jne    115d <is_devfs+0x4d>
lea    0xed4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    114e <is_devfs+0x3e>
movl   $0x1,0x2ee3(%rip)
jmp    1158 <is_devfs+0x48>
movl   $0x2,0x2ed4(%rip)
jmp    115d <is_devfs+0x4d>
mov    0x2ec9(%rip),%eax
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_devfs>:
push   %rax
mov    0x2f15(%rip),%eax
test   %eax,%eax
jne    113e <is_devfs+0x2e>
lea    0xede(%rip),%rdi
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
shr    $0x3f,%rcx
mov    $0x2,%eax
sub    %ecx,%eax
mov    %eax,0x2eee(%rip)
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@is_devfs.yesno = internal global i32 0
@.str = [13 x i8] c"/dev/.devfsd\00"
define i32 @is_devfs() {
%1 = alloca %struct.stat
%2 = load i32, i32* @is_devfs.yesno
%3 = icmp ne i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %0
%5 = call i64 @stat(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4
store i32 1, i32* @is_devfs.yesno
br label %9
8: ; preds = %4
store i32 2, i32* @is_devfs.yesno
br label %9
9: ; preds = %8, %7
br label %10
10: ; preds = %9, %0
%11 = load i32, i32* @is_devfs.yesno
%12 = sub nsw i32 %11, 1
ret i32 %12
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@is_devfs.yesno = internal unnamed_addr global i32 0
@.str = [13 x i8] c"/dev/.devfsd\00"
define i32 @is_devfs() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = load i32, i32* @is_devfs.yesno
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = call i64 @stat(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%7 = icmp slt i64 %6, 0
%8 = select i1 %7, i32 1, i32 2
store i32 %8, i32* @is_devfs.yesno
br label %9
9: ; preds = %5, %0
%10 = phi i32 [ %3, %0 ], [ %8, %5 ]
%11 = add nsw i32 %10, -1
ret i32 %11
}
unsigned crc32c_slow(unsigned crc, const void *data, int len) {
  return ~crc32c_partial_old(data, len, ~crc);
}


x86 assembly (clang, -O0):
<crc32c_slow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x4(%rbp),%edx
xor    $0xffffffff,%edx
mov    $0x0,%al
call   1030 <crc32c_partial_old@plt>
xor    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32c_slow>:
push   %rax
mov    %edi,%eax
not    %eax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <crc32c_partial_old@plt>
not    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @crc32c_slow(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = xor i32 %9, -1
%11 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @crc32c_partial_old to i32 (i8*, i32, i32, ...)*)(i8* %7, i32 %8, i32 %10)
%12 = xor i32 %11, -1
ret i32 %12
}

LLVM IR (-O2):
define i32 @crc32c_slow(i32 %0, i8* %1, i32 %2) {
%4 = xor i32 %0, -1
%5 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @crc32c_partial_old to i32 (i8*, i32, i32, ...)*)(i8* %1, i32 %2, i32 %4)
%6 = xor i32 %5, -1
ret i32 %6
}
/* Variables and functions */
int strcmp(char *, char *);
int array_cmp_str_asc(const void *a, const void *b) {
  return strcmp((char *)a, (char *)b);
}


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

x86 assembly (clang, -O2):
<array_cmp_str_asc>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @array_cmp_str_asc(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
unsigned next_pot(unsigned v) {
  v--;
  v |= v >> 1;
  v |= v >> 2;
  v |= v >> 4;
  v |= v >> 8;
  v |= v >> 16;
  v++;
  return v;
}


x86 assembly (clang, -O0):
<next_pot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_pot>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
shr    %ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
shr    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @next_pot(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = lshr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = lshr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = lshr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = lshr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add i32 %25, 1
store i32 %26, i32* %2
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @next_pot(i32 %0) {
%2 = add i32 %0, -1
%3 = lshr i32 %2, 1
%4 = or i32 %3, %2
%5 = lshr i32 %4, 2
%6 = or i32 %5, %4
%7 = lshr i32 %6, 4
%8 = or i32 %7, %6
%9 = lshr i32 %8, 8
%10 = or i32 %9, %8
%11 = lshr i32 %10, 16
%12 = or i32 %11, %10
%13 = add i32 %12, 1
ret i32 %13
}
/* Type definitions */
typedef double time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(double *);
void Date_Time(double julian_date, struct tm *cdate) {
  time_t jtime;
  jtime = (julian_date - 2440587.5) * 86400.0;
  *cdate = *gmtime(&jtime);
}


x86 assembly (clang, -O0):
<Date_Time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeda(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xec6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <gmtime@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    (%rcx),%ecx
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Date_Time>:
push   %rbx
sub    $0x10,%rsp
addsd  0xee3(%rip),%xmm0
mov    %rdi,%rbx
mulsd  0xee0(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <gmtime@plt>
mov    (%rax),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @Date_Time(double %0, %struct.tm* %1) {
%3 = alloca double
%4 = alloca %struct.tm*
%5 = alloca double
store double %0, double* %3
store %struct.tm* %1, %struct.tm** %4
%6 = load double, double* %3
%7 = fsub double %6, 0x41429EC5C0000000
%8 = fmul double %7, 8.640000e+04
store double %8, double* %5
%9 = load %struct.tm*, %struct.tm** %4
%10 = call %struct.tm* @gmtime(double* %5)
%11 = bitcast %struct.tm* %9 to i8*
%12 = bitcast %struct.tm* %10 to i8*
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @Date_Time(double %0, %struct.tm* nocapture writeonly %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = fadd double %0, 0xC1429EC5C0000000
%6 = fmul double %5, 8.640000e+04
store double %6, double* %3
%7 = call %struct.tm* @gmtime(double* %3)
%8 = getelementptr %struct.tm, %struct.tm* %7, i64 0, i32 0
%9 = getelementptr %struct.tm, %struct.tm* %1, i64 0, i32 0
%10 = load i32, i32* %8
store i32 %10, i32* %9
ret void
}
/* Variables and functions */
int gmx_editconf(int, char **);
int main(int argc, char *argv[]) { return gmx_editconf(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <gmx_editconf@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_editconf(i32 %0, i8** %1)
ret i32 %3
}