xunge/DecIR huggingface dataset:
int gcd(int u, int v) {
  if (u < 0)
    u = -u;
  if (v < 0)
    v = -v;
  while (0 != v) {
    int r;
    r = u % v;
    u = v;
    v = r;
  }
  return u;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111c <gcd+0x1c>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    112e <gcd+0x2e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <gcd+0x33>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
je     1159 <gcd+0x59>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <gcd+0x33>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
test   %esi,%esi
je     112d <gcd+0x2d>
mov    %esi,%edx
neg    %edx
cmovs  %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1120 <gcd+0x20>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %3
%10 = sub nsw i32 0, %9
store i32 %10, i32* %3
br label %11
11: ; preds = %8, %2
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %4
%16 = sub nsw i32 0, %15
store i32 %16, i32* %4
br label %17
17: ; preds = %14, %11
br label %18
18: ; preds = %21, %17
%19 = load i32, i32* %4
%20 = icmp ne i32 0, %19
br i1 %20, label %21, label %27
21: ; preds = %18
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = srem i32 %22, %23
store i32 %24, i32* %5
%25 = load i32, i32* %4
store i32 %25, i32* %3
%26 = load i32, i32* %5
store i32 %26, i32* %4
br label %18
27: ; preds = %18
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = icmp eq i32 %1, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
br label %7
7: ; preds = %5, %7
%8 = phi i32 [ %9, %7 ], [ %3, %5 ]
%9 = phi i32 [ %10, %7 ], [ %6, %5 ]
%10 = srem i32 %8, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
%13 = phi i32 [ %3, %2 ], [ %9, %7 ]
ret i32 %13
}
int XFindContext() {}


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

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

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

LLVM IR (-O2):
define i32 @XFindContext() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ SIZE_MAX;
int strnuppercmp(char const *, char const *, int /*<<< orphan*/);
int struppercmp(const char *a, const char *b) {
  return strnuppercmp(a, b, SIZE_MAX);
}


x86 assembly (clang, -O0):
<struppercmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
call   1030 <strnuppercmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<struppercmp>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <strnuppercmp@plt>

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

LLVM IR (-O2):
@SIZE_MAX = global i32 0
define i32 @struppercmp(i8* %0, i8* %1) {
%3 = load i32, i32* @SIZE_MAX
%4 = tail call i32 @strnuppercmp(i8* %0, i8* %1, i32 %3)
ret i32 %4
}
void wrf_mem_copy_(a, b, n) char *a;
char *b;
int *n;
{
  int i;
  for (i = 0; i < *n; i++) {
    *b++ = *a++;
  }
}


x86 assembly (clang, -O0):
<wrf_mem_copy_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    1156 <wrf_mem_copy_+0x56>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <wrf_mem_copy_+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrf_mem_copy_>:
cmpl   $0x0,(%rdx)
jle    111f <wrf_mem_copy_+0x1f>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movzbl (%rdi,%rax,1),%ecx
mov    %cl,(%rsi,%rax,1)
add    $0x1,%rax
cmp    (%rdx),%eax
jl     1110 <wrf_mem_copy_+0x10>
ret

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

LLVM IR (-O2):
define void @wrf_mem_copy_(i8* nocapture %0, i8* nocapture writeonly %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %3, %6
%7 = phi i32 [ %13, %6 ], [ 0, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = phi i8* [ %12, %6 ], [ %1, %3 ]
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %8
%12 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %11, i8* %9
%13 = add nuw nsw i32 %7, 1
%14 = load i32, i32* %2
%15 = icmp slt i32 %13, %14
br i1 %15, label %6, label %16
16: ; preds = %6, %3
ret void
}
/* Variables and functions */
int age(int);
int /*<<< orphan*/ printf(char *, int);
void main() { printf("%d\n", age(5)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1040 <age@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <age@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @age(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
char decodeRank(int rank) {
  switch (rank) {
  case 0:
  case 13:
    return ' ';
  case 10:
    return 'S';
  case 11:
    return 'B';
  case 12:
    return 'F';
  default:
    return rank + 48;
  }
}


x86 assembly (clang, -O0):
<decodeRank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0xd,%rax
ja     1150 <decodeRank+0x50>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x20,-0x1(%rbp)
jmp    1159 <decodeRank+0x59>
movb   $0x53,-0x1(%rbp)
jmp    1159 <decodeRank+0x59>
movb   $0x42,-0x1(%rbp)
jmp    1159 <decodeRank+0x59>
movb   $0x46,-0x1(%rbp)
jmp    1159 <decodeRank+0x59>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decodeRank>:
cmp    $0xd,%edi
ja     111a <decodeRank+0x1a>
mov    $0x20,%al
mov    %edi,%ecx
lea    0xef0(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
ret
add    $0x30,%dil
mov    %edi,%eax
ret
mov    $0x53,%al
ret
mov    $0x42,%al
ret
mov    $0x46,%al
ret

LLVM IR (-O0):
define signext i8 @decodeRank(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 0, label %5
i32 13, label %5
i32 10, label %6
i32 11, label %7
i32 12, label %8
]
5: ; preds = %1, %1
store i8 32, i8* %2
br label %13
6: ; preds = %1
store i8 83, i8* %2
br label %13
7: ; preds = %1
store i8 66, i8* %2
br label %13
8: ; preds = %1
store i8 70, i8* %2
br label %13
9: ; preds = %1
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 48
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
br label %13
13: ; preds = %9, %8, %7, %6, %5
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @decodeRank(i32 %0) {
switch i32 %0, label %5 [
i32 0, label %8
i32 13, label %8
i32 10, label %2
i32 11, label %3
i32 12, label %4
]
2: ; preds = %1
br label %8
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
%6 = trunc i32 %0 to i8
%7 = add i8 %6, 48
br label %8
8: ; preds = %1, %1, %5, %4, %3, %2
%9 = phi i8 [ %7, %5 ], [ 70, %4 ], [ 66, %3 ], [ 83, %2 ], [ 32, %1 ], [ 32, %1 ]
ret i8 %9
}
int out_of_bounds(void) {
  int arr[10];
  return arr[15];
}


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

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

LLVM IR (-O0):
define i32 @out_of_bounds() {
%1 = alloca [10 x i32]
%2 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 15
%3 = load i32, i32* %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @out_of_bounds() {
ret i32 poison
}
/* Type definitions */
typedef char *uint16_t;

/* Variables and functions */
uint16_t __attribute__((always_)) inw(uint16_t port) {
  uint16_t data;
  __asm__ volatile("inw %w1, %w0" : "=a"(data) : "Nd"(port));
  return data;
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
in     (%dx),%ax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
mov    %rdi,%rdx
in     (%dx),%ax
ret

LLVM IR (-O0):
define i8* @inw(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* asm sideeffect "inw ${1:w}, ${0:w}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @inw(i8* %0) {
%2 = tail call i8* asm sideeffect "inw ${1:w}, ${0:w}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void printIntro(void) { puts("SOCKSTRESS - CVE-2008-4609 | havoc@defuse.ca"); }


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"SOCKSTRESS - CVE-2008-4609 | havoc@defuse.ca\00"
define void @printIntro() {
%1 = call i32 @puts(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"SOCKSTRESS - CVE-2008-4609 | havoc@defuse.ca\00"
define void @printIntro() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}
float fabsf(float x) { return (x < 0.f) ? -x : x; }


x86 assembly (clang, -O0):
<fabsf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1132 <fabsf+0x32>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    113c <fabsf+0x3c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsf>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fabsf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
br label %10
8: ; preds = %1
%9 = load float, float* %2
br label %10
10: ; preds = %8, %5
%11 = phi float [ %7, %5 ], [ %9, %8 ]
ret float %11
}

LLVM IR (-O2):
define float @fabsf(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
int test_imm_16uint16_reg(unsigned short val) {
  return ((val) & (-0x16 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_16uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -22
%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_16uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -22
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
unsigned char gf4_mul_2(unsigned char);
unsigned char gf16_mul_4(unsigned char a) {
  return (((a << 2) ^ a) & (8 + 4)) ^ gf4_mul_2(a >> 2);
}


x86 assembly (clang, -O0):
<gf16_mul_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x2,%eax
movzbl -0x1(%rbp),%ecx
xor    %ecx,%eax
and    $0xc,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x2,%eax
movzbl %al,%edi
call   1030 <gf4_mul_2@plt>
mov    %al,%cl
mov    -0x8(%rbp),%eax
movzbl %cl,%ecx
xor    %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf16_mul_4>:
push   %rbx
lea    0x0(,%rdi,4),%ebx
xor    %dil,%bl
and    $0xc,%bl
shr    $0x2,%dil
movzbl %dil,%edi
call   1030 <gf4_mul_2@plt>
xor    %bl,%al
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @gf16_mul_4(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl i32 %4, 2
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = xor i32 %5, %7
%9 = and i32 %8, 12
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = ashr i32 %11, 2
%13 = trunc i32 %12 to i8
%14 = call zeroext i8 @gf4_mul_2(i8 zeroext %13)
%15 = zext i8 %14 to i32
%16 = xor i32 %9, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @gf16_mul_4(i8 zeroext %0) {
%2 = shl i8 %0, 2
%3 = xor i8 %2, %0
%4 = and i8 %3, 12
%5 = lshr i8 %0, 2
%6 = tail call zeroext i8 @gf4_mul_2(i8 zeroext %5)
%7 = xor i8 %6, %4
ret i8 %7
}
void __attribute__((weak)) uart4_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<uart4_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart4_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.uart4_isr = [10 x i8] c"uart4_isr\00"
define weak void @uart4_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.uart4_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.uart4_isr = [10 x i8] c"uart4_isr\00"
define weak void @uart4_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.uart4_isr, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void bitmap32_clear(int32_t *bitmap, int n) { *bitmap &= ~((int32_t)1 << n); }


x86 assembly (clang, -O0):
<bitmap32_clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap32_clear>:
mov    %esi,%ecx
mov    $0xfffffffe,%eax
rol    %cl,%eax
and    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @bitmap32_clear(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = xor i32 %6, -1
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = and i32 %9, %7
store i32 %10, i32* %8
ret void
}

LLVM IR (-O2):
define void @bitmap32_clear(i32* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = load i32, i32* %0
%6 = and i32 %5, %4
store i32 %6, i32* %0
ret void
}
void gdk_region_get_rectangles() {}


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

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

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

LLVM IR (-O2):
define void @gdk_region_get_rectangles() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
scalar_t__ shmctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int rmshm(int shmid) {
  if (shmid > 0) {
    if (0 > shmctl(shmid, IPC_RMID, NULL)) {
      return (-1);
    }
  }
  return shmid;
}


x86 assembly (clang, -O0):
<rmshm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1159 <rmshm+0x49>
mov    -0x8(%rbp),%edi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <shmctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jle    1154 <rmshm+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <rmshm+0x4f>
jmp    1159 <rmshm+0x49>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmshm>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jle    1133 <rmshm+0x23>
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
xor    %edx,%edx
call   1030 <shmctl@plt>
test   %rax,%rax
jns    1133 <rmshm+0x23>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@IPC_RMID = global i32 0
define i32 @rmshm(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = load i32, i32* @IPC_RMID
%9 = call i64 @shmctl(i32 %7, i32 %8, i32* null)
%10 = icmp sgt i64 0, %9
br i1 %10, label %11, label %12
11: ; preds = %6
store i32 -1, i32* %2
br label %15
12: ; preds = %6
br label %13
13: ; preds = %12, %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
define i32 @rmshm(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @IPC_RMID
%5 = tail call i64 @shmctl(i32 %0, i32 %4, i32* null)
%6 = icmp slt i64 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %3, %1
br label %8
8: ; preds = %3, %7
%9 = phi i32 [ %0, %7 ], [ -1, %3 ]
ret i32 %9
}
void encodeDmaStoreZero(void) {}


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

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

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

LLVM IR (-O2):
define void @encodeDmaStoreZero() {
ret void
}
void swap(long *x, long *y) {
  *x = *x + *y;
  *y = *x - *y;
  *x = *x - *y;
}


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

x86 assembly (clang, -O2):
<swap>:
mov    (%rsi),%rax
add    (%rdi),%rax
mov    %rax,(%rdi)
sub    (%rsi),%rax
mov    %rax,(%rsi)
sub    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @swap(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = load i64*, i64** %4
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
%10 = load i64*, i64** %3
store i64 %9, i64* %10
%11 = load i64*, i64** %3
%12 = load i64, i64* %11
%13 = load i64*, i64** %4
%14 = load i64, i64* %13
%15 = sub nsw i64 %12, %14
%16 = load i64*, i64** %4
store i64 %15, i64* %16
%17 = load i64*, i64** %3
%18 = load i64, i64* %17
%19 = load i64*, i64** %4
%20 = load i64, i64* %19
%21 = sub nsw i64 %18, %20
%22 = load i64*, i64** %3
store i64 %21, i64* %22
ret void
}

LLVM IR (-O2):
define void @swap(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
%5 = add nsw i64 %4, %3
store i64 %5, i64* %0
%6 = load i64, i64* %1
%7 = sub nsw i64 %5, %6
store i64 %7, i64* %1
%8 = load i64, i64* %0
%9 = sub nsw i64 %8, %7
store i64 %9, i64* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strerr_die(int, char *, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
void die_usage(void) {
  strerr_die(
      (100),
      ("softlimit: usage: softlimit [-a allbytes] [-c corebytes] [-d "
       "databytes] [-f filebytes] [-l lockbytes] [-m membytes] [-o openfiles] "
       "[-p processes] [-r residentbytes] [-s stackbytes] [-t cpusecs] child"),
      0, 0, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<die_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
lea    0xedc(%rip),%rsi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <strerr_die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<die_usage>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x64,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1030 <strerr_die@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [200 x i8] c"softlimit: usage: softlimit [-a allbytes] [-c corebytes] [-d databytes] [-f filebytes] [-l lockbytes] [-m membytes] [-o openfiles] [-p processes] [-r residentbytes] [-s stackbytes] [-t cpusecs] child\00"
define void @die_usage() {
%1 = call i32 @strerr_die(i32 100, i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [200 x i8] c"softlimit: usage: softlimit [-a allbytes] [-c corebytes] [-d databytes] [-f filebytes] [-l lockbytes] [-m membytes] [-o openfiles] [-p processes] [-r residentbytes] [-s stackbytes] [-t cpusecs] child\00"
define void @die_usage() {
%1 = tail call i32 @strerr_die(i32 100, i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}
void write_marker(unsigned char *data, int offset, int value) {
  if (0) {
    data[offset] = value >> 24;
    data[offset + 1] = value >> 16;
    data[offset + 2] = value >> 8;
    data[offset + 3] = value;
  } else {
    data[offset] = value;
    data[offset + 1] = value >> 8;
    data[offset + 2] = value >> 16;
    data[offset + 3] = value >> 24;
  };
}


x86 assembly (clang, -O0):
<write_marker>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
sar    $0x8,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
sar    $0x10,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
sar    $0x18,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_marker>:
movslq %esi,%rax
mov    %edx,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @write_marker(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 %8, i8* %12
%13 = load i32, i32* %6
%14 = ashr i32 %13, 8
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %4
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %16, i64 %19
store i8 %15, i8* %20
%21 = load i32, i32* %6
%22 = ashr i32 %21, 16
%23 = trunc i32 %22 to i8
%24 = load i8*, i8** %4
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %24, i64 %27
store i8 %23, i8* %28
%29 = load i32, i32* %6
%30 = ashr i32 %29, 24
%31 = trunc i32 %30 to i8
%32 = load i8*, i8** %4
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 3
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %32, i64 %35
store i8 %31, i8* %36
ret void
}

LLVM IR (-O2):
define void @write_marker(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = trunc i32 %2 to i8
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %4, i8* %6
%7 = lshr i32 %2, 8
%8 = trunc i32 %7 to i8
%9 = add nsw i32 %1, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 %8, i8* %11
%12 = lshr i32 %2, 16
%13 = trunc i32 %12 to i8
%14 = add nsw i32 %1, 2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %0, i64 %15
store i8 %13, i8* %16
%17 = lshr i32 %2, 24
%18 = trunc i32 %17 to i8
%19 = add nsw i32 %1, 3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %0, i64 %20
store i8 %18, i8* %21
ret void
}
/* Type definitions */
struct timespec {
  double tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
float TimeSpecToUSeconds(struct timespec *ts) {
  return (float)(ts->tv_sec + ts->tv_nsec / 1000.0);
}


x86 assembly (clang, -O0):
<TimeSpecToUSeconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdq 0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  0xede(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimeSpecToUSeconds>:
cvtsi2sdq 0x8(%rdi),%xmm0
movsd  (%rdi),%xmm1
divsd  0xeee(%rip),%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { double, i64 }
define float @TimeSpecToUSeconds(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
%9 = load double, double* %8
%10 = fdiv double %9, 1.000000e+03
%11 = fadd double %6, %10
%12 = fptrunc double %11 to float
ret float %12
}

LLVM IR (-O2):
%struct.timespec = type { double, i64 }
define float @TimeSpecToUSeconds(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%6 = load double, double* %5
%7 = fdiv double %6, 1.000000e+03
%8 = fadd double %7, %4
%9 = fptrunc double %8 to float
ret float %9
}
/* Variables and functions */
char *check_malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *concatenate(char *string1, char *string2) {
  char *new_string = check_malloc(strlen(string1) + strlen(string2) + 1);
  strcpy(new_string, string1);
  strcat(new_string, string2);
  return (new_string);
}


x86 assembly (clang, -O0):
<concatenate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1050 <check_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concatenate>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <check_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @concatenate(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i8* @check_malloc(i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %5
%17 = load i8*, i8** %4
%18 = call i32 @strcat(i8* %16, i8* %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @concatenate(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @check_malloc(i64 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = tail call i32 @strcat(i8* %7, i8* %1)
ret i8* %7
}
void wmb() { asm volatile("sfence" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @wmb() {
tail call void asm sideeffect "sfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
void *recognizer_init(int /*<<< orphan*/ *, char const *, int,
                      int /*<<< orphan*/, int);
void *headword_init(const char *dicdir, int codetype) {
  void *Dic;
  Dic = recognizer_init(NULL, dicdir, 2, 0, codetype);
  return Dic;
}


x86 assembly (clang, -O0):
<headword_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1030 <recognizer_init@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<headword_init>:
mov    %esi,%r8d
mov    %rdi,%rsi
xor    %edi,%edi
mov    $0x2,%edx
xor    %ecx,%ecx
jmp    1030 <recognizer_init@plt>

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

LLVM IR (-O2):
define i8* @headword_init(i8* %0, i32 %1) {
%3 = tail call i8* @recognizer_init(i32* null, i8* %0, i32 2, i32 0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ print_hashTable();
void make_dataSegment() { print_hashTable(); }


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

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

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

LLVM IR (-O2):
define void @make_dataSegment() {
%1 = tail call i32 (...) @print_hashTable()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putc(char);
int putchar(int c) {
  if (c == '\n')
    putc('\r');
  if (c == '\b') {
    putc('\b');
    putc(' ');
  }
  putc((char)c);
  return c;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    112f <putchar+0x1f>
mov    $0xd,%edi
call   1030 <putc@plt>
cmpl   $0x8,-0x4(%rbp)
jne    114d <putchar+0x3d>
mov    $0x8,%edi
call   1030 <putc@plt>
mov    $0x20,%edi
call   1030 <putc@plt>
mov    -0x4(%rbp),%eax
movsbl %al,%edi
call   1030 <putc@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%edi
je     112b <putchar+0x1b>
cmp    $0x8,%ebx
jne    1135 <putchar+0x25>
mov    $0x8,%edi
call   1030 <putc@plt>
mov    $0x20,%al
jmp    112d <putchar+0x1d>
mov    $0xd,%al
movzbl %al,%edi
call   1030 <putc@plt>
movsbl %bl,%edi
call   1030 <putc@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 10
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @putc(i8 signext 13)
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 8
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = call i32 @putc(i8 signext 8)
%12 = call i32 @putc(i8 signext 32)
br label %13
13: ; preds = %10, %7
%14 = load i32, i32* %2
%15 = trunc i32 %14 to i8
%16 = call i32 @putc(i8 signext %15)
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @putchar(i32 returned %0) {
switch i32 %0, label %7 [
i32 10, label %4
i32 8, label %2
]
2: ; preds = %1
%3 = tail call i32 @putc(i8 signext 8)
br label %4
4: ; preds = %1, %2
%5 = phi i8 [ 32, %2 ], [ 13, %1 ]
%6 = tail call i32 @putc(i8 signext %5)
br label %7
7: ; preds = %4, %1
%8 = trunc i32 %0 to i8
%9 = tail call i32 @putc(i8 signext %8)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ bye();
double get_sec_since_epoch();
int /*<<< orphan*/ hello();
int /*<<< orphan*/ here();
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char *argv[]) {
  printf("%f\n", get_sec_since_epoch());
  hello();
  here();
  bye();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <get_sec_since_epoch@plt>
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <hello@plt>
mov    $0x0,%al
call   1040 <here@plt>
mov    $0x0,%al
call   1060 <bye@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <get_sec_since_epoch@plt>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <hello@plt>
xor    %eax,%eax
call   1040 <here@plt>
xor    %eax,%eax
call   1060 <bye@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call double (...) @get_sec_since_epoch()
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %6)
%8 = call i32 (...) @hello()
%9 = call i32 (...) @here()
%10 = call i32 (...) @bye()
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double (...) @get_sec_since_epoch()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %3)
%5 = tail call i32 (...) @hello()
%6 = tail call i32 (...) @here()
%7 = tail call i32 (...) @bye()
ret i32 0
}
int is_same(void *elem1, void *elem2) { return *(int *)elem1 == *(int *)elem2; }


x86 assembly (clang, -O0):
<is_same>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_same>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @is_same(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_same(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void C10(void) { printf("Test3\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"Test3\00"
define void @C10() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int Min, MinGift1, MinGift2;
  scanf("%d%d%d", &Min, &MinGift1, &MinGift2);
  if (MinGift1 + MinGift2 <= Min)
    printf("Farei hoje!\n");
  else
    printf("Deixa para amanha!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1167 <main+0x47>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    1173 <main+0x53>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
add    0x10(%rsp),%eax
cmp    0x14(%rsp),%eax
lea    0xeb5(%rip),%rax
lea    0xec1(%rip),%rdi
cmovg  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d%d%d\00"
@str = [19 x i8] c"Deixa para amanha!\00"
@str.3 = [12 x i8] c"Farei hoje!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %9, %8
%11 = load i32, i32* %1
%12 = icmp sgt i32 %10, %11
%13 = select i1 %12, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.3, i64 0, i64 0)
%14 = call i32 @puts(i8* dereferenceable(1) %13)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ tempString;

/* Variables and functions */
int /*<<< orphan*/ getSexComponents(double, int *, int *, int *);
int setStandardProcedure(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
int setSiteLongitude(double Long) {
  int d, m, s;
  char tempString[32];
  getSexComponents(Long, &d, &m, &s);
  snprintf(tempString, sizeof(tempString), "#:Sg%03d:%02d#", d, m);
  return (setStandardProcedure(tempString));
}


x86 assembly (clang, -O0):
<setSiteLongitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <getSexComponents@plt>
lea    -0x40(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    $0x20,%esi
lea    0xe96(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <setStandardProcedure@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setSiteLongitude>:
push   %rbx
sub    $0x30,%rsp
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <getSexComponents@plt>
mov    0x8(%rsp),%ecx
mov    0x4(%rsp),%r8d
lea    0xea7(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <setStandardProcedure@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"#:Sg%03d:%02d#\00"
define i32 @setSiteLongitude(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [32 x i8]
store double %0, double* %2
%7 = load double, double* %2
%8 = call i32 @getSexComponents(double %7, i32* %3, i32* %4, i32* %5)
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @snprintf(i8* %9, i32 32, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
%13 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%14 = call i32 @setStandardProcedure(i8* %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [15 x i8] c"#:Sg%03d:%02d#\00"
define i32 @setSiteLongitude(double %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [32 x i8]
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%10 = call i32 @getSexComponents(double %0, i32* %2, i32* %3, i32* %4)
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @snprintf(i8* %9, i32 32, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
%14 = call i32 @setStandardProcedure(i8* %9)
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *strtok(int /*<<< orphan*/ *, char *);
void printTokensInReverse(char *tokenPtr) {
  if (tokenPtr == NULL)
    return;
  char *temp = tokenPtr;
  tokenPtr = strtok(NULL, " ");
  printTokensInReverse(tokenPtr);
  printf("%s ", temp);
}


x86 assembly (clang, -O0):
<printTokensInReverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114c <printTokensInReverse+0x1c>
jmp    1181 <printTokensInReverse+0x51>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xea3(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printTokensInReverse@plt>
mov    -0x10(%rbp),%rsi
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTokensInReverse>:
test   %rdi,%rdi
je     115f <printTokensInReverse+0x2f>
push   %rbx
mov    %rdi,%rbx
lea    0xec2(%rip),%rsi
xor    %edi,%edi
call   1050 <strtok@plt>
mov    %rax,%rdi
call   1030 <printTokensInReverse@plt>
lea    0xeaa(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [4 x i8] c"%s \00"
define void @printTokensInReverse(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
br label %13
7: ; preds = %1
%8 = load i8*, i8** %2
store i8* %8, i8** %3
%9 = call i8* @strtok(i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %9, i8** %2
%10 = load i8*, i8** %2
%11 = load i8*, i8** %3
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [4 x i8] c"%s \00"
define void @printTokensInReverse(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %4
3: ; preds = %1, %4
ret void
4: ; preds = %1
%5 = tail call i8* @strtok(i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
tail call void @printTokensInReverse(i8* %5)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ cmd_error(char *, char *, int, char *);
void assert_cmdline(char *option, char *file, int line) {
  if (file != NULL) {
    cmd_error("%s:%s: %s cannot be used in file\n", file, line, option);
  }
}


x86 assembly (clang, -O0):
<assert_cmdline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1145 <assert_cmdline+0x35>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xec0(%rip),%rdi
call   1030 <cmd_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_cmdline>:
test   %rsi,%rsi
je     1124 <assert_cmdline+0x14>
mov    %rdi,%rcx
lea    0xee1(%rip),%rdi
jmp    1030 <cmd_error@plt>
ret

LLVM IR (-O0):
@.str = [34 x i8] c"%s:%s: %s cannot be used in file\0A\00"
define void @assert_cmdline(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** %5
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i8*, i8** %4
%13 = call i32 @cmd_error(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i8* %12)
br label %14
14: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"%s:%s: %s cannot be used in file\0A\00"
define void @assert_cmdline(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @cmd_error(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}