xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
void usage_and_exit(char *s) {
  printf("%s: %s [01]  (0 = no locks, 1 = locks)\n", s, s);
  exit(0);
}


x86 assembly (clang, -O0):
<usage_and_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage_and_exit>:
push   %rax
mov    %rdi,%rdx
lea    0xed5(%rip),%rdi
mov    %rdx,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"%s: %s [01] (0 = no locks, 1 = locks)\0A\00"
define void @usage_and_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [40 x i8] c"%s: %s [01] (0 = no locks, 1 = locks)\0A\00"
define void @usage_and_exit(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ UInt32GetLE(void const *);
size_t _pkhHash(const void *pkh) { return (size_t)UInt32GetLE(pkh); }


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

x86 assembly (clang, -O2):
<_pkhHash>:
push   %rax
call   1030 <UInt32GetLE@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @_pkhHash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @UInt32GetLE(i8* %3)
%5 = sext i32 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @_pkhHash(i8* %0) {
%2 = tail call i32 @UInt32GetLE(i8* %0)
%3 = sext i32 %2 to i64
ret i64 %3
}
float remainingAngle(float angleA, float angleB) {
  return 180.0 - angleA - angleB;
}


x86 assembly (clang, -O0):
<remainingAngle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee1(%rip),%xmm0
subsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<remainingAngle>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm2
subsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
subsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @remainingAngle(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = fsub double 1.800000e+02, %6
%8 = load float, float* %4
%9 = fpext float %8 to double
%10 = fsub double %7, %9
%11 = fptrunc double %10 to float
ret float %11
}

LLVM IR (-O2):
define float @remainingAngle(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fsub double 1.800000e+02, %3
%5 = fpext float %1 to double
%6 = fsub double %4, %5
%7 = fptrunc double %6 to float
ret float %7
}
const char *event_get_version(void) {
  return "4"
         "."
         "1";
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"4.1\00"
define i8* @event_get_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World\n Just like the Repo name ;)\nNow we are doing some "
         "Testing Stuff in here");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [84 x i8] c"Hello World\0A Just like the Repo name ;)\0ANow we are doing some Testing Stuff in here\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [84 x i8] c"Hello World\0A Just like the Repo name ;)\0ANow we are doing some Testing Stuff in here\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int test_imm_46int64_midword_reg(long long val) {
  return ((val >> 16) & (0x46 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_46int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x46,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_46int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 70
%6 = icmp ne i64 %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_46int64_midword_reg(i64 %0) {
%2 = and i64 %0, 4587520
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void PtoK(x, y, u, v) float *x, *y, u, v;
{
  *x = 2 * u / (1 + u * u + v * v);
  *y = 2 * v / (1 + u * u + v * v);
}


x86 assembly (clang, -O0):
<PtoK>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x20(%rbp)
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
movss  %xmm0,-0x18(%rbp)
movss  0xed1(%rip),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  -0x14(%rbp),%xmm2
movss  -0x14(%rbp),%xmm1
mulss  %xmm1,%xmm2
movss  0xeb2(%rip),%xmm1
addss  %xmm1,%xmm2
movss  -0x18(%rbp),%xmm1
movss  -0x18(%rbp),%xmm3
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  0xe8c(%rip),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm2
movss  -0x14(%rbp),%xmm1
mulss  %xmm1,%xmm2
movss  0xe6d(%rip),%xmm1
addss  %xmm1,%xmm2
movss  -0x18(%rbp),%xmm1
movss  -0x18(%rbp),%xmm3
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PtoK>:
cvtsd2ss %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm1
movaps %xmm0,%xmm2
mulss  %xmm0,%xmm0
addss  0xee9(%rip),%xmm0
addss  %xmm2,%xmm2
movaps %xmm1,%xmm3
mulss  %xmm1,%xmm3
addss  %xmm0,%xmm3
divss  %xmm3,%xmm2
movss  %xmm2,(%rdi)
addss  %xmm1,%xmm1
divss  %xmm3,%xmm1
movss  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @PtoK(float* %0, float* %1, double %2, double %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca float
%8 = alloca float
%9 = fptrunc double %2 to float
%10 = fptrunc double %3 to float
store float* %0, float** %5
store float* %1, float** %6
store float %9, float* %7
store float %10, float* %8
%11 = load float, float* %7
%12 = fmul float 2.000000e+00, %11
%13 = load float, float* %7
%14 = load float, float* %7
%15 = call float @llvm.fmuladd.f32(float %13, float %14, float 1.000000e+00)
%16 = load float, float* %8
%17 = load float, float* %8
%18 = call float @llvm.fmuladd.f32(float %16, float %17, float %15)
%19 = fdiv float %12, %18
%20 = load float*, float** %5
store float %19, float* %20
%21 = load float, float* %8
%22 = fmul float 2.000000e+00, %21
%23 = load float, float* %7
%24 = load float, float* %7
%25 = call float @llvm.fmuladd.f32(float %23, float %24, float 1.000000e+00)
%26 = load float, float* %8
%27 = load float, float* %8
%28 = call float @llvm.fmuladd.f32(float %26, float %27, float %25)
%29 = fdiv float %22, %28
%30 = load float*, float** %6
store float %29, float* %30
ret void
}

LLVM IR (-O2):
define void @PtoK(float* nocapture writeonly %0, float* nocapture writeonly %1, double %2, double %3) {
%5 = fptrunc double %2 to float
%6 = fptrunc double %3 to float
%7 = fmul float %5, 2.000000e+00
%8 = tail call float @llvm.fmuladd.f32(float %5, float %5, float 1.000000e+00)
%9 = tail call float @llvm.fmuladd.f32(float %6, float %6, float %8)
%10 = fdiv float %7, %9
store float %10, float* %0
%11 = fmul float %6, 2.000000e+00
%12 = fdiv float %11, %9
store float %12, float* %1
ret void
}
/* Variables and functions */
int expect_line_break_or(char);
int expect_line_break_or_semicolon() { return expect_line_break_or(';'); }


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

x86 assembly (clang, -O2):
<expect_line_break_or_semicolon>:
mov    $0x3b,%edi
jmp    1030 <expect_line_break_or@plt>

LLVM IR (-O0):
define i32 @expect_line_break_or_semicolon() {
%1 = call i32 @expect_line_break_or(i8 signext 59)
ret i32 %1
}

LLVM IR (-O2):
define i32 @expect_line_break_or_semicolon() {
%1 = tail call i32 @expect_line_break_or(i8 signext 59)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void gtk_drag_set_icon_gicon(void *context, void *icon, int hot_x, int hot_y) {
  printf("gtk_drag_set_icon_gicon not implemented");
}


x86 assembly (clang, -O0):
<gtk_drag_set_icon_gicon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [40 x i8] c"gtk_drag_set_icon_gicon not implemented\00"
define void @gtk_drag_set_icon_gicon(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"gtk_drag_set_icon_gicon not implemented\00"
define void @gtk_drag_set_icon_gicon(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct socketlist_struct {
  int dummy;
};
struct elasticarray {
  int dummy;
};

/* Variables and functions */
int elasticarray_truncate(struct elasticarray *);
int socketlist_truncate(struct socketlist_struct *EA) {
  return (elasticarray_truncate((struct elasticarray *)EA));
}


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

x86 assembly (clang, -O2):
<socketlist_truncate>:
jmp    1030 <elasticarray_truncate@plt>

LLVM IR (-O0):
%struct.socketlist_struct = type { i32 }
%struct.elasticarray = type { i32 }
define i32 @socketlist_truncate(%struct.socketlist_struct* %0) {
%2 = alloca %struct.socketlist_struct*
store %struct.socketlist_struct* %0, %struct.socketlist_struct** %2
%3 = load %struct.socketlist_struct*, %struct.socketlist_struct** %2
%4 = bitcast %struct.socketlist_struct* %3 to %struct.elasticarray*
%5 = call i32 @elasticarray_truncate(%struct.elasticarray* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.socketlist_struct = type { i32 }
%struct.elasticarray = type { i32 }
define i32 @socketlist_truncate(%struct.socketlist_struct* %0) {
%2 = bitcast %struct.socketlist_struct* %0 to %struct.elasticarray*
%3 = tail call i32 @elasticarray_truncate(%struct.elasticarray* %2)
ret i32 %3
}
void xmpp_shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @xmpp_shutdown() {
ret void
}
void io_con_flush() {}


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

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

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

LLVM IR (-O2):
define void @io_con_flush() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ malloc(unsigned int);
int /*<<< orphan*/ stderr;
void *xmalloc(unsigned int size) {
  void *ptr = NULL;
  if ((ptr = (void *)malloc(size)) == NULL) {
    fprintf(stderr, "WARNING: Out of memory, buy more RAM!\n");
    return (NULL);
  }
  return (ptr);
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    116b <xmalloc+0x4b>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
call   1030 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
jmp    1173 <xmalloc+0x53>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     112d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"WARNING: Out of memory, buy more RAM!\0A\00"
define i8* @xmalloc(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* null, i8** %4
%5 = load i32, i32* %3
%6 = call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %2
br label %14
12: ; preds = %1
%13 = load i8*, i8** %4
store i8* %13, i8** %2
br label %14
14: ; preds = %12, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"WARNING: Out of memory, buy more RAM!\0A\00"
define i8* @xmalloc(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = inttoptr i64 %2 to i8*
br label %9
9: ; preds = %7, %4
%10 = phi i8* [ null, %4 ], [ %8, %7 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void check_args(int index, int argc) {
  if ((argc - index) == 0) {
    printf("Error no archive file specified!\n");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<check_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
cmp    $0x0,%eax
jne    1153 <check_args+0x33>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_args>:
cmp    %edi,%esi
je     1125 <check_args+0x5>
ret
push   %rax
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Error no archive file specified!\0A\00"
define void @check_args(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"Error no archive file specified!\00"
define void @check_args(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, %0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GPIO1_INT2_DriverIRQHandler();
__attribute__((weak)) void GPIO1_INT2_IRQHandler(void) {
  GPIO1_INT2_DriverIRQHandler();
}


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

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

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

LLVM IR (-O2):
define weak void @GPIO1_INT2_IRQHandler() {
%1 = tail call i32 (...) @GPIO1_INT2_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _sys_cls();
int /*<<< orphan*/ _sys_printf(char *, char const *);
void _sys_freeze(const char *msg) {
  _sys_cls();
  _sys_printf("fatal error: %s\n", msg);
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<_sys_freeze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <_sys_cls@plt>
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1040 <_sys_printf@plt>
jmp    1143 <_sys_freeze+0x23>

x86 assembly (clang, -O2):
<_sys_freeze>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <_sys_cls@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
call   1040 <_sys_printf@plt>
nopw   0x0(%rax,%rax,1)
jmp    1140 <_sys_freeze+0x20>

LLVM IR (-O0):
@.str = [17 x i8] c"fatal error: %s\0A\00"
define void @_sys_freeze(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @_sys_cls()
%4 = load i8*, i8** %2
%5 = call i32 @_sys_printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
br label %6
6: ; preds = %6, %1
br label %6
}

LLVM IR (-O2):
@.str = [17 x i8] c"fatal error: %s\0A\00"
define void @_sys_freeze(i8* %0) {
%2 = tail call i32 (...) @_sys_cls()
%3 = tail call i32 @_sys_printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %4
4: ; preds = %4, %1
br label %4
}
void ARGBToUV444Row_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToUV444Row_Any_SSSE3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void NEG_HOST_REG_L(int reg) {
  if (reg & 8)
    addbyte(0x41);
  addbyte(0xf7);
  addbyte(0xd8 | (reg & 7));
}


x86 assembly (clang, -O0):
<NEG_HOST_REG_L>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1134 <NEG_HOST_REG_L+0x24>
mov    $0x41,%edi
call   1030 <addbyte@plt>
mov    $0xf7,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
or     $0xd8,%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NEG_HOST_REG_L>:
push   %rbx
mov    %edi,%ebx
test   $0x8,%bl
je     1122 <NEG_HOST_REG_L+0x12>
mov    $0x41,%edi
call   1030 <addbyte@plt>
mov    $0xf7,%edi
call   1030 <addbyte@plt>
and    $0x7,%ebx
or     $0xd8,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @NEG_HOST_REG_L(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 8
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @addbyte(i32 65)
br label %8
8: ; preds = %6, %1
%9 = call i32 @addbyte(i32 247)
%10 = load i32, i32* %2
%11 = and i32 %10, 7
%12 = or i32 216, %11
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @NEG_HOST_REG_L(i32 %0) {
%2 = and i32 %0, 8
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @addbyte(i32 65)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @addbyte(i32 247)
%8 = and i32 %0, 7
%9 = or i32 %8, 216
%10 = tail call i32 @addbyte(i32 %9)
ret void
}
int close(int fd) {
  int result;
  asm("movl $6, %%eax;"
      "int $0x80;"
      : "=a"(result)
      : "b"(fd));
  return result;
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%ebx
mov    $0x6,%eax
int    $0x80
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
push   %rbx
mov    %edi,%ebx
mov    $0x6,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define i32 @close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm "movl $$6, %eax;int $$0x80;", "={ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = tail call i32 asm "movl $$6, %eax;int $$0x80;", "={ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void bugsfree(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<bugsfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @bugsfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int SetWindowTextA(HWND, LPCSTR) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @SetWindowTextA(i32 %0, i32 %1) {
ret i32 0
}
int lets_keep_xcode_codesigning_happy_la_la_la() { return 42; }


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

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

LLVM IR (-O0):
define i32 @lets_keep_xcode_codesigning_happy_la_la_la() {
ret i32 42
}

LLVM IR (-O2):
define i32 @lets_keep_xcode_codesigning_happy_la_la_la() {
ret i32 42
}
int getDValue(int value, int d) {
  for (; d > 0 && value > 0; d--) {
    value = value / 10;
  }
  return value % 10;
}


x86 assembly (clang, -O0):
<getDValue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jle    1123 <getDValue+0x23>
cmpl   $0x0,-0x4(%rbp)
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1133 <getDValue+0x33>
jmp    114f <getDValue+0x4f>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    110a <getDValue+0xa>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDValue>:
test   %esi,%esi
jle    112b <getDValue+0x2b>
test   %edi,%edi
jle    112b <getDValue+0x2b>
mov    $0xcccccccd,%ecx
nopl   (%rax)
mov    %edi,%eax
imul   %rcx,%rax
shr    $0x23,%rax
cmp    $0x2,%esi
jb     112d <getDValue+0x2d>
add    $0xffffffff,%esi
cmp    $0x9,%edi
mov    %eax,%edi
ja     1110 <getDValue+0x10>
jmp    112d <getDValue+0x2d>
mov    %edi,%eax
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @getDValue(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %16, %2
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, 0
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
br i1 %12, label %13, label %19
13: ; preds = %11
%14 = load i32, i32* %3
%15 = sdiv i32 %14, 10
store i32 %15, i32* %3
br label %16
16: ; preds = %13
%17 = load i32, i32* %4
%18 = add nsw i32 %17, -1
store i32 %18, i32* %4
br label %5
19: ; preds = %11
%20 = load i32, i32* %3
%21 = srem i32 %20, 10
ret i32 %21
}

LLVM IR (-O2):
define i32 @getDValue(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
%4 = icmp sgt i32 %0, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %14
6: ; preds = %2, %6
%7 = phi i32 [ %10, %6 ], [ %1, %2 ]
%8 = phi i32 [ %9, %6 ], [ %0, %2 ]
%9 = udiv i32 %8, 10
%10 = add nsw i32 %7, -1
%11 = icmp ugt i32 %7, 1
%12 = icmp ugt i32 %8, 9
%13 = select i1 %11, i1 %12, i1 false
br i1 %13, label %6, label %14
14: ; preds = %6, %2
%15 = phi i32 [ %0, %2 ], [ %9, %6 ]
%16 = srem i32 %15, 10
ret i32 %16
}
int rsn_preauth_scan_results(struct wpa_sm *sm) { return -1; }


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

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

LLVM IR (-O0):
%struct.wpa_sm = type opaque
define i32 @rsn_preauth_scan_results(%struct.wpa_sm* %0) {
%2 = alloca %struct.wpa_sm*
store %struct.wpa_sm* %0, %struct.wpa_sm** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.wpa_sm = type opaque
define i32 @rsn_preauth_scan_results(%struct.wpa_sm* nocapture readnone %0) {
ret i32 -1
}
unsigned long check_password(const char *p) {
  int *ip = (int *)p;
  int i;
  int res = 0;
  for (i = 0; i < 5; i++) {
    res += ip[i];
  }
  return res;
}


x86 assembly (clang, -O0):
<check_password>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    1147 <check_password+0x47>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111e <check_password+0x1e>
movslq -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_password>:
movslq (%rdi),%rcx
movdqu 0x4(%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
cltq
add    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @check_password(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = bitcast i8* %4 to <4 x i32>*
%6 = load <4 x i32>, <4 x i32>* %5
%7 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %6)
%8 = add nsw i32 %7, %3
%9 = sext i32 %8 to i64
ret i64 %9
}
int hash_str(char *s) {
  int i;
  i = 0;
  while (*s)
    i = i * 251 + (*s++);
  return (i & 0xFFF);
}


x86 assembly (clang, -O0):
<hash_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113f <hash_str+0x3f>
imul   $0xfb,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash_str+0xf>
mov    -0xc(%rbp),%eax
and    $0xfff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_str>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <hash_str+0x2c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
imul   $0xfb,%eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_str+0x10>
and    $0xfff,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hash_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = load i32, i32* %3
%10 = mul nsw i32 %9, 251
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i8, i8* %11
%14 = sext i8 %13 to i32
%15 = add nsw i32 %10, %14
store i32 %15, i32* %3
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
%18 = and i32 %17, 4095
ret i32 %18
}

LLVM IR (-O2):
define i32 @hash_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul nsw i32 %6, 251
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add nsw i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 4095
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
int get_next_mlfq_to_assess(int mlfq_to_assess) {
  int next_mlfq = (mlfq_to_assess - 1);
  if (next_mlfq < 0) {
    next_mlfq = 4 - 1;
  }
  return next_mlfq;
}


x86 assembly (clang, -O0):
<get_next_mlfq_to_assess>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1121 <get_next_mlfq_to_assess+0x21>
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_mlfq_to_assess>:
lea    -0x1(%rdi),%ecx
test   %edi,%edi
mov    $0x3,%eax
cmovg  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get_next_mlfq_to_assess(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 3, i32* %3
br label %9
9: ; preds = %8, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_next_mlfq_to_assess(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = icmp slt i32 %0, 1
%4 = select i1 %3, i32 3, i32 %2
ret i32 %4
}
/* Variables and functions */
int color_eqn(int, int, int, int, int, int);
int g_cyg_cymg_yemg(int entrycyg, int entrycymg, int entryyeg, int entryyemg) {
  return color_eqn(86, entrycyg, 12, entryyemg, -57, entrycymg);
}


x86 assembly (clang, -O0):
<g_cyg_cymg_yemg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%r9d
mov    $0x56,%edi
mov    $0xc,%edx
mov    $0xffffffc7,%r8d
call   1030 <color_eqn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_cyg_cymg_yemg>:
mov    %esi,%r9d
mov    %edi,%esi
mov    $0x56,%edi
mov    $0xc,%edx
mov    $0xffffffc7,%r8d
jmp    1030 <color_eqn@plt>

LLVM IR (-O0):
define i32 @g_cyg_cymg_yemg(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = call i32 @color_eqn(i32 86, i32 %9, i32 12, i32 %10, i32 -57, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @g_cyg_cymg_yemg(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @color_eqn(i32 86, i32 %0, i32 12, i32 %3, i32 -57, i32 %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int main(void) {
  char words[5];
  puts("Ente a string, please.");
  gets(words);
  printf("Your string twice:\n");
  printf("%s\n", words);
  puts(words);
  puts("Done.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
lea    -0x9(%rbp),%rdi
call   1050 <gets@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x9(%rbp),%rsi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x9(%rbp),%rdi
call   1030 <puts@plt>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
lea    0xb(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Ente a string, please.\00"
@.str.1 = [20 x i8] c"Your string twice:\0A\00"
@.str.2 = [4 x i8] c"%s\0A\00"
@.str.3 = [6 x i8] c"Done.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
store i32 0, i32* %1
%3 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%10 = call i32 @puts(i8* %9)
%11 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Ente a string, please.\00"
@.str.3 = [6 x i8] c"Done.\00"
@str = [19 x i8] c"Your string twice:\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%6 = call i32 @puts(i8* %2)
%7 = call i32 @puts(i8* %2)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ toupper(int);
void strupc(char *str) {
  while (*str) {
    *str = (char)toupper((int)*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<strupc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <strupc+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <strupc+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @strupc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = call i64 @toupper(i32 %10)
%12 = trunc i64 %11 to i8
%13 = load i8*, i8** %2
store i8 %12, i8* %13
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %2
br label %3
16: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @strupc(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i64 @toupper(i32 %7)
%9 = trunc i64 %8 to i8
store i8 %9, i8* %6
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int putc(int, int /*<<< orphan*/ *);
int outc(int c, void *cl) {
  FILE *f = cl;
  return putc(c, f);
}


x86 assembly (clang, -O0):
<outc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <putc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outc>:
jmp    1030 <putc@plt>

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

LLVM IR (-O2):
define i32 @outc(i32 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = tail call i32 @putc(i32 %0, i32* %3)
ret i32 %4
}
/* Variables and functions */
size_t backtrace(void **, int);
size_t get_backtrace(void ***backtrace_ptrs) {
  size_t bt_size;
  bt_size = backtrace(*backtrace_ptrs, 50);
  return bt_size;
}


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

x86 assembly (clang, -O2):
<get_backtrace>:
mov    (%rdi),%rdi
mov    $0x32,%esi
jmp    1030 <backtrace@plt>

LLVM IR (-O0):
define i64 @get_backtrace(i8*** %0) {
%2 = alloca i8***
%3 = alloca i64
store i8*** %0, i8**** %2
%4 = load i8***, i8**** %2
%5 = load i8**, i8*** %4
%6 = call i64 @backtrace(i8** %5, i32 50)
store i64 %6, i64* %3
%7 = load i64, i64* %3
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_backtrace(i8*** nocapture %0) {
%2 = load i8**, i8*** %0
%3 = tail call i64 @backtrace(i8** %2, i32 50)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ print_hex_dump(char *, char *, int /*<<< orphan*/, int, int,
                                  unsigned char const *, unsigned int,
                                  int /*<<< orphan*/);
void hexdump(const unsigned char *buf, unsigned int len) {
  print_hex_dump("", "", 0, 16, 1, buf, len, 0);
}


x86 assembly (clang, -O0):
<hexdump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%r9
mov    -0xc(%rbp),%eax
lea    0xed3(%rip),%rsi
xor    %edx,%edx
mov    $0x10,%ecx
mov    $0x1,%r8d
mov    %rsi,%rdi
mov    %eax,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <print_hex_dump@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdump>:
push   %rax
mov    %esi,%eax
mov    %rdi,%r9
lea    0xee3(%rip),%rdi
mov    %rdi,%rsi
xor    %edx,%edx
mov    $0x10,%ecx
mov    $0x1,%r8d
push   $0x0
push   %rax
call   1030 <print_hex_dump@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @hexdump(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @print_hex_dump(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0, i32 16, i32 1, i8* %5, i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @hexdump(i8* %0, i32 %1) {
%3 = tail call i32 @print_hex_dump(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0, i32 16, i32 1, i8* %0, i32 %1, i32 0)
ret void
}
/* Variables and functions */
int inp_emulate(int);
char TOSH_READ_BOOST_ENABLE_PIN() { return 0x01 & (inp_emulate(0x71) >> 4); }


x86 assembly (clang, -O0):
<TOSH_READ_BOOST_ENABLE_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x71,%edi
call   1030 <inp_emulate@plt>
sar    $0x4,%eax
and    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_READ_BOOST_ENABLE_PIN>:
push   %rax
mov    $0x71,%edi
call   1030 <inp_emulate@plt>
shr    $0x4,%al
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @TOSH_READ_BOOST_ENABLE_PIN() {
%1 = call i32 @inp_emulate(i32 113)
%2 = ashr i32 %1, 4
%3 = and i32 1, %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @TOSH_READ_BOOST_ENABLE_PIN() {
%1 = tail call i32 @inp_emulate(i32 113)
%2 = trunc i32 %1 to i8
%3 = lshr i8 %2, 4
%4 = and i8 %3, 1
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ die_oom(size_t);
void *malloc(size_t);
void *mem_alloc(size_t size) {
  void *ptr = malloc(size);
  if (!ptr)
    die_oom(size);
  return ptr;
}


x86 assembly (clang, -O0):
<mem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114d <mem_alloc+0x2d>
mov    -0x8(%rbp),%rdi
call   1030 <die_oom@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_alloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <mem_alloc+0x1c>
mov    %r14,%rdi
call   1030 <die_oom@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpge_ps(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_cmpge_ps(__m128 __a, __m128 __b) {
  return _mm_cmpge_ps(__a, __b);
}


x86 assembly (clang, -O0):
<test_mm_cmpge_ps>:
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_cmpge_ps@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_cmpge_ps>:
jmp    1030 <_mm_cmpge_ps@plt>

LLVM IR (-O0):
define i32 @test_mm_cmpge_ps(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_cmpge_ps(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_cmpge_ps(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpge_ps(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int islower(int /*<<< orphan*/);
int iswlower(wint_t wc) { return islower(wc); }


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

x86 assembly (clang, -O2):
<iswlower>:
jmp    1030 <islower@plt>

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

LLVM IR (-O2):
define i32 @iswlower(i32 %0) {
%2 = tail call i32 @islower(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, n, fakt = 1;
  n = 10;
  for (i = 1; i <= n; i++)
    fakt = fakt * i;
  printf("%d\n", fakt);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0xa,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1158 <main+0x48>
mov    -0x10(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
mov    -0x10(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3628800)
ret i32 0
}