xunge/DecIR huggingface dataset:
int main(void) {
  int *count, a;
  for (a = 1; a <= 300; a++) {
    *(count++);
    (*count)++;
    printf("%d %d %d\n", a, count, *count);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x12c,-0x14(%rbp)
jg     1173 <main+0x63>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%ebp
lea    0xee0(%rip),%r14
mov    (%rbx),%ecx
add    $0x1,%ecx
mov    %ecx,(%rbx)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebp
add    $0x4,%rbx
cmp    $0x12d,%ebp
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %8, %1 ]
%3 = phi i32* [ undef, %0 ], [ %4, %1 ]
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
store i32 %6, i32* %4
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32* %4, i32 %6)
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 301
br i1 %9, label %10, label %1
10: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("disasm Exec_File -o Assemble_File [-c]\n");
  printf("  -c : print comments for each instrs\n");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"disasm Exec_File -o Assemble_File [-c]\0A\00"
@.str.1 = [39 x i8] c" -c : print comments for each instrs\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [39 x i8] c"disasm Exec_File -o Assemble_File [-c]\00"
@str.2 = [38 x i8] c" -c : print comments for each instrs\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ read_mosaic_xgrid_order1_region(char const *, int *, int *,
                                                   int *, int *, double *,
                                                   int *, int *);
void read_mosaic_xgrid_order1_region_(const char *xgrid_file, int *i1, int *j1,
                                      int *i2, int *j2, double *area, int *isc,
                                      int *iec) {
  read_mosaic_xgrid_order1_region(xgrid_file, i1, j1, i2, j2, area, isc, iec);
}


x86 assembly (clang, -O0):
<read_mosaic_xgrid_order1_region_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <read_mosaic_xgrid_order1_region@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_mosaic_xgrid_order1_region_>:
jmp    1030 <read_mosaic_xgrid_order1_region@plt>

LLVM IR (-O0):
define void @read_mosaic_xgrid_order1_region_(i8* %0, i32* %1, i32* %2, i32* %3, i32* %4, double* %5, i32* %6, i32* %7) {
%9 = alloca i8*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca double*
%15 = alloca i32*
%16 = alloca i32*
store i8* %0, i8** %9
store i32* %1, i32** %10
store i32* %2, i32** %11
store i32* %3, i32** %12
store i32* %4, i32** %13
store double* %5, double** %14
store i32* %6, i32** %15
store i32* %7, i32** %16
%17 = load i8*, i8** %9
%18 = load i32*, i32** %10
%19 = load i32*, i32** %11
%20 = load i32*, i32** %12
%21 = load i32*, i32** %13
%22 = load double*, double** %14
%23 = load i32*, i32** %15
%24 = load i32*, i32** %16
%25 = call i32 @read_mosaic_xgrid_order1_region(i8* %17, i32* %18, i32* %19, i32* %20, i32* %21, double* %22, i32* %23, i32* %24)
ret void
}

LLVM IR (-O2):
define void @read_mosaic_xgrid_order1_region_(i8* %0, i32* %1, i32* %2, i32* %3, i32* %4, double* %5, i32* %6, i32* %7) {
%9 = tail call i32 @read_mosaic_xgrid_order1_region(i8* %0, i32* %1, i32* %2, i32* %3, i32* %4, double* %5, i32* %6, i32* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_powf();
scalar_t__ powf(float, float);
void test_powf(float f1, float f2) {
  if (powf(f1, f2) != powf(f1, f2))
    link_failure_powf();
}


x86 assembly (clang, -O0):
<test_powf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <powf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <powf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     116b <test_powf+0x4b>
mov    $0x0,%al
call   1040 <link_failure_powf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_powf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x8(%rsp)
call   1030 <powf@plt>
mov    %rax,%rbx
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
call   1030 <powf@plt>
cmp    %rax,%rbx
jne    1155 <test_powf+0x35>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_powf@plt>

LLVM IR (-O0):
define void @test_powf(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 = load float, float* %4
%7 = call i64 @powf(float %5, float %6)
%8 = load float, float* %3
%9 = load float, float* %4
%10 = call i64 @powf(float %8, float %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_powf()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_powf(float %0, float %1) {
%3 = tail call i64 @powf(float %0, float %1)
%4 = tail call i64 @powf(float %0, float %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_powf()
br label %8
8: ; preds = %6, %2
ret void
}
void rop3_80_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = ~*D;
  stk1 = T & stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_80_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_80_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_80_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %8
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = and i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %7
%20 = load i8, i8* %7
%21 = zext i8 %20 to i32
%22 = load i8, i8* %5
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = and i32 %21, %24
%26 = load i8, i8* %6
%27 = zext i8 %26 to i32
%28 = xor i32 %27, -1
%29 = and i32 %25, %28
%30 = load i8*, i8** %4
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = load i8, i8* %5
%34 = zext i8 %33 to i32
%35 = and i32 %32, %34
%36 = or i32 %29, %35
%37 = load i8*, i8** %4
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = load i8, i8* %6
%41 = zext i8 %40 to i32
%42 = and i32 %39, %41
%43 = or i32 %36, %42
%44 = trunc i32 %43 to i8
%45 = load i8*, i8** %4
store i8 %44, i8* %45
ret void
}

LLVM IR (-O2):
define void @rop3_80_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
int nf_hook_ingress(struct sk_buff *skb) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.sk_buff = type opaque
define i32 @nf_hook_ingress(%struct.sk_buff* nocapture readnone %0) {
ret i32 0
}
void ble_rsp_sm_passkey_entry(
    const struct ble_msg_sm_passkey_entry_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_sm_passkey_entry_rsp_t = type opaque
define void @ble_rsp_sm_passkey_entry(%struct.ble_msg_sm_passkey_entry_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void do_panic(const char *msg, const char *file, int line) {
  msg = NULL;
  file = NULL;
  line = 0;
  abort();
}


x86 assembly (clang, -O0):
<do_panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
define void @do_panic(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
store i8* null, i8** %4
store i8* null, i8** %5
store i32 0, i32* %6
%7 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @do_panic(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 (...) @abort()
unreachable
}
float quantum_real(float _Complex a) {
  float *p = (float *)&a;
  return p[0];
}


x86 assembly (clang, -O0):
<quantum_real>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @quantum_real(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca float*
%4 = bitcast { float, float }* %2 to <2 x float>*
store <2 x float> %0, <2 x float>* %4
%5 = bitcast { float, float }* %2 to float*
store float* %5, float** %3
%6 = load float*, float** %3
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
ret float %8
}

LLVM IR (-O2):
define float @quantum_real(<2 x float> %0) {
%2 = extractelement <2 x float> %0, i64 0
ret float %2
}
/* Type definitions */
typedef int uint32_t;
typedef int int8_t;

/* Variables and functions */
uint32_t murmur_rotl32(uint32_t x, int8_t r) {
  return (x << r) | (x >> (32 - r));
}


x86 assembly (clang, -O0):
<murmur_rotl32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<murmur_rotl32>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @murmur_rotl32(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @murmur_rotl32(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
float powf(float, float);
float sinf(float);
float elastic_ease_in(float p) {
  return sinf(13.0f * 1.5707963268f * p) * powf(2.0f, 10.0f * (p - 1.0f));
}


x86 assembly (clang, -O0):
<elastic_ease_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xed7(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeb7(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xea7(%rip),%xmm1
mulss  %xmm0,%xmm1
movss  0xe97(%rip),%xmm0
call   1040 <powf@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elastic_ease_in>:
push   %rax
movaps %xmm0,%xmm1
movss  %xmm0,(%rsp)
movss  0xecf(%rip),%xmm0
mulss  %xmm1,%xmm0
call   1030 <sinf@plt>
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
addss  0xeb7(%rip),%xmm0
mulss  0xeb3(%rip),%xmm0
call   1040 <exp2f@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @elastic_ease_in(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float 0x40346B9C40000000, %3
%5 = call float @sinf(float %4)
%6 = load float, float* %2
%7 = fsub float %6, 1.000000e+00
%8 = fmul float 1.000000e+01, %7
%9 = call float @powf(float 2.000000e+00, float %8)
%10 = fmul float %5, %9
ret float %10
}

LLVM IR (-O2):
define float @elastic_ease_in(float %0) {
%2 = fmul float %0, 0x40346B9C40000000
%3 = tail call float @sinf(float %2)
%4 = fadd float %0, -1.000000e+00
%5 = fmul float %4, 1.000000e+01
%6 = tail call float @exp2f(float %5)
%7 = fmul float %3, %6
ret float %7
}
int bitwise_xor(int x, int y) { return x ^ y; }


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

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

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

LLVM IR (-O2):
define i32 @bitwise_xor(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_wsr(char *, unsigned int);
void wsr(unsigned v) { __builtin_arm_wsr("cp1:2:c3:c4:5", v); }


x86 assembly (clang, -O0):
<wsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <__builtin_arm_wsr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wsr>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <__builtin_arm_wsr@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"cp1:2:c3:c4:5\00"
define void @wsr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__builtin_arm_wsr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"cp1:2:c3:c4:5\00"
define void @wsr(i32 %0) {
%2 = tail call i32 @__builtin_arm_wsr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int agbnp3_mymax(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<agbnp3_mymax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <agbnp3_mymax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <agbnp3_mymax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<agbnp3_mymax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @agbnp3_mymax(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @agbnp3_mymax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int chroot(char const *);
int proc_chroot(const char *path) { return chroot(path); }


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

x86 assembly (clang, -O2):
<proc_chroot>:
jmp    1030 <chroot@plt>

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

LLVM IR (-O2):
define i32 @proc_chroot(i8* %0) {
%2 = tail call i32 @chroot(i8* %0)
ret i32 %2
}
int is_leapyear(unsigned int *y) {
  if (*y % 4 == 0)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<is_leapyear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x3,%eax
cmp    $0x0,%eax
jne    1126 <is_leapyear+0x26>
movl   $0x0,-0x4(%rbp)
jmp    112d <is_leapyear+0x2d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leapyear>:
mov    (%rdi),%al
and    $0x3,%al
neg    %al
sbb    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_leapyear(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 3
%4 = icmp ne i32 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
void foo() {
  union {
    int i;
  } u;
  u.i = 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
define void @foo() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i32*
store i32 1, i32* %2
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int close(int);
int closestate(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<closestate>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @closestate(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
void foo(void) {
  extern void f(void);
  f();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
call   1030 <f@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define void @foo() {
tail call void @f()
ret void
}
double Double_0_toDouble_2_Double(double value) { return value; }


x86 assembly (clang, -O0):
<Double_0_toDouble_2_Double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @Double_0_toDouble_2_Double(double returned %0) {
ret double %0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, char *, int, int, int);
void subkeydir(char *buffer, size_t length, uint64_t subkey, char *basepath) {
  snprintf(buffer, length, "%s/subkeys/%02X/%02X/%08X", basepath,
           (uint8_t)((subkey >> 24) & 0xFF), (uint8_t)((subkey >> 16) & 0xFF),
           (uint32_t)(subkey & 0xFFFFFFFF));
}


x86 assembly (clang, -O0):
<subkeydir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    -0x14(%rbp),%r8d
sar    $0x18,%r8d
and    $0xff,%r8d
mov    -0x14(%rbp),%r9d
sar    $0x10,%r9d
and    $0xff,%r9d
mov    -0x14(%rbp),%eax
and    $0xffffffff,%eax
lea    0xea2(%rip),%rdx
mov    %eax,(%rsp)
call   1030 <snprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subkeydir>:
push   %rax
mov    %edx,%r8d
shr    $0x18,%r8d
mov    %edx,%eax
shr    $0x10,%eax
movzbl %al,%r9d
mov    %edx,(%rsp)
lea    0xed5(%rip),%rdx
call   1030 <snprintf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [26 x i8] c"%s/subkeys/%02X/%02X/%08X\00"
define void @subkeydir(i8* %0, i64 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %8
%12 = load i32, i32* %7
%13 = ashr i32 %12, 24
%14 = and i32 %13, 255
%15 = load i32, i32* %7
%16 = ashr i32 %15, 16
%17 = and i32 %16, 255
%18 = load i32, i32* %7
%19 = and i32 %18, -1
%20 = call i32 @snprintf(i8* %9, i64 %10, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %14, i32 %17, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"%s/subkeys/%02X/%02X/%08X\00"
define void @subkeydir(i8* %0, i64 %1, i32 %2, i8* %3) {
%5 = lshr i32 %2, 24
%6 = lshr i32 %2, 16
%7 = and i32 %6, 255
%8 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %5, i32 %7, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int ini() {
  union {
    char c[4];
    int i;
  } z;
  scanf("%d", &z.i);
  return z.i;
}


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

x86 assembly (clang, -O2):
<ini>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rsp,%rsi
call   1030 <scanf@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%union.anon = type { i32 }
@.str = [3 x i8] c"%d\00"
define i32 @ini() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i32*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = bitcast %union.anon* %1 to i32*
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%union.anon = type { i32 }
@.str = [3 x i8] c"%d\00"
define i32 @ini() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i8*
%3 = getelementptr inbounds %union.anon, %union.anon* %1, i64 0, i32 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32, i32* %3
ret i32 %5
}
unsigned kol_key_get() { asm("int $0x40" ::"a"(2)); }


x86 assembly (clang, -O0):
<kol_key_get>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%eax
int    $0x40
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_key_get>:
mov    $0x2,%eax
int    $0x40
ret

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

LLVM IR (-O2):
define i32 @kol_key_get() {
tail call void asm sideeffect "int $$0x40", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 2)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ m5_dumpreset_stats(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ parse_int_args(int, char **, int /*<<< orphan*/ *, int);
void do_dump_reset_stats(int argc, char *argv[]) {
  uint64_t ints[2];
  parse_int_args(argc, argv, ints, 2);
  m5_dumpreset_stats(ints[0], ints[1]);
}


x86 assembly (clang, -O0):
<do_dump_reset_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x2,%ecx
call   1040 <parse_int_args@plt>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <m5_dumpreset_stats@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_dump_reset_stats>:
push   %rax
mov    %rsp,%rdx
mov    $0x2,%ecx
call   1040 <parse_int_args@plt>
mov    (%rsp),%edi
mov    0x4(%rsp),%esi
call   1030 <m5_dumpreset_stats@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @do_dump_reset_stats(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [2 x i32]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%9 = call i32 @parse_int_args(i32 %6, i8** %7, i32* %8, i32 2)
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%11 = load i32, i32* %10
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%13 = load i32, i32* %12
%14 = call i32 @m5_dumpreset_stats(i32 %11, i32 %13)
ret void
}

LLVM IR (-O2):
define void @do_dump_reset_stats(i32 %0, i8** %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%6 = call i32 @parse_int_args(i32 %0, i8** %1, i32* %5, i32 2)
%7 = load i32, i32* %5
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%9 = load i32, i32* %8
%10 = call i32 @m5_dumpreset_stats(i32 %7, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i2c_start();
int /*<<< orphan*/ i2c_stop();
int /*<<< orphan*/ i2c_write(int);
void ds1337_init() {
  char byte = 0;
  i2c_start();
  i2c_write(0b11010000);
  i2c_write(0x0E);
  i2c_stop();
}


x86 assembly (clang, -O0):
<ds1337_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x0,%al
call   1050 <i2c_start@plt>
mov    $0xd0,%edi
call   1030 <i2c_write@plt>
mov    $0xe,%edi
call   1030 <i2c_write@plt>
mov    $0x0,%al
call   1040 <i2c_stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds1337_init>:
push   %rax
xor    %eax,%eax
call   1050 <i2c_start@plt>
mov    $0xd0,%edi
call   1030 <i2c_write@plt>
mov    $0xe,%edi
call   1030 <i2c_write@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <i2c_stop@plt>

LLVM IR (-O0):
define void @ds1337_init() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 (...) @i2c_start()
%3 = call i32 @i2c_write(i32 208)
%4 = call i32 @i2c_write(i32 14)
%5 = call i32 (...) @i2c_stop()
ret void
}

LLVM IR (-O2):
define void @ds1337_init() {
%1 = tail call i32 (...) @i2c_start()
%2 = tail call i32 @i2c_write(i32 208)
%3 = tail call i32 @i2c_write(i32 14)
%4 = tail call i32 (...) @i2c_stop()
ret void
}
/* Type definitions */
struct wpa_ctrl {
  int dummy;
};

/* Variables and functions */
int wpa_ctrl_command(struct wpa_ctrl *, char *);
int wpa_cli_cmd_logoff(struct wpa_ctrl *ctrl, int argc, char *argv[]) {
  return wpa_ctrl_command(ctrl, "LOGOFF");
}


x86 assembly (clang, -O0):
<wpa_cli_cmd_logoff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <wpa_ctrl_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_cli_cmd_logoff>:
lea    0xee9(%rip),%rsi
jmp    1030 <wpa_ctrl_command@plt>

LLVM IR (-O0):
%struct.wpa_ctrl = type { i32 }
@.str = [7 x i8] c"LOGOFF\00"
define i32 @wpa_cli_cmd_logoff(%struct.wpa_ctrl* %0, i32 %1, i8** %2) {
%4 = alloca %struct.wpa_ctrl*
%5 = alloca i32
%6 = alloca i8**
store %struct.wpa_ctrl* %0, %struct.wpa_ctrl** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load %struct.wpa_ctrl*, %struct.wpa_ctrl** %4
%8 = call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %8
}

LLVM IR (-O2):
%struct.wpa_ctrl = type { i32 }
@.str = [7 x i8] c"LOGOFF\00"
define i32 @wpa_cli_cmd_logoff(%struct.wpa_ctrl* %0, i32 %1, i8** nocapture readnone %2) {
%4 = tail call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
_Bool is_lower(int c) { return (96 < c && c < 123); }


x86 assembly (clang, -O0):
<is_lower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x60,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jge    1124 <is_lower+0x24>
cmpl   $0x7b,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_lower>:
add    $0xffffff9f,%edi
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define zeroext i1 @is_lower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 96, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 123
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
ret i1 %9
}

LLVM IR (-O2):
define zeroext i1 @is_lower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
ret i1 %3
}
/* Variables and functions */
double hypot(double, double);
double distance_xy(double x1, double y1, double x2, double y2) {
  return hypot(x1 - x2, y1 - y2);
}


x86 assembly (clang, -O0):
<distance_xy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
call   1030 <hypot@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance_xy>:
subsd  %xmm2,%xmm0
subsd  %xmm3,%xmm1
jmp    1030 <hypot@plt>

LLVM IR (-O0):
define double @distance_xy(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %7
%11 = fsub double %9, %10
%12 = load double, double* %6
%13 = load double, double* %8
%14 = fsub double %12, %13
%15 = call double @hypot(double %11, double %14)
ret double %15
}

LLVM IR (-O2):
define double @distance_xy(double %0, double %1, double %2, double %3) {
%5 = fsub double %0, %2
%6 = fsub double %1, %3
%7 = tail call double @hypot(double %5, double %6)
ret double %7
}
int is_decimal_char(char blah) { return (blah >= '0' && blah <= '9'); }


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

x86 assembly (clang, -O2):
<is_decimal_char>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_decimal_char(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ switch_off_bits(unsigned char *, int);
int /*<<< orphan*/ switch_on_bits(unsigned char *, int);
void CTRL_REGSC_BITSET_R4g_T3g(unsigned char *data) {
  switch_on_bits(data, (0x02));
  switch_off_bits(data, (0x01 | 0x10));
}


x86 assembly (clang, -O0):
<CTRL_REGSC_BITSET_R4g_T3g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1030 <switch_on_bits@plt>
mov    -0x8(%rbp),%rdi
mov    $0x11,%esi
call   1040 <switch_off_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CTRL_REGSC_BITSET_R4g_T3g>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%esi
call   1030 <switch_on_bits@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
pop    %rbx
jmp    1040 <switch_off_bits@plt>

LLVM IR (-O0):
define void @CTRL_REGSC_BITSET_R4g_T3g(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @switch_on_bits(i8* %3, i32 2)
%5 = load i8*, i8** %2
%6 = call i32 @switch_off_bits(i8* %5, i32 17)
ret void
}

LLVM IR (-O2):
define void @CTRL_REGSC_BITSET_R4g_T3g(i8* %0) {
%2 = tail call i32 @switch_on_bits(i8* %0, i32 2)
%3 = tail call i32 @switch_off_bits(i8* %0, i32 17)
ret void
}
/* Variables and functions */
unsigned int gnulliver();
unsigned short gnulliver16(unsigned short input) {
  static unsigned endian, init = 1;
  unsigned char tmpch;
  union {
    unsigned short u;
    unsigned char ch[2];
  } bytes;
  if (init) {
    endian = gnulliver();
    init = 0;
  }
  if (endian != 0)
    tmpch = bytes.ch[0];
  bytes.ch[0] = bytes.ch[1];
  bytes.ch[1] = tmpch;
  return (bytes.u);
}


x86 assembly (clang, -O0):
<gnulliver16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
cmpl   $0x0,0x2f02(%rip)
je     1143 <gnulliver16+0x33>
mov    $0x0,%al
call   1030 <gnulliver@plt>
mov    %eax,0x2ef7(%rip)
movl   $0x0,0x2ee5(%rip)
cmpl   $0x0,0x2ee6(%rip)
je     1156 <gnulliver16+0x46>
mov    -0x8(%rbp),%al
mov    %al,-0x3(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0x8(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x7(%rbp)
movzwl -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnulliver16>:
push   %rax
cmpb   $0x0,0x2f14(%rip)
jne    1128 <gnulliver16+0x18>
xor    %eax,%eax
call   1030 <gnulliver@plt>
movb   $0x1,0x2f04(%rip)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%union.anon = type { i16 }
@gnulliver16.endian = internal global i32 0
@gnulliver16.init = internal global i32 1
define zeroext i16 @gnulliver16(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
%4 = alloca %union.anon
store i16 %0, i16* %2
%5 = load i32, i32* @gnulliver16.init
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @gnulliver()
store i32 %8, i32* @gnulliver16.endian
store i32 0, i32* @gnulliver16.init
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* @gnulliver16.endian
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = bitcast %union.anon* %4 to [2 x i8]*
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %13, i64 0, i64 0
%15 = load i8, i8* %14
store i8 %15, i8* %3
br label %16
16: ; preds = %12, %9
%17 = bitcast %union.anon* %4 to [2 x i8]*
%18 = getelementptr inbounds [2 x i8], [2 x i8]* %17, i64 0, i64 1
%19 = load i8, i8* %18
%20 = bitcast %union.anon* %4 to [2 x i8]*
%21 = getelementptr inbounds [2 x i8], [2 x i8]* %20, i64 0, i64 0
store i8 %19, i8* %21
%22 = load i8, i8* %3
%23 = bitcast %union.anon* %4 to [2 x i8]*
%24 = getelementptr inbounds [2 x i8], [2 x i8]* %23, i64 0, i64 1
store i8 %22, i8* %24
%25 = bitcast %union.anon* %4 to i16*
%26 = load i16, i16* %25
ret i16 %26
}

LLVM IR (-O2):
@gnulliver16.init = internal unnamed_addr global i1 false
define zeroext i16 @gnulliver16(i16 zeroext %0) {
%2 = load i1, i1* @gnulliver16.init
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @gnulliver()
store i1 true, i1* @gnulliver16.init
br label %5
5: ; preds = %3, %1
ret i16 0
}
double speed(double V, double t) { return V + 9.81 * t; }


x86 assembly (clang, -O0):
<speed>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xee0(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<speed>:
mulsd  0xef8(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @speed(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @llvm.fmuladd.f64(double 9.810000e+00, double %6, double %5)
ret double %7
}

LLVM IR (-O2):
define double @speed(double %0, double %1) {
%3 = tail call double @llvm.fmuladd.f64(double %1, double 9.810000e+00, double %0)
ret double %3
}
int test_imm_DCuint8_mem(unsigned char *val) {
  return ((*val) & (0xDC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DCuint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xdc,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DCuint8_mem>:
testb  $0xdc,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DCuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -36
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned short t0(unsigned short x) { return x++; }


x86 assembly (clang, -O0):
<t0>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,%cx
add    $0x1,%cx
mov    %cx,-0x2(%rbp)
movzwl %ax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i16 @t0(i16 returned zeroext %0) {
ret i16 %0
}
void mulMat_kazawa(const int matsize, const double *mata, const double *matb,
                   double *matc) {
  ;
}


x86 assembly (clang, -O0):
<mulMat_kazawa>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @mulMat_kazawa(i32 %0, double* %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
store i32 %0, i32* %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
ret void
}

LLVM IR (-O2):
define void @mulMat_kazawa(i32 %0, double* nocapture %1, double* nocapture %2, double* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
int main(void) {
  char c = 'Q';
  char *char_pointer = &c;
  printf("%c %c\n", c, *char_pointer);
  c = '/';
  printf("%c %c\n", c, *char_pointer);
  *char_pointer = '(';
  printf("%c %c\n", c, *char_pointer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x51,-0x5(%rbp)
lea    -0x5(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x5(%rbp),%cl
mov    -0x10(%rbp),%rax
lea    0xec7(%rip),%rdi
movsbl %cl,%esi
movsbl (%rax),%edx
call   1030 <printf@plt>
movb   $0x2f,-0x5(%rbp)
mov    -0x5(%rbp),%cl
mov    -0x10(%rbp),%rax
lea    0xeaa(%rip),%rdi
movsbl %cl,%esi
movsbl (%rax),%edx
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movb   $0x28,(%rax)
mov    -0x5(%rbp),%cl
mov    -0x10(%rbp),%rax
lea    0xe8a(%rip),%rdi
movsbl %cl,%esi
movsbl (%rax),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x51,%esi
mov    $0x51,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2f,%esi
mov    $0x2f,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x28,%esi
mov    $0x28,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%c %c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext 81, i8 signext 81)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext 47, i8 signext 47)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext 40, i8 signext 40)
ret i32 0
}
unsigned short SCD_Read_Word(unsigned int Adr) { return 0; }


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

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

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

LLVM IR (-O2):
define zeroext i16 @SCD_Read_Word(i32 %0) {
ret i16 0
}
void WSBCleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @WSBCleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void show_help() {
  fprintf(stdout,
          "rer v%s\nregular expression based file renamer\nusage:\n\trer "
          "/pattern/replacement/flags file_list..\n",
          "_RER_VERSION");
}


x86 assembly (clang, -O0):
<show_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xf37(%rip),%rdx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xf3b(%rip),%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [98 x i8] c"rer v%s\0Aregular expression based file renamer\0Ausage:\0A\09rer /pattern/replacement/flags file_list..\0A\00"
@.str.1 = [13 x i8] c"_RER_VERSION\00"
define void @show_help() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [98 x i8] c"rer v%s\0Aregular expression based file renamer\0Ausage:\0A\09rer /pattern/replacement/flags file_list..\0A\00"
@.str.1 = [13 x i8] c"_RER_VERSION\00"
define void @show_help() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ basicTest();
int main(void) {
  basicTest();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @basicTest()
ret i32 0
}