xunge/DecIR huggingface dataset:
/* Variables and functions */
int call_prom(char *, int, int, void *, void *, int);
int write(void *handle, void *ptr, int nb) {
  return call_prom("write", 3, 1, handle, ptr, nb);
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x14(%rbp),%r9d
lea    0xeca(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1030 <call_prom@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
mov    %edx,%r9d
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xee0(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
jmp    1030 <call_prom@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"write\00"
define i32 @write(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @call_prom(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 3, i32 1, i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i = 0x12345678;
  char *x;
  x = (char *)&i;
  printf("0x%x\n", *x);
  printf((*x == 0x78) ? "little endian\n" : "big endian\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x12345678,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
lea    0xec4(%rip),%rdi
lea    0xeae(%rip),%rax
cmp    $0x78,%ecx
cmove  %rax,%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"0x%x\0A\00"
@.str.1 = [15 x i8] c"little endian\0A\00"
@.str.2 = [12 x i8] c"big endian\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i32 305419896, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 120
%13 = zext i1 %12 to i64
%14 = select i1 %12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0)
%15 = call i32 (i8*, ...) @printf(i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"0x%x\0A\00"
@str = [14 x i8] c"little endian\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 120)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void alias_mod_bad(int array[], int i, int j) {
  int *a = array;
  a[j] = i;
}


x86 assembly (clang, -O0):
<alias_mod_bad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @alias_mod_bad(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
store i32* %8, i32** %7
%9 = load i32, i32* %5
%10 = load i32*, i32** %7
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
store i32 %9, i32* %13
ret void
}

LLVM IR (-O2):
define void @alias_mod_bad(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %1, i32* %5
ret void
}
int deserializeInt(void **buffer) {
  int r = *(int *)*buffer;
  *buffer += sizeof(int);
  return r;
}


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

x86 assembly (clang, -O2):
<deserializeInt>:
mov    (%rdi),%rcx
mov    (%rcx),%eax
add    $0x4,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i32 @deserializeInt(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
store i32 %7, i32* %3
%8 = load i8**, i8*** %2
%9 = load i8*, i8** %8
%10 = getelementptr i8, i8* %9, i64 4
store i8* %10, i8** %8
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @deserializeInt(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = getelementptr i8, i8* %2, i64 4
store i8* %5, i8** %0
ret i32 %4
}
/* Variables and functions */
unsigned int htonl(unsigned char);
unsigned int char_to_ip(unsigned char *ip) {
  return htonl(ip[0] << 24 | ip[1] << 16 | ip[2] << 8 | ip[3]);
}


x86 assembly (clang, -O0):
<char_to_ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
movzbl %al,%edi
call   1030 <htonl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_to_ip>:
movzbl 0x3(%rdi),%edi
jmp    1030 <htonl@plt>

LLVM IR (-O0):
define i32 @char_to_ip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = or i32 %19, %23
%25 = trunc i32 %24 to i8
%26 = call i32 @htonl(i8 zeroext %25)
ret i32 %26
}

LLVM IR (-O2):
define i32 @char_to_ip(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = tail call i32 @htonl(i8 zeroext %3)
ret i32 %4
}
void swap(char *p_chaine, int p_indice1, int p_indice2) {
  char tampon = p_chaine[p_indice1];
  p_chaine[p_indice1] = p_chaine[p_indice2];
  p_chaine[p_indice2] = tampon;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @swap(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
store i8 %12, i8* %7
%13 = load i8*, i8** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = load i8*, i8** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 %17, i8* %21
%22 = load i8, i8* %7
%23 = load i8*, i8** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 %22, i8* %26
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
store i8 %6, i8* %8
ret void
}
float step_activation(float output) { return (output > 0); }


x86 assembly (clang, -O0):
<step_activation>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<step_activation>:
xorps  %xmm1,%xmm1
cmpltss %xmm0,%xmm1
movss  0xef0(%rip),%xmm0
andps  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @step_activation(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = sitofp i32 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @step_activation(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = uitofp i1 %2 to float
ret float %3
}
unsigned xrop3_84_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T | S;
  stk2 = ~stk2;
  stk1 = D | stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_84_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_84_0_0>:
mov    %edi,%eax
or     %esi,%eax
shl    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_84_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %5
%28 = load i32, i32* %9
%29 = or i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = xor i32 %30, -1
store i32 %31, i32* %8
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @xrop3_84_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
ret i32 %5
}
unsigned int calcuate_num_blocks(unsigned long long total_msgs) {
  unsigned int num_meta_blocks =
      (total_msgs / (4096 / sizeof(signed long long)));
  if (total_msgs % (4096 / sizeof(signed long long)) != 0)
    num_meta_blocks += 1;
  return num_meta_blocks;
}


x86 assembly (clang, -O0):
<calcuate_num_blocks>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x9,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1ff,%rax
cmp    $0x0,%rax
je     1130 <calcuate_num_blocks+0x30>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcuate_num_blocks>:
mov    %rdi,%rax
shr    $0x9,%rax
and    $0x1ff,%edi
cmp    $0x1,%rdi
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @calcuate_num_blocks(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = udiv i64 %4, 512
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i64, i64* %2
%8 = urem i64 %7, 512
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = add i32 %11, 1
store i32 %12, i32* %3
br label %13
13: ; preds = %10, %1
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @calcuate_num_blocks(i64 %0) {
%2 = lshr i64 %0, 9
%3 = trunc i64 %2 to i32
%4 = and i64 %0, 511
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
%7 = add i32 %6, %3
ret i32 %7
}
/* Variables and functions */
void free(void *);
void Free(void *ptr, const char *file, int line) { return (free(ptr)); }


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

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

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

LLVM IR (-O2):
define void @Free(i8* nocapture %0, i8* nocapture readnone %1, i32 %2) {
tail call void @free(i8* %0)
ret void
}
/* Variables and functions */
unsigned long long pack754(float, int, int);
int /*<<< orphan*/ packi32(unsigned char *, unsigned long long);
extern void serialize_float32(unsigned char *buf, float f) {
  unsigned long long int fhold = (pack754((f), 32, 8));
  packi32(buf, fhold);
}


x86 assembly (clang, -O0):
<serialize_float32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    $0x20,%edi
mov    $0x8,%esi
call   1040 <pack754@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <packi32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialize_float32>:
push   %rbx
mov    %rdi,%rbx
mov    $0x20,%edi
mov    $0x8,%esi
call   1040 <pack754@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <packi32@plt>

LLVM IR (-O0):
define void @serialize_float32(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
%5 = alloca i64
store i8* %0, i8** %3
store float %1, float* %4
%6 = load float, float* %4
%7 = call i64 @pack754(float %6, i32 32, i32 8)
store i64 %7, i64* %5
%8 = load i8*, i8** %3
%9 = load i64, i64* %5
%10 = call i32 @packi32(i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @serialize_float32(i8* %0, float %1) {
%3 = tail call i64 @pack754(float %1, i32 32, i32 8)
%4 = tail call i32 @packi32(i8* %0, i64 %3)
ret void
}
void f(void) {
#pragma css wait forevermore
}


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

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
int test_imm_58uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x58 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_58uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x58,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_58uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 88
%7 = icmp ne i64 %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_58uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 377957122048
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void close_ncurses() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @close_ncurses() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Type definitions */
typedef int volatile uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint32_t USBLPMEndpointGet(uint32_t ui32Base) {
  ;
  return (((*((volatile uint16_t *)(ui32Base + 0x00000360))) & 0x0000F000) >>
          12);
}


x86 assembly (clang, -O0):
<USBLPMEndpointGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x360,%eax
cltq
mov    (%rax),%eax
and    $0xf000,%eax
sar    $0xc,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBLPMEndpointGet>:
mov    %edi,-0x4(%rsp)
movslq -0x4(%rsp),%rax
mov    0x360(%rax),%eax
shr    $0xc,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @USBLPMEndpointGet(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = add nsw i32 %3, 864
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 61440
%9 = ashr i32 %8, 12
ret i32 %9
}

LLVM IR (-O2):
define i32 @USBLPMEndpointGet(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = add nsw i32 %3, 864
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = lshr i32 %7, 12
%9 = and i32 %8, 15
ret i32 %9
}
/* Type definitions */
struct darr {
  int dummy;
};

/* Variables and functions */
void *darr_element(struct darr *, int /*<<< orphan*/);
int /*<<< orphan*/ darr_size(struct darr *);
void *darr_end(struct darr *d) { return darr_element(d, darr_size(d)); }


x86 assembly (clang, -O0):
<darr_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <darr_size@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <darr_element@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<darr_end>:
push   %rbx
mov    %rdi,%rbx
call   1040 <darr_size@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <darr_element@plt>

LLVM IR (-O0):
%struct.darr = type { i32 }
define i8* @darr_end(%struct.darr* %0) {
%2 = alloca %struct.darr*
store %struct.darr* %0, %struct.darr** %2
%3 = load %struct.darr*, %struct.darr** %2
%4 = load %struct.darr*, %struct.darr** %2
%5 = call i32 @darr_size(%struct.darr* %4)
%6 = call i8* @darr_element(%struct.darr* %3, i32 %5)
ret i8* %6
}

LLVM IR (-O2):
%struct.darr = type { i32 }
define i8* @darr_end(%struct.darr* %0) {
%2 = tail call i32 @darr_size(%struct.darr* %0)
%3 = tail call i8* @darr_element(%struct.darr* %0, i32 %2)
ret i8* %3
}
/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ free(char *);
char *strdup(char *);
char *basenamep(char *dir) {
  char *copy = strdup(dir);
  char *result = strdup(basename(copy));
  free(copy);
  return result;
}


x86 assembly (clang, -O0):
<basenamep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <basename@plt>
mov    %rax,%rdi
call   1050 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basenamep>:
push   %r14
push   %rbx
push   %rax
call   1050 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <basename@plt>
mov    %rax,%rdi
call   1050 <strdup@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @basenamep(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strdup(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @basename(i8* %7)
%9 = call i8* @strdup(i8* %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
%12 = load i8*, i8** %4
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @basenamep(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i8* @basename(i8* %2)
%4 = tail call i8* @strdup(i8* %3)
%5 = tail call i32 @free(i8* %2)
ret i8* %4
}
__attribute__((weak)) int _getpid() { return 1; }


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

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

LLVM IR (-O0):
define weak i32 @_getpid() {
ret i32 1
}

LLVM IR (-O2):
define weak i32 @_getpid() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Unix_CloseSerial();
void SerialClose(void) { Unix_CloseSerial(); }


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

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

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

LLVM IR (-O2):
define void @SerialClose() {
%1 = tail call i32 (...) @Unix_CloseSerial()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ adr_to_msf_bcd(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int, int);
void add_header(uint8_t *sector, uint32_t adr, uint8_t mode) {
  memset(sector, 0, 16);
  memset(sector + 1, 0xff, 10);
  adr_to_msf_bcd(adr, sector + 12);
  sector[15] = mode;
}


x86 assembly (clang, -O0):
<add_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    $0xff,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
add    $0x30,%rsi
call   1040 <adr_to_msf_bcd@plt>
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x3c(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_header>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
lea    0x4(%rbx),%rdi
mov    $0xff,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
lea    0x30(%rbx),%rsi
mov    %ebp,%edi
call   1040 <adr_to_msf_bcd@plt>
mov    %r14d,0x3c(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @add_header(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = call i32 @memset(i32* %7, i32 0, i32 16)
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = call i32 @memset(i32* %10, i32 255, i32 10)
%12 = load i32, i32* %5
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 12
%15 = call i32 @adr_to_msf_bcd(i32 %12, i32* %14)
%16 = load i32, i32* %6
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 15
store i32 %16, i32* %18
ret void
}

LLVM IR (-O2):
define void @add_header(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @memset(i32* %0, i32 0, i32 16)
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = tail call i32 @memset(i32* %5, i32 255, i32 10)
%7 = getelementptr inbounds i32, i32* %0, i64 12
%8 = tail call i32 @adr_to_msf_bcd(i32 %1, i32* %7)
%9 = getelementptr inbounds i32, i32* %0, i64 15
store i32 %2, i32* %9
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int check_file_exists(char *path) {
  struct stat st;
  return stat(path, &st) == 0;
}


x86 assembly (clang, -O0):
<check_file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @check_file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @check_file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void javalang() { printf("this is libjavalang.so\n"); }


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

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

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

LLVM IR (-O2):
@str = [23 x i8] c"this is libjavalang.so\00"
define void @javalang() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int flash_image(void *, unsigned int, char *);
int flash_ramdump(void *data, unsigned sz) {
  return flash_image(data, sz, "ramdump");
}


x86 assembly (clang, -O0):
<flash_ramdump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <flash_image@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_ramdump>:
lea    0xee9(%rip),%rdx
jmp    1030 <flash_image@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"ramdump\00"
define i32 @flash_ramdump(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @flash_image(i8* %5, i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@.str = [8 x i8] c"ramdump\00"
define i32 @flash_ramdump(i8* %0, i32 %1) {
%3 = tail call i32 @flash_image(i8* %0, i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
void RTGetOpt(void) {}


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

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

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

LLVM IR (-O2):
define void @RTGetOpt() {
ret void
}
/* Variables and functions */
char *strcpy(int /*<<< orphan*/, char *);
scalar_t__ strlen(char *);
int /*<<< orphan*/ xmalloc(scalar_t__);
char *xstrdup(char *string) {
  return strcpy(xmalloc(strlen(string) + 1), string);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = add nsw i64 %4, 1
%6 = call i32 @xmalloc(i64 %5)
%7 = load i8*, i8** %2
%8 = call i8* @strcpy(i32 %6, i8* %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i32 @xmalloc(i64 %3)
%5 = tail call i8* @strcpy(i32 %4, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wfd_cfg_listen_channel_usage(void) {
  printf("Usage : wfd_cfg_listen_channel [ListenChannel]\n");
  printf("If ListenChannel parameter is provided, 'set' is performed otherwise "
         "'get' is performed.\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"Usage : wfd_cfg_listen_channel [ListenChannel]\0A\00"
@.str.1 = [90 x i8] c"If ListenChannel parameter is provided, 'set' is performed otherwise 'get' is performed.\0A\00"
define void @print_wfd_cfg_listen_channel_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [47 x i8] c"Usage : wfd_cfg_listen_channel [ListenChannel]\00"
@str.2 = [89 x i8] c"If ListenChannel parameter is provided, 'set' is performed otherwise 'get' is performed.\00"
define void @print_wfd_cfg_listen_channel_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([89 x i8], [89 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ green_mult;
};
typedef TYPE_1__ XStandardColormap;

/* Variables and functions */
unsigned long get_XStandardColormap_green_mult(void *_p) {
  return (unsigned long)((XStandardColormap *)_p)->green_mult;
}


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

x86 assembly (clang, -O2):
<get_XStandardColormap_green_mult>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XStandardColormap_green_mult(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XStandardColormap_green_mult(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ StabilizationStatusHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void StabilizationStatusRequestUpdate() {
  UAVObjRequestUpdate(StabilizationStatusHandle());
}


x86 assembly (clang, -O0):
<StabilizationStatusRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <StabilizationStatusHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StabilizationStatusRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <StabilizationStatusHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @StabilizationStatusRequestUpdate() {
%1 = call i32 (...) @StabilizationStatusHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @StabilizationStatusRequestUpdate() {
%1 = tail call i32 (...) @StabilizationStatusHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c_hecmw2fstr_connect_conv(int, int *, int *, int *);
void HECMW2FSTR_CONNECT_CONV_(int *n_elem, int elem_type[],
                              int elem_node_index[], int elem_node_item[]) {
  c_hecmw2fstr_connect_conv(*n_elem, elem_type, elem_node_index,
                            elem_node_item);
}


x86 assembly (clang, -O0):
<HECMW2FSTR_CONNECT_CONV_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <c_hecmw2fstr_connect_conv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HECMW2FSTR_CONNECT_CONV_>:
mov    (%rdi),%edi
jmp    1030 <c_hecmw2fstr_connect_conv@plt>

LLVM IR (-O0):
define void @HECMW2FSTR_CONNECT_CONV_(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = call i32 @c_hecmw2fstr_connect_conv(i32 %10, i32* %11, i32* %12, i32* %13)
ret void
}

LLVM IR (-O2):
define void @HECMW2FSTR_CONNECT_CONV_(i32* nocapture %0, i32* %1, i32* %2, i32* %3) {
%5 = load i32, i32* %0
%6 = tail call i32 @c_hecmw2fstr_connect_conv(i32 %5, i32* %1, i32* %2, i32* %3)
ret void
}
/* Variables and functions */
int spg_get_multiplicity(double **, double **, int *, int, double);
void spg_get_multiplicity_(int *size, double lattice[3][3],
                           double position[][3], int types[], int *num_atom,
                           double *symprec) {
  *size = spg_get_multiplicity(lattice, position, types, *num_atom, *symprec);
}


x86 assembly (clang, -O0):
<spg_get_multiplicity_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
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    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <spg_get_multiplicity@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spg_get_multiplicity_>:
push   %rbx
mov    %rdi,%rbx
mov    (%r8),%eax
movsd  (%r9),%xmm0
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %eax,%ecx
call   1030 <spg_get_multiplicity@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @spg_get_multiplicity_(i32* %0, [3 x double]* %1, [3 x double]* %2, i32* %3, i32* %4, double* %5) {
%7 = alloca i32*
%8 = alloca [3 x double]*
%9 = alloca [3 x double]*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca double*
store i32* %0, i32** %7
store [3 x double]* %1, [3 x double]** %8
store [3 x double]* %2, [3 x double]** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store double* %5, double** %12
%13 = load [3 x double]*, [3 x double]** %8
%14 = bitcast [3 x double]* %13 to double**
%15 = load [3 x double]*, [3 x double]** %9
%16 = bitcast [3 x double]* %15 to double**
%17 = load i32*, i32** %10
%18 = load i32*, i32** %11
%19 = load i32, i32* %18
%20 = load double*, double** %12
%21 = load double, double* %20
%22 = call i32 @spg_get_multiplicity(double** %14, double** %16, i32* %17, i32 %19, double %21)
%23 = load i32*, i32** %7
store i32 %22, i32* %23
ret void
}

LLVM IR (-O2):
define void @spg_get_multiplicity_(i32* nocapture writeonly %0, [3 x double]* %1, [3 x double]* %2, i32* %3, i32* nocapture %4, double* nocapture %5) {
%7 = bitcast [3 x double]* %1 to double**
%8 = bitcast [3 x double]* %2 to double**
%9 = load i32, i32* %4
%10 = load double, double* %5
%11 = tail call i32 @spg_get_multiplicity(double** %7, double** %8, i32* %3, i32 %9, double %10)
store i32 %11, i32* %0
ret void
}
int fun1106() { return 1106; }


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

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

LLVM IR (-O0):
define i32 @fun1106() {
ret i32 1106
}

LLVM IR (-O2):
define i32 @fun1106() {
ret i32 1106
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ imul64(int /*<<< orphan*/, int /*<<< orphan*/);
int64_t isq64(int64_t val) { return imul64(val, val); }


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

x86 assembly (clang, -O2):
<isq64>:
mov    %edi,%esi
jmp    1030 <imul64@plt>

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

LLVM IR (-O2):
define i32 @isq64(i32 %0) {
%2 = tail call i32 @imul64(i32 %0, i32 %0)
ret i32 %2
}
void foo416() {}


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

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

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

LLVM IR (-O2):
define void @foo416() {
ret void
}
/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int read(int, char *, unsigned int);
int fd_read(int fd, char *buf, unsigned int len) {
  register int r;
  do
    r = read(fd, buf, len);
  while ((r == -1) && (errno == EINTR));
  return r;
}


x86 assembly (clang, -O0):
<fd_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x18(%rbp)
mov    %al,-0x19(%rbp)
jne    115d <fd_read+0x4d>
mov    0x2e96(%rip),%rax
mov    (%rax),%rax
mov    0x2e84(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1122 <fd_read+0x12>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_read>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <read@plt>
cmp    $0xffffffff,%eax
jne    114b <fd_read+0x3b>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <fd_read+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @fd_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @read(i32 %9, i8* %10, i32 %11)
store i32 %12, i32* %7
br label %13
13: ; preds = %8
%14 = load i32, i32* %7
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @fd_read(i32 %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%6 = icmp eq i32 %5, -1
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ putc(char const);
void puts(const char *s) {
  for (const char *c = s; *c; c++)
    putc(*c);
  putc('\n');
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <puts+0x3e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putc@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <puts+0x14>
mov    $0xa,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putc@plt>

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

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = tail call i32 @putc(i8 signext 10)
ret void
6: ; preds = %1, %6
%7 = phi i8 [ %11, %6 ], [ %2, %1 ]
%8 = phi i8* [ %10, %6 ], [ %0, %1 ]
%9 = tail call i32 @putc(i8 signext %7)
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %4, label %6
}
int f(int i, int *arr) {
  if (i < 0)
    return 0;
  if (i > 10 && arr)
    return arr[i];
  return f(i + 1, arr);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1135 <f+0x25>
movl   $0x0,-0x4(%rbp)
jmp    116f <f+0x5f>
cmpl   $0xa,-0x8(%rbp)
jle    115d <f+0x4d>
cmpq   $0x0,-0x10(%rbp)
je     115d <f+0x4d>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    116f <f+0x5f>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1030 <f@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %edi,%edi
js     1126 <f+0x26>
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
mov    %rax,%rcx
add    $0x1,%rax
test   %rsi,%rsi
je     1110 <f+0x10>
cmp    $0xb,%ecx
jb     1110 <f+0x10>
mov    -0x4(%rsi,%rax,4),%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32* %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = icmp ne i32* %1, null
br label %6
6: ; preds = %6, %4
%7 = phi i32 [ %0, %4 ], [ %10, %6 ]
%8 = icmp ugt i32 %7, 10
%9 = and i1 %5, %8
%10 = add nuw nsw i32 %7, 1
br i1 %9, label %11, label %6
11: ; preds = %6
%12 = zext i32 %7 to i64
%13 = getelementptr inbounds i32, i32* %1, i64 %12
%14 = load i32, i32* %13
br label %15
15: ; preds = %2, %11
%16 = phi i32 [ %14, %11 ], [ 0, %2 ]
ret i32 %16
}
long SUSPEND(cat, id)
long *cat, *id;
{ return ((long)suspend(*cat, *id)); }


x86 assembly (clang, -O0):
<SUSPEND>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x0,%al
call   1030 <suspend@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SUSPEND>:
push   %rax
mov    (%rdi),%rdi
mov    (%rsi),%rsi
xor    %eax,%eax
call   1030 <suspend@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @SUSPEND(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 = call i32 (i64, i64, ...) bitcast (i32 (...)* @suspend to i32 (i64, i64, ...)*)(i64 %6, i64 %8)
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
define i64 @SUSPEND(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
%5 = tail call i32 (i64, i64, ...) bitcast (i32 (...)* @suspend to i32 (i64, i64, ...)*)(i64 %3, i64 %4)
%6 = sext i32 %5 to i64
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ printf(char *);
FILE *open_file(char const caminho[]) {
  FILE *arquivo = fopen(caminho, "r");
  if (arquivo == NULL) {
    printf("Impossivel abrir arquivo\n");
  }
  return arquivo;
}


x86 assembly (clang, -O0):
<open_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1157 <open_file+0x37>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file>:
push   %rbx
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1141 <open_file+0x21>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [26 x i8] c"Impossivel abrir arquivo\0A\00"
define i32* @open_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i32*, i32** %3
ret i32* %11
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@str = [25 x i8] c"Impossivel abrir arquivo\00"
define noalias i32* @open_file(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32* %2
}