xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ realheapsort();
main() { realheapsort(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @realheapsort()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @realheapsort()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int convertToPostfix_Int(char *);
int evaluateIntExpression(char *expression) {
  assert(expression != NULL);
  return convertToPostfix_Int(expression);
}


x86 assembly (clang, -O0):
<evaluateIntExpression>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <convertToPostfix_Int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evaluateIntExpression>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <convertToPostfix_Int@plt>

LLVM IR (-O0):
define i32 @evaluateIntExpression(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i8*, i8** %2
%8 = call i32 @convertToPostfix_Int(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @evaluateIntExpression(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @convertToPostfix_Int(i8* %0)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int ph_ftp_data_handle_packet(void *handler, const char *packet, ssize_t len) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ph_ftp_data_handle_packet(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ make_filename(long, char *, char *);
long umfpack_zi_save_symbolic(void *, char *);
void umf4zssym_(void **Symbolic, long *filenum, long *status) {
  char filename[200];
  make_filename(*filenum, "s", filename);
  *status = umfpack_zi_save_symbolic(*Symbolic, filename);
}


x86 assembly (clang, -O0):
<umf4zssym_>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    -0xe0(%rbp),%rdx
lea    0xeb4(%rip),%rsi
call   1030 <make_filename@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    -0xe0(%rbp),%rsi
call   1040 <umfpack_zi_save_symbolic@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umf4zssym_>:
push   %r15
push   %r14
push   %rbx
sub    $0xd0,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
mov    (%rsi),%rdi
lea    0xec4(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdx
call   1030 <make_filename@plt>
mov    (%rbx),%rdi
mov    %r15,%rsi
call   1040 <umfpack_zi_save_symbolic@plt>
mov    %rax,(%r14)
add    $0xd0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"s\00"
define void @umf4zssym_(i8** %0, i64* %1, i64* %2) {
%4 = alloca i8**
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca [200 x i8]
store i8** %0, i8*** %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%8 = load i64*, i64** %5
%9 = load i64, i64* %8
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%11 = call i32 @make_filename(i64 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i8**, i8*** %4
%13 = load i8*, i8** %12
%14 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%15 = call i64 @umfpack_zi_save_symbolic(i8* %13, i8* %14)
%16 = load i64*, i64** %6
store i64 %15, i64* %16
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"s\00"
define void @umf4zssym_(i8** nocapture %0, i64* nocapture %1, i64* nocapture writeonly %2) {
%4 = alloca [200 x i8]
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%6 = load i64, i64* %1
%7 = call i32 @make_filename(i64 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %5)
%8 = load i8*, i8** %0
%9 = call i64 @umfpack_zi_save_symbolic(i8* %8, i8* %5)
store i64 %9, i64* %2
ret void
}
/* Variables and functions */
scalar_t__ get_vector_bit(char *, int);
int count_vector_bits(char *vector) {
  int i, count = 0;
  for (i = 0; i < 9025; i++)
    count += get_vector_bit(vector, i);
  return count;
}


x86 assembly (clang, -O0):
<count_vector_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2341,-0xc(%rbp)
jge    115e <count_vector_bits+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <get_vector_bit@plt>
mov    %rax,%rcx
movslq -0x10(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <count_vector_bits+0x1a>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_vector_bits>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <get_vector_bit@plt>
add    %eax,%ebx
add    $0x1,%ebp
cmp    $0x2341,%ebp
jne    1120 <count_vector_bits+0x10>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @count_vector_bits(i8* %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %7, %2 ]
%4 = phi i32 [ 0, %1 ], [ %8, %2 ]
%5 = tail call i64 @get_vector_bit(i8* %0, i32 %4)
%6 = trunc i64 %5 to i32
%7 = add i32 %3, %6
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %8, 9025
br i1 %9, label %10, label %2
10: ; preds = %2
ret i32 %7
}
unsigned int buf16_to_uint(const void *buffer) {
  const unsigned char *p = buffer;
  return (((unsigned int)p[0] << 8) | p[1]);
}


x86 assembly (clang, -O0):
<buf16_to_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf16_to_uint>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @buf16_to_uint(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b;
  scanf("%d", &a);
  scanf("%d", &b);
  printf("%d", b & (1 << a) ? 1 : 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x10(%rbp),%ecx
and    %eax,%ecx
xor    %esi,%esi
mov    $0x1,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%cl
shr    %cl,%esi
and    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = shl i32 1, %7
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 1, i32 0
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = lshr i32 %7, %8
%10 = and i32 %9, 1
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}
void RG0void(void) {}


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

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

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

LLVM IR (-O2):
define void @RG0void() {
ret void
}
/* Type definitions */
struct fastset_s {
  int dummy;
};

/* Variables and functions */
int fastset_subset(struct fastset_s *, struct fastset_s *, int);
int fastset_superset(struct fastset_s *s1, struct fastset_s *s2, int strict) {
  return fastset_subset(s2, s1, strict);
}


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

x86 assembly (clang, -O2):
<fastset_superset>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <fastset_subset@plt>

LLVM IR (-O0):
%struct.fastset_s = type { i32 }
define i32 @fastset_superset(%struct.fastset_s* %0, %struct.fastset_s* %1, i32 %2) {
%4 = alloca %struct.fastset_s*
%5 = alloca %struct.fastset_s*
%6 = alloca i32
store %struct.fastset_s* %0, %struct.fastset_s** %4
store %struct.fastset_s* %1, %struct.fastset_s** %5
store i32 %2, i32* %6
%7 = load %struct.fastset_s*, %struct.fastset_s** %5
%8 = load %struct.fastset_s*, %struct.fastset_s** %4
%9 = load i32, i32* %6
%10 = call i32 @fastset_subset(%struct.fastset_s* %7, %struct.fastset_s* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.fastset_s = type { i32 }
define i32 @fastset_superset(%struct.fastset_s* %0, %struct.fastset_s* %1, i32 %2) {
%4 = tail call i32 @fastset_subset(%struct.fastset_s* %1, %struct.fastset_s* %0, i32 %2)
ret i32 %4
}
void opal_atomic_mb(void) { __sync_synchronize(); }


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

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

LLVM IR (-O0):
define void @opal_atomic_mb() {
fence seq_cst
ret void
}

LLVM IR (-O2):
define void @opal_atomic_mb() {
fence seq_cst
ret void
}
void op_fnzcall() { ; }


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

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

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

LLVM IR (-O2):
define void @op_fnzcall() {
ret void
}
void dfn_as(short s) {}


x86 assembly (clang, -O0):
<dfn_as>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @dfn_as(i16 signext %0) {
ret void
}
int Bematech_FI_NumeroCuponsCancelados(Var, Retorno) {
  return Formata("\x1b|35|08|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_NumeroCuponsCancelados>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <Formata@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_NumeroCuponsCancelados>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <Formata@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\1B|35|08|\1B\00"
define i32 @Bematech_FI_NumeroCuponsCancelados(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 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"\1B|35|08|\1B\00"
define i32 @Bematech_FI_NumeroCuponsCancelados(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_packs_pi32(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 __attribute__((no, unused)) test(__m64 s1, __m64 s2) {
  return _mm_packs_pi32(s1, s2);
}


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_packs_pi32@plt>

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

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_packs_pi32(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "Usage: %s [options] n f1,t1 f2,t2 f3,t3 ...\n", name);
  fprintf(stderr, "For more information type: %s -h \n\n", name);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xee4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xef3(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: %s [options] n f1,t1 f2,t2 f3,t3 ...\0A\00"
@.str.1 = [36 x i8] c"For more information type: %s -h \0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: %s [options] n f1,t1 f2,t2 f3,t3 ...\0A\00"
@.str.1 = [36 x i8] c"For more information type: %s -h \0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmx_select(int, char **);
int main(int argc, char *argv[]) {
  gmx_select(argc, argv);
  return 0;
}


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_select@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_select(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ config_WITH_CARDREADER();
int config_CARDREADER_SMARGO(void) { return config_WITH_CARDREADER() ? 1 : 0; }


x86 assembly (clang, -O0):
<config_CARDREADER_SMARGO>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <config_WITH_CARDREADER@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_CARDREADER_SMARGO>:
push   %rax
xor    %eax,%eax
call   1030 <config_WITH_CARDREADER@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @config_CARDREADER_SMARGO() {
%1 = call i64 (...) @config_WITH_CARDREADER()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 1, i32 0
ret i32 %4
}

LLVM IR (-O2):
define i32 @config_CARDREADER_SMARGO() {
%1 = tail call i64 (...) @config_WITH_CARDREADER()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
unsigned long ffz(unsigned long word) {
  asm("bsf %1,%0" : "=r"(word) : "r"(~word));
  return word;
}


x86 assembly (clang, -O0):
<ffz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
bsf    %rax,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffz>:
not    %rdi
bsf    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @ffz(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, -1
%5 = call i64 asm "bsf $1,$0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i64 %4)
store i64 %5, i64* %2
%6 = load i64, i64* %2
ret i64 %6
}

LLVM IR (-O2):
define i64 @ffz(i64 %0) {
%2 = xor i64 %0, -1
%3 = tail call i64 asm "bsf $1,$0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i64 %2)
ret i64 %3
}
char *tparam(string, outstring, len, arg0, arg1, arg2, arg3)
char *string;
char *outstring;
int len;
int arg0, arg1, arg2, arg3;
{ return tparam1(string, outstring, len, (char *)0, (char *)0, &arg0); }


x86 assembly (clang, -O0):
<tparam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    %eax,%r8d
lea    -0x18(%rbp),%r9
mov    %r8,%rcx
mov    $0x0,%al
call   1030 <tparam1@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tparam>:
push   %rax
mov    %ecx,0x4(%rsp)
lea    0x4(%rsp),%r9
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
call   1030 <tparam1@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @tparam(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i8* %0, i8** %8
store i8* %1, i8** %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = load i32, i32* %10
%18 = call i32 (i8*, i8*, i32, i8*, i8*, i32*, ...) bitcast (i32 (...)* @tparam1 to i32 (i8*, i8*, i32, i8*, i8*, i32*, ...)*)(i8* %15, i8* %16, i32 %17, i8* null, i8* null, i32* %11)
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i8*
ret i8* %20
}

LLVM IR (-O2):
define i8* @tparam(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
store i32 %3, i32* %8
%9 = call i32 (i8*, i8*, i32, i8*, i8*, i32*, ...) bitcast (i32 (...)* @tparam1 to i32 (i8*, i8*, i32, i8*, i8*, i32*, ...)*)(i8* %0, i8* %1, i32 %2, i8* null, i8* null, i32* %8)
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}
void swap(int *x, int *y) {
  int t;
  t = *x;
  *x = *y;
  *y = t;
}


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

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

LLVM IR (-O0):
define void @swap(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* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
void LM_entry(const char *valname, const char *valdata) {
  printf(
      "Root: HKLM; Subkey: \"Software\\gretl\"; ValueType: string; ValueName: "
      "\"%s\"; ValueData: \"%s\"\n",
      valname, valdata);
}


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

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

LLVM IR (-O0):
@.str = [91 x i8] c"Root: HKLM; Subkey: \22Software\\gretl\22; ValueType: string; ValueName: \22%s\22; ValueData: \22%s\22\0A\00"
define void @LM_entry(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 @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [91 x i8] c"Root: HKLM; Subkey: \22Software\\gretl\22; ValueType: string; ValueName: \22%s\22; ValueData: \22%s\22\0A\00"
define void @LM_entry(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
int INHERENT_fchmod() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @INHERENT_fchmod() {
ret i32 0
}
/* Variables and functions */
int figure(char, int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, char *, int *);
int main() {
  char operator;
  int operand_l, operand_r;
  scanf("%d %c %d", &operand_l, &operator, & operand_r);
  int result = figure(operator, operand_l, operand_r);
  printf("%d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x5(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1050 <scanf@plt>
mov    -0x5(%rbp),%al
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsbl %al,%edi
call   1040 <figure@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0xf(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1050 <scanf@plt>
movsbl 0xf(%rsp),%edi
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
call   1040 <figure@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %c %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i8* %1, i32* %3)
%7 = load i8, i8* %1
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @figure(i8 signext %7, i32 %8, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ldh_a_n();
void opcode_f0() { ldh_a_n(); }


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

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

LLVM IR (-O0):
define void @opcode_f0() {
%1 = call i32 (...) @ldh_a_n()
ret void
}

LLVM IR (-O2):
define void @opcode_f0() {
%1 = tail call i32 (...) @ldh_a_n()
ret void
}
/* Type definitions */
struct dune_tf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SYS_exit;
long dune_jump_to_user(struct dune_tf *);
int /*<<< orphan*/ syscall(int /*<<< orphan*/, long);
void do_enter_thread(struct dune_tf *tf) {
  long rc;
  rc = dune_jump_to_user(tf);
  syscall(SYS_exit, rc);
}


x86 assembly (clang, -O0):
<do_enter_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <dune_jump_to_user@plt>
mov    %rax,-0x10(%rbp)
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_enter_thread>:
push   %rax
call   1040 <dune_jump_to_user@plt>
mov    0x2ebb(%rip),%rcx
mov    (%rcx),%edi
mov    %rax,%rsi
pop    %rax
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.dune_tf = type { i32 }
@SYS_exit = global i32 0
define void @do_enter_thread(%struct.dune_tf* %0) {
%2 = alloca %struct.dune_tf*
%3 = alloca i64
store %struct.dune_tf* %0, %struct.dune_tf** %2
%4 = load %struct.dune_tf*, %struct.dune_tf** %2
%5 = call i64 @dune_jump_to_user(%struct.dune_tf* %4)
store i64 %5, i64* %3
%6 = load i32, i32* @SYS_exit
%7 = load i64, i64* %3
%8 = call i32 @syscall(i32 %6, i64 %7)
ret void
}

LLVM IR (-O2):
%struct.dune_tf = type { i32 }
@SYS_exit = global i32 0
define void @do_enter_thread(%struct.dune_tf* %0) {
%2 = tail call i64 @dune_jump_to_user(%struct.dune_tf* %0)
%3 = load i32, i32* @SYS_exit
%4 = tail call i32 @syscall(i32 %3, i64 %2)
ret void
}
int toi_deactivate_storage(int force) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @toi_deactivate_storage(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MwSpawn(char *);
char *getenv(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
void MwHelp(char *p) {
  char b[1024];
  char *browser = getenv("BROWSER");
  if (browser == NULL)
    browser = "netscape";
  sprintf(b, "%s /usr/local/doc/Mowitz/%s", browser, p);
  MwSpawn(b);
}


x86 assembly (clang, -O0):
<MwHelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x418(%rbp)
cmpq   $0x0,-0x418(%rbp)
jne    116e <MwHelp+0x3e>
lea    0xea1(%rip),%rax
mov    %rax,-0x418(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x418(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xe8a(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1040 <MwSpawn@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MwHelp>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rdi,%rbx
lea    0xebc(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xeb5(%rip),%rdx
cmovne %rax,%rdx
lea    0xeb3(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rcx
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1040 <MwSpawn@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"BROWSER\00"
@.str.1 = [9 x i8] c"netscape\00"
@.str.2 = [28 x i8] c"%s /usr/local/doc/Mowitz/%s\00"
define void @MwHelp(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
%4 = alloca i8*
store i8* %0, i8** %2
%5 = call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %4
br label %9
9: ; preds = %8, %1
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %11, i8* %12)
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%15 = call i32 @MwSpawn(i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"BROWSER\00"
@.str.1 = [9 x i8] c"netscape\00"
@.str.2 = [28 x i8] c"%s /usr/local/doc/Mowitz/%s\00"
define void @MwHelp(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = tail call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i8* %4, null
%6 = select i1 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %4
%7 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %6, i8* %0)
%8 = call i32 @MwSpawn(i8* %3)
ret void
}
void lcd_draw_pixel(int row, int col, int color) {
  unsigned long *pixel = (unsigned long *)(0x23000000);
  *(pixel + row * (480) + col) = color;
}


x86 assembly (clang, -O0):
<lcd_draw_pixel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x23000000,%eax
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rdx
mov    -0x18(%rbp),%rax
imul   $0x1e0,-0x4(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_draw_pixel>:
movslq %edx,%rax
imul   $0x1e0,%edi,%ecx
movslq %ecx,%rcx
movslq %esi,%rdx
shl    $0x3,%rdx
mov    %rax,0x23000000(%rdx,%rcx,8)
23
ret

LLVM IR (-O0):
define void @lcd_draw_pixel(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i64* inttoptr (i64 587202560 to i64*), i64** %7
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = load i64*, i64** %7
%11 = load i32, i32* %4
%12 = mul nsw i32 %11, 480
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i64, i64* %10, i64 %13
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i64, i64* %14, i64 %16
store i64 %9, i64* %17
ret void
}

LLVM IR (-O2):
define void @lcd_draw_pixel(i32 %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = mul nsw i32 %0, 480
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i64, i64* inttoptr (i64 587202560 to i64*), i64 %6
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i64, i64* %7, i64 %8
store i64 %4, i64* %9
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t fib16(uint16_t lfsr) {
  uint16_t bit = ((lfsr >> 0) ^ (lfsr >> 2) ^ (lfsr >> 3) ^ (lfsr >> 5) ^ 1);
  return (lfsr >> 1) | (bit << 15);
}


x86 assembly (clang, -O0):
<fib16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x3,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x5,%ecx
xor    %ecx,%eax
xor    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    -0x8(%rbp),%ecx
shl    $0xf,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib16>:
mov    %edi,%ecx
shr    $0x2,%ecx
xor    %edi,%ecx
mov    %edi,%edx
shr    $0x3,%edx
mov    %edi,%eax
shr    $0x5,%eax
xor    %edx,%eax
xor    %ecx,%eax
sar    %edi
xor    $0x1,%eax
shl    $0xf,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @fib16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 0
%6 = load i32, i32* %2
%7 = ashr i32 %6, 2
%8 = xor i32 %5, %7
%9 = load i32, i32* %2
%10 = ashr i32 %9, 3
%11 = xor i32 %8, %10
%12 = load i32, i32* %2
%13 = ashr i32 %12, 5
%14 = xor i32 %11, %13
%15 = xor i32 %14, 1
store i32 %15, i32* %3
%16 = load i32, i32* %2
%17 = ashr i32 %16, 1
%18 = load i32, i32* %3
%19 = shl i32 %18, 15
%20 = or i32 %17, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @fib16(i32 %0) {
%2 = lshr i32 %0, 2
%3 = xor i32 %2, %0
%4 = lshr i32 %0, 3
%5 = xor i32 %3, %4
%6 = lshr i32 %0, 5
%7 = xor i32 %5, %6
%8 = ashr i32 %0, 1
%9 = shl i32 %7, 15
%10 = xor i32 %9, 32768
%11 = or i32 %10, %8
ret i32 %11
}
void my_expensive_function() {
  int i;
  double number = 0;
  for (i = 0; i < 10000000; i++) {
    number = number + (double)i / 50.0f;
  }
}


x86 assembly (clang, -O0):
<my_expensive_function>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x989680,-0x4(%rbp)
jge    114d <my_expensive_function+0x4d>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xece(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1113 <my_expensive_function+0x13>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @my_expensive_function() {
%1 = alloca i32
%2 = alloca double
store double 0.000000e+00, double* %2
store i32 0, i32* %1
br label %3
3: ; preds = %12, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 10000000
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = load double, double* %2
%8 = load i32, i32* %1
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 5.000000e+01
%11 = fadd double %7, %10
store double %11, double* %2
br label %12
12: ; preds = %6
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %3
15: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @my_expensive_function() {
ret void
}
void RTAvlUIntPtrGetRoot(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlUIntPtrGetRoot() {
ret void
}
/* Variables and functions */
double sqrt(double);
double sqrt1(double a) { return sqrt(a); }


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

x86 assembly (clang, -O2):
<sqrt1>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <sqrt1+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @sqrt1(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
int isoct(char chr) { return chr >= '0' && chr <= '7'; }


x86 assembly (clang, -O0):
<isoct>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isoct+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x37,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isoct>:
and    $0xf8,%dil
xor    %eax,%eax
cmp    $0x30,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isoct(i8 signext %0) {
%2 = and i8 %0, -8
%3 = icmp eq i8 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __set_errno(int);
long __syscall_error(void) {
  register int eax __asm__("%eax");
  int _errno = -eax;
  __set_errno(_errno);
  return -1;
}


x86 assembly (clang, -O0):
<__syscall_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffffffffffff,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall_error>:
push   %rax
call   1030 <__set_errno@plt>
mov    $0xffffffffffffffff,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @__syscall_error() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
%4 = sub nsw i32 0, %3
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @__set_errno(i32 %5)
ret i64 -1
}

LLVM IR (-O2):
define i64 @__syscall_error() {
%1 = tail call i32 @__set_errno(i32 undef)
ret i64 -1
}
int test3() {
  int x;
  x = 0;
  return x;
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test3() {
ret i32 0
}
/* Variables and functions */
int do_echo(int, char **);
int main(int argc, char *argv[]) {
  int result = do_echo(argc, argv);
  return result;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define weak void @EXTI10_Callback() {
ret void
}
call2e(i, f2, l, d2, c, f1, s, d1) int i;
float f2;
long l;
double d2;
char c;
float f1;
short s;
double d1;
{
  c = 'a';
  f1 = 0.0;
  s = 5;
  d1 = 0.0;
  i = 6;
  f2 = 0.1;
  l = 7;
  d2 = 0.2;
}


x86 assembly (clang, -O0):
<call2e>:
push   %rbp
mov    %rsp,%rbp
mov    %ecx,%eax
movsd  %xmm2,-0x40(%rbp)
movaps %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
cvtsd2ss %xmm2,%xmm2
mov    %dl,%cl
cvtsd2ss %xmm0,%xmm0
mov    %edi,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %cl,-0x21(%rbp)
movss  %xmm0,-0x28(%rbp)
mov    %ax,-0x2a(%rbp)
movsd  %xmm3,-0x38(%rbp)
movb   $0x61,-0x21(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movw   $0x5,-0x2a(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x6,-0x8(%rbp)
movss  0xea0(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movq   $0x7,-0x18(%rbp)
movsd  0xe83(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @call2e(i32 %0, double %1, i64 %2, double %3, i32 %4, double %5, i32 %6, double %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca float
%12 = alloca i64
%13 = alloca double
%14 = alloca i8
%15 = alloca float
%16 = alloca i16
%17 = alloca double
%18 = fptrunc double %1 to float
%19 = trunc i32 %4 to i8
%20 = fptrunc double %5 to float
%21 = trunc i32 %6 to i16
store i32 %0, i32* %10
store float %18, float* %11
store i64 %2, i64* %12
store double %3, double* %13
store i8 %19, i8* %14
store float %20, float* %15
store i16 %21, i16* %16
store double %7, double* %17
store i8 97, i8* %14
store float 0.000000e+00, float* %15
store i16 5, i16* %16
store double 0.000000e+00, double* %17
store i32 6, i32* %10
store float 0x3FB99999A0000000, float* %11
store i64 7, i64* %12
store double 2.000000e-01, double* %13
%22 = load i32, i32* %9
ret i32 %22
}

LLVM IR (-O2):
define i32 @call2e(i32 %0, double %1, i64 %2, double %3, i32 %4, double %5, i32 %6, double %7) {
ret i32 undef
}
/* Variables and functions */
unsigned int decode(char **);
unsigned int decode_color(char **data) { return decode(data); }


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

x86 assembly (clang, -O2):
<decode_color>:
jmp    1030 <decode@plt>

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

LLVM IR (-O2):
define i32 @decode_color(i8** %0) {
%2 = tail call i32 @decode(i8** %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void donald(void) { puts("Donald"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"Donald\00"
define void @donald() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
const char *Cast_Name(void) { return "Cast"; }


x86 assembly (clang, -O0):
<Cast_Name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cast_Name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Cast\00"
define i8* @Cast_Name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"Cast\00"
define i8* @Cast_Name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ fun(int *, int, int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, oddSum, evenSum;
  fun(a, 10, &oddSum, &evenSum);
  printf("sum of odd=%d,even=%d\n", oddSum, evenSum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
lea    -0x34(%rbp),%rdx
lea    -0x38(%rbp),%rcx
call   1030 <fun@plt>
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    $0xa,%esi
call   1030 <fun@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [23 x i8] c"sum of odd=%d,even=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [10 x i32]* %2 to i8*
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = call i32 @fun(i32* %6, i32 10, i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [23 x i8] c"sum of odd=%d,even=%d\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [10 x i32]* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = call i32 @fun(i32* %7, i32 10, i32* %2, i32* %3)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}