xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ shift(int /*<<< orphan*/ *, int, int);
void shift_rows(uint16_t *state, int way) {
  int i;
  for (i = 0; i < 4; i++) {
    shift(&(state[i * 4]), way, i);
  }
}


x86 assembly (clang, -O0):
<shift_rows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    115c <shift_rows+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%eax
shl    $0x2,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <shift@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <shift_rows+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_rows>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edx,%edx
call   1030 <shift@plt>
lea    0x10(%rbx),%rdi
mov    %ebp,%esi
mov    $0x1,%edx
call   1030 <shift@plt>
lea    0x20(%rbx),%rdi
mov    %ebp,%esi
mov    $0x2,%edx
call   1030 <shift@plt>
add    $0x30,%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x3,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <shift@plt>

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

LLVM IR (-O2):
define void @shift_rows(i32* %0, i32 %1) {
%3 = tail call i32 @shift(i32* %0, i32 %1, i32 0)
%4 = getelementptr inbounds i32, i32* %0, i64 4
%5 = tail call i32 @shift(i32* %4, i32 %1, i32 1)
%6 = getelementptr inbounds i32, i32* %0, i64 8
%7 = tail call i32 @shift(i32* %6, i32 %1, i32 2)
%8 = getelementptr inbounds i32, i32* %0, i64 12
%9 = tail call i32 @shift(i32* %8, i32 %1, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char const);
int puts(const char *str) {
  int i = 0;
  while (str[i] != '\0') {
    putchar(str[i]);
    i++;
  }
  putchar('\n');
  return 1;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <puts+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <puts+0x13>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @putchar(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 @putchar(i8 signext 10)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit1(int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
void __start(void) {
  write(1, "Hello, World!\n", 14);
  exit1(0);
}


x86 assembly (clang, -O0):
<__start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xed0(%rip),%rsi
mov    $0xe,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1040 <exit1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__start>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
mov    $0xe,%edx
call   1030 <write@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <exit1@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, World!\0A\00"
define void @__start() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 14)
%2 = tail call i32 @exit1(i32 0)
ret void
}
int callee_flat_s(int bla) { return bla + 1; }


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

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

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

LLVM IR (-O2):
define i32 @callee_flat_s(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Quicksort(int /*<<< orphan*/, int, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int n;
  char s[1000];
  scanf("%d", &n);
  scanf("%s", &s);
  Quicksort(0, n - 1, s);
  printf("%s", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xea8(%rip),%rdi
lea    -0x3f0(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    -0x3f0(%rbp),%rdx
xor    %edi,%edi
call   1030 <Quicksort@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3f8,%rsp
lea    0xebf(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xeaf(%rip),%r14
lea    0x10(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
add    $0xffffffff,%esi
xor    %edi,%edi
mov    %rbx,%rdx
call   1030 <Quicksort@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x3f8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), [1000 x i8]* %3)
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%9 = call i32 @Quicksort(i32 0, i32 %7, i8* %8)
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), [1000 x i8]* %2)
%7 = load i32, i32* %1
%8 = add nsw i32 %7, -1
%9 = call i32 @Quicksort(i32 0, i32 %8, i8* %4)
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
float mm2inch(float mm) { return mm * 0.039370f; }


x86 assembly (clang, -O0):
<mm2inch>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @mm2inch(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x3FA4284E00000000
ret float %4
}

LLVM IR (-O2):
define float @mm2inch(float %0) {
%2 = fmul float %0, 0x3FA4284E00000000
ret float %2
}
/* Variables and functions */
int get_pool_idx(size_t size) {
  int pool_idx;
  pool_idx = 0;
  for (size /= (1 << ((3 + 1))); size != 0; size = size / 2)
    pool_idx++;
  return pool_idx;
}


x86 assembly (clang, -O0):
<get_pool_idx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1140 <get_pool_idx+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111b <get_pool_idx+0x1b>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pool_idx>:
xor    %eax,%eax
cmp    $0x10,%rdi
jb     112f <get_pool_idx+0x2f>
shr    $0x4,%rdi
xor    %eax,%eax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %rcx
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1120 <get_pool_idx+0x20>
ret

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

LLVM IR (-O2):
define i32 @get_pool_idx(i64 %0) {
%2 = icmp ult i64 %0, 16
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = lshr i64 %0, 4
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 0, %3 ]
%7 = phi i64 [ %9, %5 ], [ %4, %3 ]
%8 = add nuw nsw i32 %6, 1
%9 = lshr i64 %7, 1
%10 = icmp ult i64 %7, 2
br i1 %10, label %11, label %5
11: ; preds = %5, %1
%12 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ errorexit(char *);
void *realloc(void *, size_t);
void *memrealloc(void *ptr, size_t size) {
  void *newptr = realloc(ptr, size);
  if (!newptr)
    errorexit("out of memory");
  return newptr;
}


x86 assembly (clang, -O0):
<memrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <memrealloc+0x38>
lea    0xead(%rip),%rdi
call   1030 <errorexit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memrealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <memrealloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <errorexit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @memrealloc(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 i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @errorexit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @memrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @errorexit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
struct mstr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ nalloc_free(struct mstr *);
void mstr_free(struct mstr *mstr) { nalloc_free(mstr); }


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

x86 assembly (clang, -O2):
<mstr_free>:
jmp    1030 <nalloc_free@plt>

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

LLVM IR (-O2):
%struct.mstr = type { i32 }
define void @mstr_free(%struct.mstr* %0) {
%2 = tail call i32 @nalloc_free(%struct.mstr* %0)
ret void
}
/* Variables and functions */
int MCL_CURRENT;
int MCL_FUTURE;
int /*<<< orphan*/ mlockall(int);
void set_mlock(void) {
  int mlockflags;
  mlockflags = MCL_CURRENT | MCL_FUTURE;
  mlockall(mlockflags);
}


x86 assembly (clang, -O0):
<set_mlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <mlockall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_mlock>:
mov    0x2ec1(%rip),%rax
mov    0x2ed2(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
jmp    1030 <mlockall@plt>

LLVM IR (-O0):
@MCL_CURRENT = global i32 0
@MCL_FUTURE = global i32 0
define void @set_mlock() {
%1 = alloca i32
%2 = load i32, i32* @MCL_CURRENT
%3 = load i32, i32* @MCL_FUTURE
%4 = or i32 %2, %3
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @mlockall(i32 %5)
ret void
}

LLVM IR (-O2):
@MCL_CURRENT = global i32 0
@MCL_FUTURE = global i32 0
define void @set_mlock() {
%1 = load i32, i32* @MCL_CURRENT
%2 = load i32, i32* @MCL_FUTURE
%3 = or i32 %2, %1
%4 = tail call i32 @mlockall(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_signals(unsigned long);
void arch_local_irq_restore(unsigned long flags) { set_signals(flags); }


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

x86 assembly (clang, -O2):
<arch_local_irq_restore>:
jmp    1030 <set_signals@plt>

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

LLVM IR (-O2):
define void @arch_local_irq_restore(i64 %0) {
%2 = tail call i32 @set_signals(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sumar(int, int);
int main(void) {
  int suma = sumar(5, 3);
  printf("La suma es: %d\n ", suma);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"La suma es: %d\0A \00"
define i32 @main() {
%1 = tail call i32 @sumar(i32 5, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int version_cmd(cp)
char *cp;
{ return version_report(); }


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

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

LLVM IR (-O0):
define i32 @version_cmd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @version_report()
ret i32 %3
}

LLVM IR (-O2):
define i32 @version_cmd(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @version_report()
ret i32 %2
}
int mult(int x, int y) {
  int res = x * y;
  x = y;
  return res;
}


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

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

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

LLVM IR (-O2):
define i32 @mult(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int g(int);
int main(void) {
  int z, w;
  w = g(z);
  assert(z == w);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @g(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = icmp eq i32 %6, %7
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @g(i32 undef)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
char *strcpy(char *dst, const char *src) {
  char *d = dst;
  while (1) {
    *dst = *src;
    if (*src == '\0')
      break;
    dst++;
    src++;
  }
  return d;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1135 <strcpy+0x35>
jmp    1152 <strcpy+0x52>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %cl,(%rdi)
cmpb   $0x0,(%rsi)
je     1131 <strcpy+0x31>
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
cmpb   $0x0,(%rsi,%rcx,1)
lea    0x1(%rcx),%rcx
jne    1120 <strcpy+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %9, %6 ], [ %0, %2 ]
%8 = phi i8* [ %10, %6 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
store i8 %11, i8* %9
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i8* %0
}
int test_imm_7Fuint8_reg(unsigned char val) {
  return ((val) & (-0x7F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_7Fuint8_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, -127
%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_7Fuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -127
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ x;
};
typedef TYPE_1__ XReparentEvent;

/* Variables and functions */
int get_XReparentEvent_x(void *_p) { return (int)((XReparentEvent *)_p)->x; }


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

x86 assembly (clang, -O2):
<get_XReparentEvent_x>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XReparentEvent_x(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XReparentEvent_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void clk_init(void) {}


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

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

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

LLVM IR (-O2):
define void @clk_init() {
ret void
}
void *occampi_branchlabelhook_copy(void *chook) { return chook; }


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

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

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

LLVM IR (-O2):
define i8* @occampi_branchlabelhook_copy(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void do_help(void) { printf("this is help.\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"this is help.\00"
define void @do_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printnpl() {
  printf(
      "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 "
      "-*- */\n"
      "/* This Source Code Form is subject to the terms of the Mozilla Public\n"
      " * License, v. 2.0. If a copy of the MPL was not distributed with this\n"
      " * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n");
}


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

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

LLVM IR (-O0):
@.str = [284 x i8] c"/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\0A/* This Source Code Form is subject to the terms of the Mozilla Public\0A * License, v. 2.0. If a copy of the MPL was not distributed with this\0A * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\0A\00"
define void @printnpl() {
%1 = call i32 @printf(i8* getelementptr inbounds ([284 x i8], [284 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [283 x i8] c"/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\0A/* This Source Code Form is subject to the terms of the Mozilla Public\0A * License, v. 2.0. If a copy of the MPL was not distributed with this\0A * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\00"
define void @printnpl() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([283 x i8], [283 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ call_by_ref(int *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int a = 0;
  int *p = &a;
  printf("In main: Address of p = %p\n", &p);
  printf("In main: Address p is pointing to = %p\n", p);
  call_by_ref(p);
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x0,0x14(%rsp)
lea    0x14(%rsp),%rax
mov    %rax,0x8(%rsp)
lea    0xec3(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%rsi
lea    0xec7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%rdi
call   1030 <call_by_ref@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"In main: Address of p = %p\0A\00"
@.str.1 = [40 x i8] c"In main: Address p is pointing to = %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
store i32* %1, i32** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32** %2)
%4 = load i32*, i32** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @call_by_ref(i32* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"In main: Address of p = %p\0A\00"
@.str.1 = [40 x i8] c"In main: Address p is pointing to = %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32** %2 to i8*
store i32* %1, i32** %2
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32** %2)
%6 = load i32*, i32** %2
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = load i32*, i32** %2
%9 = call i32 @call_by_ref(i32* %8)
ret i32 0
}
/* Type definitions */
struct instance_data {
  int dummy;
};

/* Variables and functions */
int IRC_SendCTCPMessage(struct instance_data const *, char const *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
int IRC_SendAction(const struct instance_data *pID, const char *szDestination,
                   const char *szText) {
  char szBuffer[512];
  sprintf(szBuffer, "ACTION %s", szText);
  return IRC_SendCTCPMessage(pID, szDestination, szBuffer);
}


x86 assembly (clang, -O0):
<IRC_SendAction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xeb7(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x220(%rbp),%rdx
call   1030 <IRC_SendCTCPMessage@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IRC_SendAction>:
push   %r15
push   %r14
push   %rbx
sub    $0x200,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec7(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <IRC_SendCTCPMessage@plt>
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.instance_data = type { i32 }
@.str = [10 x i8] c"ACTION %s\00"
define i32 @IRC_SendAction(%struct.instance_data* %0, i8* %1, i8* %2) {
%4 = alloca %struct.instance_data*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [512 x i8]
store %struct.instance_data* %0, %struct.instance_data** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %6
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load %struct.instance_data*, %struct.instance_data** %4
%12 = load i8*, i8** %5
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%14 = call i32 @IRC_SendCTCPMessage(%struct.instance_data* %11, i8* %12, i8* %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.instance_data = type { i32 }
@.str = [10 x i8] c"ACTION %s\00"
define i32 @IRC_SendAction(%struct.instance_data* %0, i8* %1, i8* %2) {
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = call i32 @IRC_SendCTCPMessage(%struct.instance_data* %0, i8* %1, i8* %5)
ret i32 %7
}
int fun1288() { return 1288; }


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

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

LLVM IR (-O0):
define i32 @fun1288() {
ret i32 1288
}

LLVM IR (-O2):
define i32 @fun1288() {
ret i32 1288
}
int is_at_equiv(attr1, attr2)
int attr1;
int attr2;
{
  attr1 = apply_at_specials(attr1);
  attr2 = apply_at_specials(attr2);
  return (attr1 == attr2);
}


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

x86 assembly (clang, -O2):
<is_at_equiv>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
xor    %eax,%eax
call   1030 <apply_at_specials@plt>
mov    %eax,%ebp
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <apply_at_specials@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_at_equiv(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 = call i32 (i32, ...) bitcast (i32 (...)* @apply_at_specials to i32 (i32, ...)*)(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %4
%8 = call i32 (i32, ...) bitcast (i32 (...)* @apply_at_specials to i32 (i32, ...)*)(i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp eq i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_at_equiv(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @apply_at_specials to i32 (i32, ...)*)(i32 %0)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @apply_at_specials to i32 (i32, ...)*)(i32 %1)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ map3d_xy_double(double, double, double, double *, double *);
void map3d_xy(double x, double y, double z, int *xt, int *yt) {
  double xtd, ytd;
  map3d_xy_double(x, y, z, &xtd, &ytd);
  *xt = xtd;
  *yt = ytd;
}


x86 assembly (clang, -O0):
<map3d_xy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    -0x30(%rbp),%rdi
lea    -0x38(%rbp),%rsi
call   1030 <map3d_xy_double@plt>
cvttsd2si -0x30(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
cvttsd2si -0x38(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map3d_xy>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <map3d_xy_double@plt>
cvttsd2si 0x10(%rsp),%eax
mov    %eax,(%rbx)
cvttsd2si 0x8(%rsp),%eax
mov    %eax,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @map3d_xy(double %0, double %1, double %2, i32* %3, i32* %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca double
%12 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%13 = load double, double* %6
%14 = load double, double* %7
%15 = load double, double* %8
%16 = call i32 @map3d_xy_double(double %13, double %14, double %15, double* %11, double* %12)
%17 = load double, double* %11
%18 = fptosi double %17 to i32
%19 = load i32*, i32** %9
store i32 %18, i32* %19
%20 = load double, double* %12
%21 = fptosi double %20 to i32
%22 = load i32*, i32** %10
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @map3d_xy(double %0, double %1, double %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = alloca double
%7 = alloca double
%8 = bitcast double* %6 to i8*
%9 = bitcast double* %7 to i8*
%10 = call i32 @map3d_xy_double(double %0, double %1, double %2, double* %6, double* %7)
%11 = load double, double* %6
%12 = fptosi double %11 to i32
store i32 %12, i32* %3
%13 = load double, double* %7
%14 = fptosi double %13 to i32
store i32 %14, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void fatalerror(char error_text[]) {
  fprintf(stderr, "Run-time error...\n");
  fprintf(stderr, "%s\n", error_text);
  fprintf(stderr, "...now exiting to system...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<fatalerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatalerror>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%edi
lea    0xec8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xeca(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xeba(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Run-time error...\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [29 x i8] c"...now exiting to system...\0A\00"
define void @fatalerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %2
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Run-time error...\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [29 x i8] c"...now exiting to system...\0A\00"
define void @fatalerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void goodbye() { printf("Goodbye, world!\n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"Goodbye, world!\00"
define void @goodbye() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct tuple {
  int dummy;
};
struct lua_State {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ luaT_pushtuple(struct lua_State *, struct tuple *);
int luaT_pushtupleornil(struct lua_State *L, struct tuple *tuple) {
  if (tuple == NULL)
    return 0;
  luaT_pushtuple(L, tuple);
  return 1;
}


x86 assembly (clang, -O0):
<luaT_pushtupleornil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1137 <luaT_pushtupleornil+0x27>
movl   $0x0,-0x4(%rbp)
jmp    114b <luaT_pushtupleornil+0x3b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <luaT_pushtuple@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaT_pushtupleornil>:
test   %rsi,%rsi
je     1125 <luaT_pushtupleornil+0x15>
push   %rax
call   1030 <luaT_pushtuple@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.lua_State = type { i32 }
%struct.tuple = type { i32 }
define i32 @luaT_pushtupleornil(%struct.lua_State* %0, %struct.tuple* %1) {
%3 = alloca i32
%4 = alloca %struct.lua_State*
%5 = alloca %struct.tuple*
store %struct.lua_State* %0, %struct.lua_State** %4
store %struct.tuple* %1, %struct.tuple** %5
%6 = load %struct.tuple*, %struct.tuple** %5
%7 = icmp eq %struct.tuple* %6, null
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %13
9: ; preds = %2
%10 = load %struct.lua_State*, %struct.lua_State** %4
%11 = load %struct.tuple*, %struct.tuple** %5
%12 = call i32 @luaT_pushtuple(%struct.lua_State* %10, %struct.tuple* %11)
store i32 1, i32* %3
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.lua_State = type { i32 }
%struct.tuple = type { i32 }
define i32 @luaT_pushtupleornil(%struct.lua_State* %0, %struct.tuple* %1) {
%3 = icmp eq %struct.tuple* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @luaT_pushtuple(%struct.lua_State* %0, %struct.tuple* %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %7
}
void ff_hevc_put_hevc_qpel_v24_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_v24_8_sse4() {
ret void
}
/* Variables and functions */
char *strcpy(char *, char *);
char *ttyname(int fd) {
  static char buf[16];
  (void)fd;
  return strcpy(buf, "/dev_pty_0");
}


x86 assembly (clang, -O0):
<ttyname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0x2f1e(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ttyname>:
movabs $0x7974705f7665642f,%rax
70 74 79
mov    %rax,0x2f1f(%rip)
movl   $0x305f79,0x2f1c(%rip)
lea    0x2f0e(%rip),%rax
ret

LLVM IR (-O0):
@ttyname.buf = internal global [16 x i8] zeroinitializer
@.str = [11 x i8] c"/dev_pty_0\00"
define i8* @ttyname(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* @strcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @ttyname.buf, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@ttyname.buf = internal global [16 x i8] zeroinitializer
@.str = [11 x i8] c"/dev_pty_0\00"
define i8* @ttyname(i32 %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 dereferenceable(11) getelementptr inbounds ([16 x i8], [16 x i8]* @ttyname.buf, i64 0, i64 0), i8* align 1 dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 11, i1 false)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @ttyname.buf, i64 0, i64 0)
}
/* Variables and functions */
int tcflow(int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) { return tcflow(0, 0); }


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

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <tcflow@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @tcflow(i32 0, i32 0)
ret i32 %1
}
int test_imm_45uint16_reg(unsigned short val) {
  return ((val) & (-0x45 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_45uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffbb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_45uint16_reg>:
test   $0xffbb,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_45uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -69
%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_45uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -69
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fatal();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void one_input(void) {
  fprintf(stderr, "cc: too many files for -E\n");
  fatal();
}


x86 assembly (clang, -O0):
<one_input>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <fatal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<one_input>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <fatal@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"cc: too many files for -E\0A\00"
define void @one_input() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @fatal()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"cc: too many files for -E\0A\00"
define void @one_input() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @fatal()
ret void
}
/* Variables and functions */
int sn_printf(char *, size_t, char *, char const *);
int strn_cpy(char *dst, size_t size, const char *src) {
  return sn_printf(dst, size, "%s", src);
}


x86 assembly (clang, -O0):
<strn_cpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rdx
call   1030 <sn_printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strn_cpy>:
mov    %rdx,%rcx
lea    0xee6(%rip),%rdx
jmp    1030 <sn_printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @strn_cpy(i8* %0, i64 %1, i8* %2) {
%4 = tail call i32 @sn_printf(i8* %0, i64 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 %4
}