xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t parse_types(char *tar) {
  if (tar[0] == 'r') {
    return 0;
  } else if (tar[0] == 's') {
    return 1;
  } else
    return -1;
}


x86 assembly (clang, -O0):
<parse_types>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x72,%eax
jne    1124 <parse_types+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1147 <parse_types+0x47>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x73,%eax
jne    1140 <parse_types+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <parse_types+0x47>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_types>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    $0x73,%cl
sete   %al
lea    (%rax,%rax,1),%edx
add    $0xffffffff,%edx
xor    %eax,%eax
cmp    $0x72,%cl
cmovne %edx,%eax
ret

LLVM IR (-O0):
define i32 @parse_types(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 114
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %18
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 115
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 1, i32* %2
br label %18
17: ; preds = %10
store i32 -1, i32* %2
br label %18
18: ; preds = %17, %16, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @parse_types(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 115
%4 = select i1 %3, i32 1, i32 -1
%5 = icmp eq i8 %2, 114
%6 = select i1 %5, i32 0, i32 %4
ret i32 %6
}
void ComparatorIntClear(unsigned long ulBase, unsigned long ulComp) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) = 1 << ulComp;
}


x86 assembly (clang, -O0):
<ComparatorIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComparatorIntClear>:
mov    %rsi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @ComparatorIntClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 1, %6
%8 = sext i32 %7 to i64
%9 = load i64, i64* %3
%10 = add i64 %9, 0
%11 = inttoptr i64 %10 to i64*
store volatile i64 %8, i64* %11
ret void
}

LLVM IR (-O2):
define void @ComparatorIntClear(i64 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl nuw i32 1, %3
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %0 to i64*
store volatile i64 %5, i64* %6
ret void
}
char set_bit_char(char val, unsigned pos, char to) {
  return (val & ~((char)1 << pos)) | ((char)to << pos);
}


x86 assembly (clang, -O0):
<set_bit_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movsbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit_char>:
mov    %esi,%ecx
btr    %esi,%edi
movzbl %dl,%eax
shl    %cl,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @set_bit_char(i8 signext %0, i32 %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i8
store i8 %0, i8* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = load i32, i32* %5
%10 = shl i32 1, %9
%11 = xor i32 %10, -1
%12 = and i32 %8, %11
%13 = load i8, i8* %6
%14 = sext i8 %13 to i32
%15 = load i32, i32* %5
%16 = shl i32 %14, %15
%17 = or i32 %12, %16
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @set_bit_char(i8 signext %0, i32 %1, i8 signext %2) {
%4 = zext i8 %0 to i32
%5 = shl nuw i32 1, %1
%6 = xor i32 %5, -1
%7 = and i32 %6, %4
%8 = zext i8 %2 to i32
%9 = shl i32 %8, %1
%10 = or i32 %9, %7
%11 = trunc i32 %10 to i8
ret i8 %11
}
void command_load(struct Command *this, char *text) {}


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

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

LLVM IR (-O0):
%struct.Command = type opaque
define void @command_load(%struct.Command* %0, i8* %1) {
%3 = alloca %struct.Command*
%4 = alloca i8*
store %struct.Command* %0, %struct.Command** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.Command = type opaque
define void @command_load(%struct.Command* nocapture %0, i8* nocapture %1) {
ret void
}
const char *File_Definition(void) {
  return "struct File {\n"
         "  FILE* file;\n"
         "};\n";
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"struct File {\0A FILE* file;\0A};\0A\00"
define i8* @File_Definition() {
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [32 x i8] c"struct File {\0A FILE* file;\0A};\0A\00"
define i8* @File_Definition() {
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
char *strstr(char const *, char const *);
char *r_strstr(const char *haystack, const char *needle) {
  return strstr(haystack, needle);
}


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

x86 assembly (clang, -O2):
<r_strstr>:
jmp    1030 <strstr@plt>

LLVM IR (-O0):
define i8* @r_strstr(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 = call i8* @strstr(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @r_strstr(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %3
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ gcd(int, int);
int main() {
  int y1 = __VERIFIER_nondet_int();
  int y2 = __VERIFIER_nondet_int();
  if (y1 > 0 && y2 > 0) {
    gcd(y1, y2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1162 <main+0x42>
cmpl   $0x0,-0xc(%rbp)
jle    1162 <main+0x42>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <gcd@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %ebx,%ebx
jle    1142 <main+0x22>
test   %eax,%eax
jle    1142 <main+0x22>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <gcd@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp sgt i32 %1, 0
%4 = icmp sgt i32 %2, 0
%5 = select i1 %3, i1 %4, i1 false
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @gcd(i32 %1, i32 %2)
br label %8
8: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fnDispArray(int X[], int n) {
  int i;
  for (i = 1; i <= n; i++)
    printf(" %5d \n", X[i]);
}


x86 assembly (clang, -O0):
<fnDispArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1157 <fnDispArray+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <fnDispArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnDispArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1155 <fnDispArray+0x45>
mov    %esi,%r12d
mov    %rdi,%r14
add    $0x1,%r12d
mov    $0x1,%ebx
lea    0xece(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <fnDispArray+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c" %5d \0A\00"
define void @fnDispArray(i32* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = add nuw i32 %1, 1
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ 1, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %2
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void SysCtlGPIOAHBDisable(uint32_t ui32GPIOPeripheral) {

  ;
  (*((volatile unsigned long *)(0x400FE06C))) &=
      ~(1 << (ui32GPIOPeripheral & 0xF));
}


x86 assembly (clang, -O0):
<SysCtlGPIOAHBDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
cltq
mov    $0x400fe06c,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0x400fe06c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlGPIOAHBDisable>:
mov    %edi,%ecx
and    $0xf,%cl
mov    $0xfffffffe,%eax
rol    %cl,%eax
cltq
and    %rax,0x400fe06c
40
ret

LLVM IR (-O0):
define void @SysCtlGPIOAHBDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
%5 = shl i32 1, %4
%6 = xor i32 %5, -1
%7 = sext i32 %6 to i64
%8 = load volatile i64, i64* inttoptr (i64 1074782316 to i64*)
%9 = and i64 %8, %7
store volatile i64 %9, i64* inttoptr (i64 1074782316 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlGPIOAHBDisable(i32 %0) {
%2 = and i32 %0, 15
%3 = shl nuw nsw i32 1, %2
%4 = xor i32 %3, -1
%5 = sext i32 %4 to i64
%6 = load volatile i64, i64* inttoptr (i64 1074782316 to i64*)
%7 = and i64 %6, %5
store volatile i64 %7, i64* inttoptr (i64 1074782316 to i64*)
ret void
}
/* Variables and functions */
int get_byte();
int get_word(void) {
  int cl;
  int ch;
  cl = get_byte();
  if (cl < 0)
    return cl;
  ch = get_byte();
  if (ch < 0)
    return ch;
  return cl | (ch << 8);
}


x86 assembly (clang, -O0):
<get_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_byte@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1137 <get_word+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <get_word+0x54>
mov    $0x0,%al
call   1030 <get_byte@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1156 <get_word+0x46>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <get_word+0x54>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_word>:
push   %rbx
xor    %eax,%eax
call   1030 <get_byte@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1132 <get_word+0x22>
xor    %eax,%eax
call   1030 <get_byte@plt>
test   %eax,%eax
js     1130 <get_word+0x20>
shl    $0x8,%eax
or     %eax,%ebx
jmp    1132 <get_word+0x22>
mov    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_word() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @get_byte()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i32, i32* %2
store i32 %8, i32* %1
br label %20
9: ; preds = %0
%10 = call i32 (...) @get_byte()
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i32, i32* %3
store i32 %14, i32* %1
br label %20
15: ; preds = %9
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = shl i32 %17, 8
%19 = or i32 %16, %18
store i32 %19, i32* %1
br label %20
20: ; preds = %15, %13, %7
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
define i32 @get_word() {
%1 = tail call i32 (...) @get_byte()
%2 = icmp slt i32 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = tail call i32 (...) @get_byte()
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = shl i32 %4, 8
%8 = or i32 %7, %1
br label %9
9: ; preds = %3, %0, %6
%10 = phi i32 [ %8, %6 ], [ %1, %0 ], [ %4, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void broken_pipe(int fd) { close(fd); }


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

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

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

LLVM IR (-O2):
define void @broken_pipe(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
void *ixy__ptr(size_t x, size_t y) {
  return (
      void *)(((x &
                ((uintptr_t)(~((uintptr_t)((
                    uintptr_t)(((uintptr_t)((0xFULL
                                             << ((sizeof(uintptr_t) * 8ULL) -
                                                 4ULL)) |
                                            ((0x1ULL
                                              << ((sizeof(uintptr_t) * 8ULL) -
                                                  1ULL)) -
                                             1ULL)))
                               << ((sizeof(uintptr_t) * 8ULL) / 2)))))))
               << ((sizeof(uintptr_t) * 8ULL) / 2)) +
              (y & ((uintptr_t)(~((uintptr_t)((
                       uintptr_t)(((uintptr_t)((0xFULL
                                                << ((sizeof(uintptr_t) * 8ULL) -
                                                    4ULL)) |
                                               ((0x1ULL << ((sizeof(uintptr_t) *
                                                             8ULL) -
                                                            1ULL)) -
                                                1ULL)))
                                  << ((sizeof(uintptr_t) * 8ULL) / 2))))))));
}


x86 assembly (clang, -O0):
<ixy__ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0xffffffff,%rax
and    -0x8(%rbp),%rax
shl    $0x20,%rax
movabs $0xffffffff,%rcx
and    -0x10(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ixy__ptr>:
shl    $0x20,%rdi
mov    %esi,%eax
or     %rdi,%rax
ret

LLVM IR (-O0):
define i8* @ixy__ptr(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 = and i64 %5, 4294967295
%7 = shl i64 %6, 32
%8 = load i64, i64* %4
%9 = and i64 %8, 4294967295
%10 = add i64 %7, %9
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
define i8* @ixy__ptr(i64 %0, i64 %1) {
%3 = shl i64 %0, 32
%4 = and i64 %1, 4294967295
%5 = or i64 %4, %3
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ ROR16(int /*<<< orphan*/, int);
int /*<<< orphan*/ SA1Direct(int);
void Op66M0(void) { ROR16(SA1Direct(3), 0xFFFF); }


x86 assembly (clang, -O0):
<Op66M0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1040 <SA1Direct@plt>
mov    %eax,%edi
mov    $0xffff,%esi
call   1030 <ROR16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op66M0>:
push   %rax
mov    $0x3,%edi
call   1040 <SA1Direct@plt>
mov    %eax,%edi
mov    $0xffff,%esi
pop    %rax
jmp    1030 <ROR16@plt>

LLVM IR (-O0):
define void @Op66M0() {
%1 = call i32 @SA1Direct(i32 3)
%2 = call i32 @ROR16(i32 %1, i32 65535)
ret void
}

LLVM IR (-O2):
define void @Op66M0() {
%1 = tail call i32 @SA1Direct(i32 3)
%2 = tail call i32 @ROR16(i32 %1, i32 65535)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
unsigned long long fwrite(const void *ptr, unsigned long long size,
                          unsigned long long count, void **stream) {
  printk("Write fwrite()\n");
  return 0;
}


x86 assembly (clang, -O0):
<fwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed1(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"Write fwrite()\0A\00"
define i64 @fwrite(i8* nocapture readnone %0, i64 %1, i64 %2, i8** nocapture readnone %3) {
%5 = tail call i32 @printk(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i64 0
}
void my_suite_teardown(void) {}


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

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

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

LLVM IR (-O2):
define void @my_suite_teardown() {
ret void
}
/* Type definitions */
typedef size_t ssize_t;

/* Variables and functions */
size_t read(int, void *, size_t);
int /*<<< orphan*/ warn(char *, char const *);
ssize_t s_read(int fd, const char *fn, void *buf, size_t n) {
  ssize_t ret;
  ret = read(fd, buf, n);
  if (ret < n) {
    warn("unexpected end-of-file: %s", fn);
    return -1;
  } else {
    return ret;
  }
}


x86 assembly (clang, -O0):
<s_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1040 <read@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1176 <s_read+0x56>
mov    -0x18(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1030 <warn@plt>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    117e <s_read+0x5e>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_read>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rsi,%r14
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1040 <read@plt>
cmp    %rbx,%rax
jae    1150 <s_read+0x30>
lea    0xebf(%rip),%rdi
mov    %r14,%rsi
call   1030 <warn@plt>
mov    $0xffffffffffffffff,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"unexpected end-of-file: %s\00"
define i64 @s_read(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i64
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
%11 = load i32, i32* %6
%12 = load i8*, i8** %8
%13 = load i64, i64* %9
%14 = call i64 @read(i32 %11, i8* %12, i64 %13)
store i64 %14, i64* %10
%15 = load i64, i64* %10
%16 = load i64, i64* %9
%17 = icmp ult i64 %15, %16
br i1 %17, label %18, label %21
18: ; preds = %4
%19 = load i8*, i8** %7
%20 = call i32 @warn(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %19)
store i64 -1, i64* %5
br label %23
21: ; preds = %4
%22 = load i64, i64* %10
store i64 %22, i64* %5
br label %23
23: ; preds = %21, %18
%24 = load i64, i64* %5
ret i64 %24
}

LLVM IR (-O2):
@.str = [27 x i8] c"unexpected end-of-file: %s\00"
define i64 @s_read(i32 %0, i8* %1, i8* nocapture %2, i64 %3) {
%5 = tail call i64 @read(i32 %0, i8* %2, i64 %3)
%6 = icmp ult i64 %5, %3
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @warn(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %9
9: ; preds = %4, %7
%10 = phi i64 [ -1, %7 ], [ %5, %4 ]
ret i64 %10
}
/* Type definitions */
struct ps_summary {
  int dummy;
};
struct obus_server {
  int dummy;
};
struct obus_object {
  int dummy;
};

/* Variables and functions */
int obus_server_register_object(struct obus_server *, struct obus_object *);
int ps_summary_register(struct obus_server *server, struct ps_summary *object) {
  struct obus_object *obj = (struct obus_object *)object;
  return obus_server_register_object(server, obj);
}


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

x86 assembly (clang, -O2):
<ps_summary_register>:
jmp    1030 <obus_server_register_object@plt>

LLVM IR (-O0):
%struct.obus_server = type { i32 }
%struct.ps_summary = type { i32 }
%struct.obus_object = type { i32 }
define i32 @ps_summary_register(%struct.obus_server* %0, %struct.ps_summary* %1) {
%3 = alloca %struct.obus_server*
%4 = alloca %struct.ps_summary*
%5 = alloca %struct.obus_object*
store %struct.obus_server* %0, %struct.obus_server** %3
store %struct.ps_summary* %1, %struct.ps_summary** %4
%6 = load %struct.ps_summary*, %struct.ps_summary** %4
%7 = bitcast %struct.ps_summary* %6 to %struct.obus_object*
store %struct.obus_object* %7, %struct.obus_object** %5
%8 = load %struct.obus_server*, %struct.obus_server** %3
%9 = load %struct.obus_object*, %struct.obus_object** %5
%10 = call i32 @obus_server_register_object(%struct.obus_server* %8, %struct.obus_object* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.obus_server = type { i32 }
%struct.ps_summary = type { i32 }
%struct.obus_object = type { i32 }
define i32 @ps_summary_register(%struct.obus_server* %0, %struct.ps_summary* %1) {
%3 = bitcast %struct.ps_summary* %1 to %struct.obus_object*
%4 = tail call i32 @obus_server_register_object(%struct.obus_server* %0, %struct.obus_object* %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ atomic_int;

/* Variables and functions */
int /*<<< orphan*/ ATOMIC_VAR_INIT(int);
int /*<<< orphan*/ test_add_sub();
int /*<<< orphan*/ test_and();
int /*<<< orphan*/ test_inc_dec();
int /*<<< orphan*/ test_or();
int /*<<< orphan*/ test_ptr(int /*<<< orphan*/ *);
int /*<<< orphan*/ test_xor();
int main(void) {
  atomic_int i = ATOMIC_VAR_INIT(1);
  test_inc_dec();
  test_add_sub();
  test_and();
  test_xor();
  test_or();
  test_ptr(&i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1080 <ATOMIC_VAR_INIT@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1070 <test_inc_dec@plt>
mov    $0x0,%al
call   1040 <test_add_sub@plt>
mov    $0x0,%al
call   1090 <test_and@plt>
mov    $0x0,%al
call   1030 <test_xor@plt>
mov    $0x0,%al
call   1050 <test_or@plt>
lea    -0x4(%rbp),%rdi
call   1060 <test_ptr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1080 <ATOMIC_VAR_INIT@plt>
mov    %eax,0x4(%rsp)
xor    %eax,%eax
call   1070 <test_inc_dec@plt>
xor    %eax,%eax
call   1040 <test_add_sub@plt>
xor    %eax,%eax
call   1090 <test_and@plt>
xor    %eax,%eax
call   1030 <test_xor@plt>
xor    %eax,%eax
call   1050 <test_or@plt>
lea    0x4(%rsp),%rdi
call   1060 <test_ptr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = call i32 @ATOMIC_VAR_INIT(i32 1)
store i32 %2, i32* %1
%3 = call i32 (...) @test_inc_dec()
%4 = call i32 (...) @test_add_sub()
%5 = call i32 (...) @test_and()
%6 = call i32 (...) @test_xor()
%7 = call i32 (...) @test_or()
%8 = call i32 @test_ptr(i32* %1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @ATOMIC_VAR_INIT(i32 1)
store i32 %3, i32* %1
%4 = tail call i32 (...) @test_inc_dec()
%5 = tail call i32 (...) @test_add_sub()
%6 = tail call i32 (...) @test_and()
%7 = tail call i32 (...) @test_xor()
%8 = tail call i32 (...) @test_or()
%9 = call i32 @test_ptr(i32* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ *stdout;
void enhexFclose(FILE *file) {
  if (!(stdin == file || stdout == file)) {
    fclose(file);
  }
}


x86 assembly (clang, -O0):
<enhexFclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%rax
cmp    -0x8(%rbp),%rax
je     114d <enhexFclose+0x3d>
mov    0x2ea1(%rip),%rax
mov    (%rax),%rax
cmp    -0x8(%rbp),%rax
je     114d <enhexFclose+0x3d>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enhexFclose>:
mov    0x2ed1(%rip),%rax
cmp    %rdi,(%rax)
je     112d <enhexFclose+0x1d>
mov    0x2eb5(%rip),%rax
cmp    %rdi,(%rax)
je     112d <enhexFclose+0x1d>
jmp    1030 <fclose@plt>
ret

LLVM IR (-O0):
@stdin = global i32* null
@stdout = global i32* null
define void @enhexFclose(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** @stdin
%4 = load i32*, i32** %2
%5 = icmp eq i32* %3, %4
br i1 %5, label %13, label %6
6: ; preds = %1
%7 = load i32*, i32** @stdout
%8 = load i32*, i32** %2
%9 = icmp eq i32* %7, %8
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = load i32*, i32** %2
%12 = call i32 @fclose(i32* %11)
br label %13
13: ; preds = %10, %6, %1
ret void
}

LLVM IR (-O2):
@stdin = global i32* null
@stdout = global i32* null
define void @enhexFclose(i32* nocapture %0) {
%2 = load i32*, i32** @stdin
%3 = icmp eq i32* %2, %0
%4 = load i32*, i32** @stdout
%5 = icmp eq i32* %4, %0
%6 = select i1 %3, i1 true, i1 %5
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @fclose(i32* %0)
br label %9
9: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void pic_eoi(unsigned int irq) {
  if (irq >= 8) {
    outb(0xA0, 0x20);
  }
  outb(0x20, 0x20);
}


x86 assembly (clang, -O0):
<pic_eoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jb     1134 <pic_eoi+0x24>
mov    $0xa0,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0x20,%esi
mov    %esi,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic_eoi>:
cmp    $0x8,%edi
jb     1129 <pic_eoi+0x19>
push   %rax
mov    $0xa0,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
add    $0x8,%rsp
mov    $0x20,%edi
mov    $0x20,%esi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @pic_eoi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp uge i32 %3, 8
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @outb(i32 160, i32 32)
br label %7
7: ; preds = %5, %1
%8 = call i32 @outb(i32 32, i32 32)
ret void
}

LLVM IR (-O2):
define void @pic_eoi(i32 %0) {
%2 = icmp ugt i32 %0, 7
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @outb(i32 160, i32 32)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @outb(i32 32, i32 32)
ret void
}
int somar(int a, int b) {
  int r = a + b;
  return r;
}


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

x86 assembly (clang, -O2):
<somar>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @somar(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 = load i32, i32* %4
%8 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @somar(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_resolve_get_timeout(void *resolve, uint64_t *usec) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_resolve_get_timeout>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_resolve_get_timeout>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_resolve_get_timeout(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_resolve_get_timeout(i8* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ func_8(int, char *, unsigned long);
void func_7(int a, char *b, unsigned long c) { func_8(a, b, c); }


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

x86 assembly (clang, -O2):
<func_7>:
jmp    1030 <func_8@plt>

LLVM IR (-O0):
define void @func_7(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @func_8(i32 %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @func_7(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @func_8(i32 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
long sgn1(double);
long sgn(double x) { return sgn1(x); }


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

x86 assembly (clang, -O2):
<sgn>:
jmp    1030 <sgn1@plt>

LLVM IR (-O0):
define i64 @sgn(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @sgn1(double %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @sgn(double %0) {
%2 = tail call i64 @sgn1(double %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("\n Aqui aparecerao 50 nomeros impares ");
  int num;
  num = 1;
  while (num <= 150) {
    printf("%d-", num);
    num = num + 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x96,-0x8(%rbp)
jg     1160 <main+0x50>
mov    -0x8(%rbp),%esi
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%ebx
lea    0xef8(%rip),%r14
xchg   %ax,%ax
add    $0x2,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x95,%ebx
jb     1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [38 x i8] c"\0A Aqui aparecerao 50 nomeros impares \00"
@.str.1 = [4 x i8] c"%d-\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %5, %2 ]
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = add nuw nsw i32 %3, 2
%6 = icmp ult i32 %3, 149
br i1 %6, label %2, label %7
7: ; preds = %2
ret i32 0
}
/* Type definitions */
struct svc_req {
  int dummy;
};

/* Variables and functions */
int l2tp_tunnel_profile_get_1_svc(char *, void *, struct svc_req *);
int _l2tp_tunnel_profile_get_1(char **argp, void *result,
                               struct svc_req *rqstp) {
  return (l2tp_tunnel_profile_get_1_svc(*argp, result, rqstp));
}


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

x86 assembly (clang, -O2):
<_l2tp_tunnel_profile_get_1>:
mov    (%rdi),%rdi
jmp    1030 <l2tp_tunnel_profile_get_1_svc@plt>

LLVM IR (-O0):
%struct.svc_req = type { i32 }
define i32 @_l2tp_tunnel_profile_get_1(i8** %0, i8* %1, %struct.svc_req* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca %struct.svc_req*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store %struct.svc_req* %2, %struct.svc_req** %6
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = load i8*, i8** %5
%10 = load %struct.svc_req*, %struct.svc_req** %6
%11 = call i32 @l2tp_tunnel_profile_get_1_svc(i8* %8, i8* %9, %struct.svc_req* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
define i32 @_l2tp_tunnel_profile_get_1(i8** nocapture %0, i8* %1, %struct.svc_req* %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @l2tp_tunnel_profile_get_1_svc(i8* %4, i8* %1, %struct.svc_req* %2)
ret i32 %5
}
int chdir(const char *path) {
  ;
  return -1;
}


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

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

LLVM IR (-O0):
define i32 @chdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 -1
}

LLVM IR (-O2):
define i32 @chdir(i8* nocapture readnone %0) {
ret i32 -1
}
int main() {
  int x;
  x = 0;
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xa5() {
  Assert_real((ispunct(165) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              830, ("ispunct should be 0 for 0xa5"));
}


x86 assembly (clang, -O0):
<t_ispunct_0xa5>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa5,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x33e,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0xa5>:
push   %rax
mov    $0xa5,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x33e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xa5\00"
define void @t_ispunct_0xa5() {
%1 = call i64 @ispunct(i32 165)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 830, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xa5\00"
define void @t_ispunct_0xa5() {
%1 = tail call i64 @ispunct(i32 165)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 830, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int registers_read_byte(int);
uint8_t registers_is_write_enabled(void) {
  return (registers_read_byte(0x05) & (1 << 0x01)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<registers_is_write_enabled>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <registers_read_byte@plt>
mov    %eax,%edx
and    $0x2,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<registers_is_write_enabled>:
push   %rax
mov    $0x5,%edi
call   1030 <registers_read_byte@plt>
shr    %eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @registers_is_write_enabled() {
%1 = call i32 @registers_read_byte(i32 5)
%2 = and i32 %1, 2
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 1, i32 0
ret i32 %5
}

LLVM IR (-O2):
define i32 @registers_is_write_enabled() {
%1 = tail call i32 @registers_read_byte(i32 5)
%2 = lshr i32 %1, 1
%3 = and i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int syscall(int, int, char const *, int, int);
int faccessat(int fd, const char *filename, int amode, int flag) {
  return syscall(334, fd, filename, amode, flag);
}


x86 assembly (clang, -O0):
<faccessat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    $0x14e,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<faccessat>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x14e,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @faccessat(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @syscall(i32 334, i32 %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int FS_X_OS_Exit();
int FS_Exit(void) { return FS_X_OS_Exit(); }


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

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

LLVM IR (-O0):
define i32 @FS_Exit() {
%1 = call i32 (...) @FS_X_OS_Exit()
ret i32 %1
}

LLVM IR (-O2):
define i32 @FS_Exit() {
%1 = tail call i32 (...) @FS_X_OS_Exit()
ret i32 %1
}
int test_imm_1Auint16_mem(unsigned short *val) {
  return ((*val) & (0x1A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Auint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 26
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
bool strempty(const char *str) { return !*str; }


x86 assembly (clang, -O0):
<strempty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strempty>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @strempty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @strempty(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void msm_update_rq_stats(void) {}


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

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

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

LLVM IR (-O2):
define void @msm_update_rq_stats() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int getpid();
int writepid(char *pidpath) {
  FILE *fp;
  fp = fopen(pidpath, "w");
  if (fp != NULL) {
    fprintf(fp, "%d", getpid());
    fclose(fp);
  }
  return 0;
}


x86 assembly (clang, -O0):
<writepid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1195 <writepid+0x55>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
lea    0xe7b(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writepid>:
push   %rbx
lea    0xeb8(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     1175 <writepid+0x35>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1050 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @writepid(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 ne i32* %6, null
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = call i32 (...) @getpid()
%11 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i32*, i32** %3
%13 = call i32 @fclose(i32* %12)
br label %14
14: ; preds = %8, %1
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @writepid(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 %8, label %4
4: ; preds = %1
%5 = tail call i32 (...) @getpid()
%6 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @fclose(i32* %2)
br label %8
8: ; preds = %4, %1
ret i32 0
}