xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

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

/* Variables and functions */
void set_XEvent_xany_window(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xany.window = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XEvent_xany_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void test_copying_vals() {}


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

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

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

LLVM IR (-O2):
define void @test_copying_vals() {
ret void
}
/* Variables and functions */
int hostap_ioctl_readmif(char const *, int);
int /*<<< orphan*/ printf(char *, int, char const *, int, char const *);
void show_bbp_cr(const char *dev, int cr, const char *desc, const char *extra) {
  int res;
  res = hostap_ioctl_readmif(dev, cr);
  if (res >= 0)
    printf("CR%d (%s): %d%s\n", cr, desc, res, extra);
}


x86 assembly (clang, -O0):
<show_bbp_cr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <hostap_ioctl_readmif@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     116a <show_bbp_cr+0x4a>
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%r8
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_bbp_cr>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %esi,%ebp
call   1040 <hostap_ioctl_readmif@plt>
test   %eax,%eax
js     114f <show_bbp_cr+0x2f>
lea    0xec4(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
mov    %r14,%r8
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"CR%d (%s): %d%s\0A\00"
define void @show_bbp_cr(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @hostap_ioctl_readmif(i8* %0, i32 %1)
%6 = icmp sgt i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2, i32 %5, i8* %3)
br label %9
9: ; preds = %7, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pila_tests();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puntoA_test_debe_devolver_cero_si_la_pila_esta_vacia();
int /*<<< orphan*/ puntoA_test_debe_eliminar_todos_los_elementos_de_x();
int main() {
  pila_tests();
  puntoA_test_debe_devolver_cero_si_la_pila_esta_vacia();
  puntoA_test_debe_eliminar_todos_los_elementos_de_x();
  printf("Hello world!\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <pila_tests@plt>
xor    %eax,%eax
call   1030 <puntoA_test_debe_devolver_cero_si_la_pila_esta_vacia@plt>
xor    %eax,%eax
call   1050 <puntoA_test_debe_eliminar_todos_los_elementos_de_x@plt>
lea    0xea3(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @pila_tests()
%3 = call i32 (...) @puntoA_test_debe_devolver_cero_si_la_pila_esta_vacia()
%4 = call i32 (...) @puntoA_test_debe_eliminar_todos_los_elementos_de_x()
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 (...) @pila_tests()
%2 = tail call i32 (...) @puntoA_test_debe_devolver_cero_si_la_pila_esta_vacia()
%3 = tail call i32 (...) @puntoA_test_debe_eliminar_todos_los_elementos_de_x()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int shim_getrandom(void *, int, int /*<<< orphan*/);
int bad_getrandom(void *addr) { return shim_getrandom((void *)addr, 1024, 0); }


x86 assembly (clang, -O0):
<bad_getrandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x400,%esi
xor    %edx,%edx
call   1030 <shim_getrandom@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_getrandom>:
mov    $0x400,%esi
xor    %edx,%edx
jmp    1030 <shim_getrandom@plt>

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

LLVM IR (-O2):
define i32 @bad_getrandom(i8* %0) {
%2 = tail call i32 @shim_getrandom(i8* %0, i32 1024, i32 0)
ret i32 %2
}
/* Variables and functions */
int dwarf_get_CFA_name(unsigned int, char const **);
char const *ellipname(int, unsigned int, char const *, char *, int);
const char *get_CFA_name(unsigned int val_in, int printonerr) {
  const char *v = 0;
  int res = dwarf_get_CFA_name(val_in, &v);
  return ellipname(res, val_in, v, "CFA", printonerr);
}


x86 assembly (clang, -O0):
<get_CFA_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <dwarf_get_CFA_name@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%r8d
lea    0xea6(%rip),%rcx
call   1040 <ellipname@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_CFA_name>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <dwarf_get_CFA_name@plt>
mov    (%rsp),%rdx
lea    0xebe(%rip),%rcx
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%r8d
call   1040 <ellipname@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"CFA\00"
define i8* @get_CFA_name(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8* null, i8** %5
%7 = load i32, i32* %3
%8 = call i32 @dwarf_get_CFA_name(i32 %7, i8** %5)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %3
%11 = load i8*, i8** %5
%12 = load i32, i32* %4
%13 = call i8* @ellipname(i32 %9, i32 %10, i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i8* %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"CFA\00"
define i8* @get_CFA_name(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i32 @dwarf_get_CFA_name(i32 %0, i8** %3)
%6 = load i8*, i8** %3
%7 = call i8* @ellipname(i32 %5, i32 %0, i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* %7
}
void strtolower(dst, src) char *dst, *src;
{
  for (; *src; src++)
    *dst++ = tolower(*src);
  *dst = '\0';
}


x86 assembly (clang, -O0):
<strtolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115d <strtolower+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <strtolower+0x10>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtolower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rsi),%al
test   %al,%al
je     114a <strtolower+0x3a>
mov    %rsi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,(%r14)
add    $0x1,%r14
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strtolower+0x20>
movb   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @strtolower(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %14, %5 ], [ %3, %2 ]
%7 = phi i8* [ %13, %5 ], [ %1, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = tail call i32 @tolower(i32 %9)
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %11, i8* %8
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i8* [ %0, %2 ], [ %12, %5 ]
store i8 0, i8* %17
ret void
}
int multiply(float a, float b) {
  float res = 0;
  for (int j = 0; j < b; j++) {
    res += a;
  }
  return res;
}


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cvtsi2ssl -0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    114d <multiply+0x4d>
movss  -0x4(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111d <multiply+0x1d>
cvttss2si -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
xor    %eax,%eax
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm1
jbe    1127 <multiply+0x27>
mov    $0x1,%eax
nop
xorps  %xmm3,%xmm3
cvtsi2ss %eax,%xmm3
addss  %xmm0,%xmm2
add    $0x1,%eax
ucomiss %xmm3,%xmm1
ja     1110 <multiply+0x10>
cvttss2si %xmm2,%eax
ret

LLVM IR (-O0):
define i32 @multiply(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca i32
store float %0, float* %3
store float %1, float* %4
store float 0.000000e+00, float* %5
store i32 0, i32* %6
br label %7
7: ; preds = %16, %2
%8 = load i32, i32* %6
%9 = sitofp i32 %8 to float
%10 = load float, float* %4
%11 = fcmp olt float %9, %10
br i1 %11, label %12, label %19
12: ; preds = %7
%13 = load float, float* %3
%14 = load float, float* %5
%15 = fadd float %14, %13
store float %15, float* %5
br label %16
16: ; preds = %12
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %7
19: ; preds = %7
%20 = load float, float* %5
%21 = fptosi float %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @multiply(float %0, float %1) {
%3 = fcmp ogt float %1, 0.000000e+00
br i1 %3, label %8, label %6
4: ; preds = %8
%5 = fptosi float %11 to i32
br label %6
6: ; preds = %4, %2
%7 = phi i32 [ 0, %2 ], [ %5, %4 ]
ret i32 %7
8: ; preds = %2, %8
%9 = phi i32 [ %12, %8 ], [ 0, %2 ]
%10 = phi float [ %11, %8 ], [ 0.000000e+00, %2 ]
%11 = fadd float %10, %0
%12 = add nuw nsw i32 %9, 1
%13 = sitofp i32 %12 to float
%14 = fcmp olt float %13, %1
br i1 %14, label %8, label %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int find_job(int /*<<< orphan*/);
int /*<<< orphan*/ print_job(int);
void print_job_by_pgid(pid_t pgid) {
  int jid = find_job(pgid);
  print_job(jid);
}


x86 assembly (clang, -O0):
<print_job_by_pgid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <find_job@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <print_job@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_job_by_pgid>:
push   %rax
call   1030 <find_job@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <print_job@plt>

LLVM IR (-O0):
define void @print_job_by_pgid(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @find_job(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @print_job(i32 %6)
ret void
}

LLVM IR (-O2):
define void @print_job_by_pgid(i32 %0) {
%2 = tail call i32 @find_job(i32 %0)
%3 = tail call i32 @print_job(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void printe(char *str) {
  static int first = 1;
  if (!first)
    putc(' ', stdout);
  first = 0;
  fputs(str, stdout);
}


x86 assembly (clang, -O0):
<printe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpl   $0x0,0x2efd(%rip)
jne    114c <printe+0x2c>
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
mov    $0x20,%edi
call   1040 <putc@plt>
movl   $0x0,0x2eda(%rip)
mov    -0x8(%rbp),%rdi
mov    0x2e7f(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printe>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x1,0x2f09(%rip)
jne    1140 <printe+0x20>
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    $0x20,%edi
call   1040 <putc@plt>
movb   $0x1,0x2eed(%rip)
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@printe.first = internal global i32 1
@stdout = global i32 0
define void @printe(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @printe.first
%4 = icmp ne i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* @stdout
%7 = call i32 @putc(i8 signext 32, i32 %6)
br label %8
8: ; preds = %5, %1
store i32 0, i32* @printe.first
%9 = load i8*, i8** %2
%10 = load i32, i32* @stdout
%11 = call i32 @fputs(i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
@printe.first = internal unnamed_addr global i1 false
@stdout = global i32 0
define void @printe(i8* %0) {
%2 = load i1, i1* @printe.first
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @stdout
%5 = tail call i32 @putc(i8 signext 32, i32 %4)
br label %6
6: ; preds = %3, %1
store i1 true, i1* @printe.first
%7 = load i32, i32* @stdout
%8 = tail call i32 @fputs(i8* %0, i32 %7)
ret void
}
unsigned int g1(unsigned int a) { return a >> 24 | a << 8; }


x86 assembly (clang, -O0):
<g1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g1>:
mov    %edi,%eax
rol    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @g1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 24
%5 = load i32, i32* %2
%6 = shl i32 %5, 8
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @g1(i32 %0) {
%2 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 8)
ret i32 %2
}
int device_pm_add(struct device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define i32 @device_pm_add(%struct.device* nocapture readnone %0) {
ret i32 0
}
void sgx_debug_unload_state_remove_element() {}


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

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

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

LLVM IR (-O2):
define void @sgx_debug_unload_state_remove_element() {
ret void
}
/* Type definitions */
typedef char wint_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
scalar_t__ iswlower_l(char, int /*<<< orphan*/);
wint_t towupper_l(wint_t wc, locale_t locale) {
  if (iswlower_l(wc, locale)) {
    return wc - 'a' + 'A';
  }
  return wc;
}


x86 assembly (clang, -O0):
<towupper_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x2(%rbp),%al
mov    -0x8(%rbp),%esi
movsbl %al,%edi
call   1030 <iswlower_l@plt>
cmp    $0x0,%rax
je     114b <towupper_l+0x3b>
movsbl -0x2(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    1151 <towupper_l+0x41>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<towupper_l>:
push   %rbx
mov    %edi,%ebx
call   1030 <iswlower_l@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
movzbl %cl,%eax
cmove  %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @towupper_l(i8 signext %0, i32 %1) {
%3 = tail call i64 @iswlower_l(i8 signext %0, i32 %1)
%4 = icmp eq i64 %3, 0
%5 = add i8 %0, -32
%6 = select i1 %4, i8 %0, i8 %5
ret i8 %6
}
int __divsi3(int a __attribute__((unused)), int b __attribute__((unused))) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @__divsi3(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 @__divsi3(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ isalpha(char);
int /*<<< orphan*/ printf(char *, char);
void ICPrintCharValue(char charValue) {
  if (isalpha(charValue)) {
    printf("CharValue = %c\n", charValue);
  } else {
    printf("CharValue = %hhi\n", charValue);
  }
}


x86 assembly (clang, -O0):
<ICPrintCharValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%rax
je     1156 <ICPrintCharValue+0x36>
lea    0xeb8(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
jmp    1166 <ICPrintCharValue+0x46>
lea    0xeb3(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ICPrintCharValue>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalpha@plt>
test   %rax,%rax
lea    0xede(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"CharValue = %c\0A\00"
@.str.1 = [18 x i8] c"CharValue = %hhi\0A\00"
define void @ICPrintCharValue(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalpha(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8 signext %7)
br label %12
9: ; preds = %1
%10 = load i8, i8* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8 signext %10)
br label %12
12: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"CharValue = %c\0A\00"
@.str.1 = [18 x i8] c"CharValue = %hhi\0A\00"
define void @ICPrintCharValue(i8 signext %0) {
%2 = tail call i64 @isalpha(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 @printf(i8* %4, i8 signext %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t
hci_event_command_status_get_num_hci_command_packets(const uint8_t *event) {
  return event[3];
}


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

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

LLVM IR (-O0):
define i32 @hci_event_command_status_get_num_hci_command_packets(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hci_event_command_status_get_num_hci_command_packets(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
ret i32 %3
}
int test_imm_57int8_reg(signed char val) {
  return ((val) & (0x57 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_57int8_reg(i8 signext %0) {
%2 = and i8 %0, 87
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct log_stream {
  int dummy;
};

/* Variables and functions */
struct log_stream *log_stream_by_flags(int /*<<< orphan*/);
struct log_stream *log_default_stream(void) {
  return log_stream_by_flags(0);
}


x86 assembly (clang, -O0):
<log_default_stream>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <log_stream_by_flags@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.log_stream = type { i32 }
define %struct.log_stream* @log_default_stream() {
%1 = call %struct.log_stream* @log_stream_by_flags(i32 0)
ret %struct.log_stream* %1
}

LLVM IR (-O2):
%struct.log_stream = type { i32 }
define %struct.log_stream* @log_default_stream() {
%1 = tail call %struct.log_stream* @log_stream_by_flags(i32 0)
ret %struct.log_stream* %1
}
/* Variables and functions */
double atan(double);
double invmodDymola(double, double);
double tan_inverse(double x, double y, const char *ys) {
  double pi;
  double n;
  pi = 4 * atan(1);
  n = invmodDymola((y + pi / 2), pi);
  return atan(x) + n * pi;
}


x86 assembly (clang, -O0):
<tan_inverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  0xed2(%rip),%xmm0
call   1030 <atan@plt>
movaps %xmm0,%xmm1
movsd  0xeba(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xe97(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
call   1040 <invmodDymola@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <atan@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tan_inverse>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
movsd  0xec8(%rip),%xmm0
call   1030 <atan@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xebd(%rip),%xmm0
movsd  0xebd(%rip),%xmm1
call   1040 <invmodDymola@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <atan@plt>
movsd  0x8(%rsp),%xmm1
mulsd  0xe99(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @tan_inverse(double %0, double %1, i8* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i8*
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store i8* %2, i8** %6
%9 = call double @atan(double 1.000000e+00)
%10 = fmul double 4.000000e+00, %9
store double %10, double* %7
%11 = load double, double* %5
%12 = load double, double* %7
%13 = fdiv double %12, 2.000000e+00
%14 = fadd double %11, %13
%15 = load double, double* %7
%16 = call double @invmodDymola(double %14, double %15)
store double %16, double* %8
%17 = load double, double* %4
%18 = call double @atan(double %17)
%19 = load double, double* %8
%20 = load double, double* %7
%21 = call double @llvm.fmuladd.f64(double %19, double %20, double %18)
ret double %21
}

LLVM IR (-O2):
define double @tan_inverse(double %0, double %1, i8* nocapture readnone %2) {
%4 = tail call double @atan(double 1.000000e+00)
%5 = fadd double %1, 0x3FF921FB54442D18
%6 = tail call double @invmodDymola(double %5, double 0x400921FB54442D18)
%7 = tail call double @atan(double %0)
%8 = tail call double @llvm.fmuladd.f64(double %6, double 0x400921FB54442D18, double %7)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ ChebCellStruct_free(void *);
void cheb_free_cell(void *inCell) { ChebCellStruct_free(inCell); }


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

x86 assembly (clang, -O2):
<cheb_free_cell>:
jmp    1030 <ChebCellStruct_free@plt>

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

LLVM IR (-O2):
define void @cheb_free_cell(i8* %0) {
%2 = tail call i32 @ChebCellStruct_free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int setgroups(size_t n, const gid_t *groups) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<setgroups>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setgroups>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @setgroups(i64 %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
void XSetGraphicsExposures() {}


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

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

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

LLVM IR (-O2):
define void @XSetGraphicsExposures() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char const *, char const *, int);
int /*<<< orphan*/ unsetenv(char const *);
void Sys_SetEnv(const char *name, const char *value) {
  if (value && *value)
    setenv(name, value, 1);
  else
    unsetenv(name);
}


x86 assembly (clang, -O0):
<Sys_SetEnv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1162 <Sys_SetEnv+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1162 <Sys_SetEnv+0x42>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
jmp    116b <Sys_SetEnv+0x4b>
mov    -0x8(%rbp),%rdi
call   1040 <unsetenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_SetEnv>:
test   %rsi,%rsi
je     1134 <Sys_SetEnv+0x14>
cmpb   $0x0,(%rsi)
je     1134 <Sys_SetEnv+0x14>
mov    $0x1,%edx
jmp    1030 <setenv@plt>
jmp    1040 <unsetenv@plt>

LLVM IR (-O0):
define void @Sys_SetEnv(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %7
%13 = load i8*, i8** %3
%14 = load i8*, i8** %4
%15 = call i32 @setenv(i8* %13, i8* %14, i32 1)
br label %19
16: ; preds = %7, %2
%17 = load i8*, i8** %3
%18 = call i32 @unsetenv(i8* %17)
br label %19
19: ; preds = %16, %12
ret void
}

LLVM IR (-O2):
define void @Sys_SetEnv(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @setenv(i8* %0, i8* %1, i32 1)
br label %11
9: ; preds = %4, %2
%10 = tail call i32 @unsetenv(i8* %0)
br label %11
11: ; preds = %9, %7
ret void
}
/* Variables and functions */
int ds1621_write_value(int, int, int);
int write_CONF(int dev_fd, int reg) {
  return (ds1621_write_value(dev_fd, 0xAC, reg & 0xfe));
}


x86 assembly (clang, -O0):
<write_CONF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
and    $0xfe,%edx
mov    $0xac,%esi
call   1030 <ds1621_write_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_CONF>:
mov    %esi,%edx
and    $0xfe,%edx
mov    $0xac,%esi
jmp    1030 <ds1621_write_value@plt>

LLVM IR (-O0):
define i32 @write_CONF(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 = and i32 %6, 254
%8 = call i32 @ds1621_write_value(i32 %5, i32 172, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @write_CONF(i32 %0, i32 %1) {
%3 = and i32 %1, 254
%4 = tail call i32 @ds1621_write_value(i32 %0, i32 172, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test(char *, char *);
void TEST_float_to_int(void) {
  test("3.0", "main(){float f=3; printf(\"%.1f\", f);}");
  test("3", "main(){int i=3.0; printf(\"%d\", i);}");
}


x86 assembly (clang, -O0):
<TEST_float_to_int>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
call   1030 <test@plt>
lea    0xefc(%rip),%rdi
lea    0xef7(%rip),%rsi
call   1030 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST_float_to_int>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee5(%rip),%rsi
call   1030 <test@plt>
lea    0xeff(%rip),%rdi
lea    0xefa(%rip),%rsi
pop    %rax
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"3.0\00"
@.str.1 = [38 x i8] c"main(){float f=3; printf(\22%.1f\22, f);}\00"
@.str.2 = [2 x i8] c"3\00"
@.str.3 = [36 x i8] c"main(){int i=3.0; printf(\22%d\22, i);}\00"
define void @TEST_float_to_int() {
%1 = call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"3.0\00"
@.str.1 = [38 x i8] c"main(){float f=3; printf(\22%.1f\22, f);}\00"
@.str.2 = [2 x i8] c"3\00"
@.str.3 = [36 x i8] c"main(){int i=3.0; printf(\22%d\22, i);}\00"
define void @TEST_float_to_int() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ latency2();
int main(void) {
  latency2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @latency2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, unsigned int);
void scpy(char *dst, const char *src, unsigned int siz) {
  strncpy(dst, src, siz);
  dst[siz - 1] = '\0';
}


x86 assembly (clang, -O0):
<scpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scpy>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rdi,%r14
call   1030 <strncpy@plt>
add    $0xffffffff,%ebx
movb   $0x0,(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @scpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %2)
%5 = add i32 %2, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printusage() {
  printf("idiff (C) GPLv3 Brett M. Gordon\n");
  printf("makes a binary patch file\n");
  printf("idiff [options] <reference file> <object file> <output file>\n");
  printf("-u,\t\tUsage\n");
}


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

x86 assembly (clang, -O2):
<printusage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"idiff (C) GPLv3 Brett M. Gordon\0A\00"
@.str.1 = [27 x i8] c"makes a binary patch file\0A\00"
@.str.2 = [62 x i8] c"idiff [options] <reference file> <object file> <output file>\0A\00"
@.str.3 = [12 x i8] c"-u,\09\09Usage\0A\00"
define void @printusage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"idiff (C) GPLv3 Brett M. Gordon\00"
@str.4 = [26 x i8] c"makes a binary patch file\00"
@str.5 = [61 x i8] c"idiff [options] <reference file> <object file> <output file>\00"
@str.6 = [11 x i8] c"-u,\09\09Usage\00"
define void @printusage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __ISB();
int __get_SCTLR();
int /*<<< orphan*/ __set_SCTLR(int);
void MMU_Enable(void) {
  __set_SCTLR((__get_SCTLR() & ~(1 << 28) & ~(1 << 1)) | 1 | (1 << 29));
  __ISB();
}


x86 assembly (clang, -O0):
<MMU_Enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <__get_SCTLR@plt>
mov    %eax,%edi
and    $0xefffffff,%edi
and    $0xfffffffd,%edi
or     $0x1,%edi
or     $0x20000000,%edi
call   1050 <__set_SCTLR@plt>
mov    $0x0,%al
call   1030 <__ISB@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMU_Enable>:
push   %rax
xor    %eax,%eax
call   1040 <__get_SCTLR@plt>
and    $0xcffffffc,%eax
lea    0x20000001(%rax),%edi
call   1050 <__set_SCTLR@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__ISB@plt>

LLVM IR (-O0):
define void @MMU_Enable() {
%1 = call i32 (...) @__get_SCTLR()
%2 = and i32 %1, -268435457
%3 = and i32 %2, -3
%4 = or i32 %3, 1
%5 = or i32 %4, 536870912
%6 = call i32 @__set_SCTLR(i32 %5)
%7 = call i32 (...) @__ISB()
ret void
}

LLVM IR (-O2):
define void @MMU_Enable() {
%1 = tail call i32 (...) @__get_SCTLR()
%2 = and i32 %1, -805306372
%3 = or i32 %2, 536870913
%4 = tail call i32 @__set_SCTLR(i32 %3)
%5 = tail call i32 (...) @__ISB()
ret void
}
int test_fun(int x, int y) {
  int c = 0;
  while (!(x == y)) {
    if (x > y) {
      y = y + 1;
    } else {
      x = x + 1;
    }
    c = c + 1;
  }
  return c;
}


x86 assembly (clang, -O0):
<test_fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
xor    $0xff,%al
test   $0x1,%al
jne    1129 <test_fun+0x29>
jmp    115a <test_fun+0x5a>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1143 <test_fun+0x43>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114c <test_fun+0x4c>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_fun+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fun>:
xor    %eax,%eax
cmp    %esi,%edi
je     1127 <test_fun+0x27>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
xor    %ecx,%ecx
xor    %edx,%edx
cmp    %esi,%edi
setg   %cl
setle  %dl
add    %edx,%edi
add    %ecx,%esi
add    $0x1,%eax
cmp    %esi,%edi
jne    1110 <test_fun+0x10>
ret

LLVM IR (-O0):
define i32 @test_fun(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %21, %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = icmp eq i32 %7, %8
%10 = xor i1 %9, true
br i1 %10, label %11, label %24
11: ; preds = %6
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %21
18: ; preds = %11
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %21
21: ; preds = %18, %15
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @test_fun(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %16, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %14, %4 ], [ 0, %2 ]
%6 = phi i32 [ %13, %4 ], [ %1, %2 ]
%7 = phi i32 [ %11, %4 ], [ %0, %2 ]
%8 = icmp sgt i32 %7, %6
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = add nsw i32 %7, %10
%12 = zext i1 %8 to i32
%13 = add nsw i32 %6, %12
%14 = add nuw nsw i32 %5, 1
%15 = icmp eq i32 %11, %13
br i1 %15, label %16, label %4
16: ; preds = %4, %2
%17 = phi i32 [ 0, %2 ], [ %14, %4 ]
ret i32 %17
}
void unlock_flash(void) {}


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

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

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

LLVM IR (-O2):
define void @unlock_flash() {
ret void
}
/* Variables and functions */
int foo(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) { printf("%d\n", foo(0, 10)); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0xa,%esi
call   1040 <foo@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%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(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @foo(i32 0, i32 10)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 0, i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void remove_char(char *str, char garbage) {
  char *src, *dst;
  for (src = dst = str; *src != '\0'; src++) {
    *dst = *src;
    if (*dst != garbage)
      dst++;
  }
  *dst = '\0';
}


x86 assembly (clang, -O0):
<remove_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116b <remove_char+0x6b>
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
je     1155 <remove_char+0x55>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    115a <remove_char+0x5a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <remove_char+0x1a>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_char>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <remove_char+0x28>
lea    0x1(%rdi),%rax
nopw   0x0(%rax,%rax,1)
mov    %cl,(%rdi)
xor    %edx,%edx
cmp    %sil,%cl
setne  %dl
add    %rdx,%rdi
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <remove_char+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @remove_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %11, %5 ], [ %0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
store i8 %6, i8* %7
%9 = icmp ne i8 %6, %1
%10 = zext i1 %9 to i64
%11 = getelementptr i8, i8* %7, i64 %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i8* [ %0, %2 ], [ %11, %5 ]
store i8 0, i8* %16
ret void
}