xunge/DecIR huggingface dataset:
/* Variables and functions */
int geteuid();
int getuid();
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char **argv) {
  printf("real user ID is %d, while effective user id is %d\n", getuid(),
         geteuid());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <geteuid@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"real user ID is %d, while effective user id is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @getuid()
%7 = call i32 (...) @geteuid()
%8 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [51 x i8] c"real user ID is %d, while effective user id is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getuid()
%4 = tail call i32 (...) @geteuid()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i32 0
}
int __ffs(int x) { return __builtin_ffs(x); }


x86 assembly (clang, -O0):
<__ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
bsf    %edx,%eax
add    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ffs>:
bsf    %edi,%ecx
mov    $0xffffffff,%eax
cmovne %ecx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @__ffs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.cttz.i32(i32 %3, i1 true)
%5 = add i32 %4, 1
%6 = icmp eq i32 %3, 0
%7 = select i1 %6, i32 0, i32 %5
ret i32 %7
}

LLVM IR (-O2):
define i32 @__ffs(i32 %0) {
%2 = tail call i32 @llvm.cttz.i32(i32 %0, i1 true)
%3 = add nuw nsw i32 %2, 1
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 0, i32 %3
ret i32 %5
}
int compare(const void *v, const void *o) { return *(int *)v - *(int *)o; }


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

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

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int isspace(int ch) {
  int space = 0;
  if ((ch == ' ') || (ch == '\f') || (ch == '\n') || (ch == '\r') ||
      (ch == '\t') || (ch == '\v'))
    space = 1;
  return space;
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x4(%rbp)
je     114a <isspace+0x4a>
cmpl   $0xc,-0x4(%rbp)
je     114a <isspace+0x4a>
cmpl   $0xa,-0x4(%rbp)
je     114a <isspace+0x4a>
cmpl   $0xd,-0x4(%rbp)
je     114a <isspace+0x4a>
cmpl   $0x9,-0x4(%rbp)
je     114a <isspace+0x4a>
cmpl   $0xb,-0x4(%rbp)
jne    1151 <isspace+0x51>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
lea    -0x9(%rdi),%eax
cmp    $0x5,%eax
jae    110e <isspace+0xe>
mov    $0x1,%eax
ret
xor    %eax,%eax
cmp    $0x20,%edi
je     1108 <isspace+0x8>
jmp    110d <isspace+0xd>

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %3 [
i32 32, label %2
i32 13, label %2
i32 12, label %2
i32 11, label %2
i32 10, label %2
i32 9, label %2
]
2: ; preds = %1, %1, %1, %1, %1, %1
br label %3
3: ; preds = %1, %2
%4 = phi i32 [ 1, %2 ], [ 0, %1 ]
ret i32 %4
}
void INT_Excep_MTU2_TGIB2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU2_TGIB2() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void col_set_green(int *colour, uint8_t green) {
  *colour = (*colour & ~0xFF00) | ((green << 8) & 0xFF00);
}


x86 assembly (clang, -O0):
<col_set_green>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xffff00ff,%ecx
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
and    $0xff00,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<col_set_green>:
mov    %sil,0x1(%rdi)
ret

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

LLVM IR (-O2):
define void @col_set_green(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = and i32 %3, -65281
%5 = shl i32 %1, 8
%6 = and i32 %5, 65280
%7 = or i32 %4, %6
store i32 %7, i32* %0
ret void
}
int isNotVowel(char c) {
  if (c != 97 && c != 101 && c != 105 && c != 111 && c != 117) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isNotVowel>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
je     1157 <isNotVowel+0x57>
movsbl -0x5(%rbp),%eax
cmp    $0x65,%eax
je     1157 <isNotVowel+0x57>
movsbl -0x5(%rbp),%eax
cmp    $0x69,%eax
je     1157 <isNotVowel+0x57>
movsbl -0x5(%rbp),%eax
cmp    $0x6f,%eax
je     1157 <isNotVowel+0x57>
movsbl -0x5(%rbp),%eax
cmp    $0x75,%eax
je     1157 <isNotVowel+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <isNotVowel+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNotVowel>:
add    $0x9f,%dil
ror    %dil
mov    $0x1,%eax
cmp    $0xa,%dil
ja     1120 <isNotVowel+0x20>
movsbq %dil,%rax
lea    0xee3(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @isNotVowel(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 97
br i1 %6, label %7, label %24
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 101
br i1 %10, label %11, label %24
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 105
br i1 %14, label %15, label %24
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 111
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 117
br i1 %22, label %23, label %24
23: ; preds = %19
store i32 1, i32* %2
br label %25
24: ; preds = %19, %15, %11, %7, %1
store i32 0, i32* %2
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@switch.table.isNotVowel = [11 x i32] [i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, i32 1, i32 1, i32 0]
define i32 @isNotVowel(i8 signext %0) {
%2 = add i8 %0, -97
%3 = tail call i8 @llvm.fshl.i8(i8 %2, i8 %2, i8 7)
%4 = icmp ult i8 %3, 11
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i8 %3 to i64
%7 = getelementptr inbounds [11 x i32], [11 x i32]* @switch.table.isNotVowel, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ 1, %1 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ xml_read();
void lmx_read(void) { xml_read(); }


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

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

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

LLVM IR (-O2):
define void @lmx_read() {
%1 = tail call i32 (...) @xml_read()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help_book() {
  puts("book [<guest name>]\n"
       "Adds an entry into the associated .hms file for the guest, if rooms\n"
       "are available. Prompts for guest name if not provided as input.");
}


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

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

LLVM IR (-O0):
@.str = [152 x i8] c"book [<guest name>]\0AAdds an entry into the associated .hms file for the guest, if rooms\0Aare available. Prompts for guest name if not provided as input.\00"
define void @help_book() {
%1 = call i32 @puts(i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [152 x i8] c"book [<guest name>]\0AAdds an entry into the associated .hms file for the guest, if rooms\0Aare available. Prompts for guest name if not provided as input.\00"
define void @help_book() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
unsigned int f(unsigned int);
int main(void) {
  unsigned int x = 0;
  while (x < 0x0fffffff) {
    x = f(x);
  }
  __VERIFIER_assert(!(x % 2));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xfffffff,-0x8(%rbp)
jae    1153 <main+0x33>
mov    -0x8(%rbp),%edi
call   1030 <f@plt>
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <f@plt>
cmp    $0xfffffff,%eax
jb     1130 <main+0x10>
not    %eax
and    $0x1,%eax
mov    %eax,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp ult i32 %4, 268435455
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @f(i32 %7)
store i32 %8, i32* %2
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
%11 = urem i32 %10, 2
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
%15 = call i32 @__VERIFIER_assert(i32 %14)
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
%3 = tail call i32 @f(i32 %2)
%4 = icmp ult i32 %3, 268435455
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = and i32 %3, 1
%7 = xor i32 %6, 1
%8 = tail call i32 @__VERIFIER_assert(i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x12() {
  Assert_real((isupper(18) == 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_isupper.c",
              95, ("isupper should be 0 for 0x12"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x12>:
push   %rax
mov    $0x12,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x5f,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x12\00"
define void @t_isupper_0x12() {
%1 = call i64 @isupper(i32 18)
%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 95, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x12\00"
define void @t_isupper_0x12() {
%1 = tail call i64 @isupper(i32 18)
%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 95, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main() {
  int data1 = 10;
  int data2 = 20;
  int result;
  __asm__ __volatile__("nop" : "=a"(result) : "d"(data1), "a"(data2));
  printf("The result is %d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%eax
nop
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edx
mov    $0x14,%eax
nop
lea    0xedd(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 asm sideeffect "nop", "={ax},{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = tail call i32 asm sideeffect "nop", "={ax},{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 10, i32 20)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _login_error(char const *message, int ret) {
  fputs("login"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_login_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_login_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"login: \00"
@stderr = global i32 0
define i32 @_login_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ mp2vseqdx_get_color(int const *);
uint8_t mp2vseqdx_get_matrixcoeffs(const uint8_t *p_mp2vseqdx) {
  if (!mp2vseqdx_get_color(p_mp2vseqdx))
    return 1;
  return p_mp2vseqdx[7];
}


x86 assembly (clang, -O0):
<mp2vseqdx_get_matrixcoeffs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <mp2vseqdx_get_color@plt>
cmp    $0x0,%eax
jne    113a <mp2vseqdx_get_matrixcoeffs+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1144 <mp2vseqdx_get_matrixcoeffs+0x34>
mov    -0x10(%rbp),%rax
mov    0x1c(%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseqdx_get_matrixcoeffs>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mp2vseqdx_get_color@plt>
test   %eax,%eax
je     1122 <mp2vseqdx_get_matrixcoeffs+0x12>
mov    0x1c(%rbx),%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mp2vseqdx_get_matrixcoeffs(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = call i32 @mp2vseqdx_get_color(i32* %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 1, i32* %2
br label %12
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 7
%11 = load i32, i32* %10
store i32 %11, i32* %2
br label %12
12: ; preds = %8, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @mp2vseqdx_get_matrixcoeffs(i32* %0) {
%2 = tail call i32 @mp2vseqdx_get_color(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds i32, i32* %0, i64 7
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 1, %1 ]
ret i32 %8
}
void no_op() { int k = 0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
int /*<<< orphan*/ IntEnable(int);
int /*<<< orphan*/ IntRegister(int, void (*)());
void EMACIntRegister(uint32_t ui32Base, void (*pfnHandler)(void)) {
  ASSERT(pfnHandler != 0);
  IntRegister(56, pfnHandler);
  IntEnable(56);
}


x86 assembly (clang, -O0):
<EMACIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <ASSERT@plt>
mov    -0x10(%rbp),%rsi
mov    $0x38,%edi
call   1040 <IntRegister@plt>
mov    $0x38,%edi
call   1030 <IntEnable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACIntRegister>:
push   %rbx
mov    %rsi,%rbx
xor    %edi,%edi
test   %rsi,%rsi
setne  %dil
call   1050 <ASSERT@plt>
mov    $0x38,%edi
mov    %rbx,%rsi
call   1040 <IntRegister@plt>
mov    $0x38,%edi
pop    %rbx
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @EMACIntRegister(i32 %0, void ()* %1) {
%3 = alloca i32
%4 = alloca void ()*
store i32 %0, i32* %3
store void ()* %1, void ()** %4
%5 = load void ()*, void ()** %4
%6 = icmp ne void ()* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load void ()*, void ()** %4
%10 = bitcast void ()* %9 to void (...)*
%11 = call i32 @IntRegister(i32 56, void (...)* %10)
%12 = call i32 @IntEnable(i32 56)
ret void
}

LLVM IR (-O2):
define void @EMACIntRegister(i32 %0, void ()* %1) {
%3 = icmp ne void ()* %1, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = bitcast void ()* %1 to void (...)*
%7 = tail call i32 @IntRegister(i32 56, void (...)* %6)
%8 = tail call i32 @IntEnable(i32 56)
ret void
}
/* Variables and functions */
unsigned int psr_get();
int /*<<< orphan*/ psr_set(unsigned int);
void psr_enable_traps(void) {
  unsigned int psr = psr_get();
  psr |= 0x20;
  psr_set(psr);
}


x86 assembly (clang, -O0):
<psr_enable_traps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <psr_get@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <psr_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psr_enable_traps>:
push   %rax
xor    %eax,%eax
call   1030 <psr_get@plt>
or     $0x20,%eax
mov    %eax,%edi
pop    %rax
jmp    1040 <psr_set@plt>

LLVM IR (-O0):
define void @psr_enable_traps() {
%1 = alloca i32
%2 = call i32 (...) @psr_get()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = or i32 %3, 32
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @psr_set(i32 %5)
ret void
}

LLVM IR (-O2):
define void @psr_enable_traps() {
%1 = tail call i32 (...) @psr_get()
%2 = or i32 %1, 32
%3 = tail call i32 @psr_set(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("Hello World!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ qprintf(char *, int);
int q__free(int hex) {
  qprintf("*** "
          "_free"
          "(%x)\n",
          hex);
  return 0;
}


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

x86 assembly (clang, -O2):
<q__free>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <qprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"*** _free(%x)\0A\00"
define i32 @q__free(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @qprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"*** _free(%x)\0A\00"
define i32 @q__free(i32 %0) {
%2 = tail call i32 @qprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ evutil_socket_t;

/* Variables and functions */
int evutil_make_listen_socket_reuseable(evutil_socket_t sock) {
  (void)sock;
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @evutil_make_listen_socket_reuseable(i32 %0) {
ret i32 -1
}
OP(dd, ea) {
  illegal_1();
  op_ea();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_ea@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_ea@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_ea()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_ea()
ret i32 undef
}
int to_int(char c) { return (int)((unsigned char)c); }


x86 assembly (clang, -O0):
<to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_int>:
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @to_int(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @to_int(i8 signext %0) {
%2 = zext i8 %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ exit(int);
char *malloc(int);
int strlen(char *);
char *strncpy(char *, char *, int);
char *savestr(char *cp) {
  int len;
  char *new;
  len = strlen(cp) + 1;
  new = malloc(len);
  if (!new) {
    error("out of memory");
    exit(1);
  }
  return (strncpy(new, cp, len));
}


x86 assembly (clang, -O0):
<savestr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1198 <savestr+0x48>
lea    0xe77(%rip),%rdi
call   1060 <error@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<savestr>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ebp
add    $0x1,%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     117f <savestr+0x2f>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <strncpy@plt>
lea    0xe7a(%rip),%rdi
call   1060 <error@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @savestr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %15, label %12
12: ; preds = %1
%13 = call i32 @error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %1
%16 = load i8*, i8** %4
%17 = load i8*, i8** %2
%18 = load i32, i32* %3
%19 = call i8* @strncpy(i8* %16, i8* %17, i32 %18)
ret i8* %19
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define i8* @savestr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = tail call i8* @strncpy(i8* %4, i8* %0, i32 %3)
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x5e() {
  Assert_real((isxdigit(94) == 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_isxdigit.c",
              475, ("isxdigit should be 0 for ^"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x5e>:
push   %rax
mov    $0x5e,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x1db,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for ^\00"
define void @t_isxdigit_0x5e() {
%1 = call i64 @isxdigit(i32 94)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 475, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for ^\00"
define void @t_isxdigit_0x5e() {
%1 = tail call i64 @isxdigit(i32 94)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 475, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_imm_op();
int /*<<< orphan*/ arm_memio_strb(int /*<<< orphan*/);
void arm_strb_imm() { arm_memio_strb(arm_memio_imm_op()); }


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

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

LLVM IR (-O0):
define void @arm_strb_imm() {
%1 = call i32 (...) @arm_memio_imm_op()
%2 = call i32 @arm_memio_strb(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_strb_imm() {
%1 = tail call i32 (...) @arm_memio_imm_op()
%2 = tail call i32 @arm_memio_strb(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int scanf(char *, int *);
int /*<<< orphan*/ stderr;
void checkInput(int *a) {
  if ((scanf("%d", a)) != 1) {
    fprintf(stderr, "Wrong input values!");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checkInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     1178 <checkInput+0x48>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkInput>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1147 <checkInput+0x17>
pop    %rax
ret
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"Wrong input values!\00"
@EXIT_FAILURE = global i32 0
define void @checkInput(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"Wrong input values!\00"
@EXIT_FAILURE = global i32 0
define void @checkInput(i32* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
int test_imm_8Cuint16_mem(unsigned short *val) {
  return ((*val) & (0x8C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_8Cuint16_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, 140
%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_8Cuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 140
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int ad7298_scan_from_ring(struct iio_dev *indio_dev, long ch) { return 0; }


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

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

LLVM IR (-O0):
%struct.iio_dev = type opaque
define i32 @ad7298_scan_from_ring(%struct.iio_dev* %0, i64 %1) {
%3 = alloca %struct.iio_dev*
%4 = alloca i64
store %struct.iio_dev* %0, %struct.iio_dev** %3
store i64 %1, i64* %4
ret i32 0
}

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @ad7298_scan_from_ring(%struct.iio_dev* nocapture readnone %0, i64 %1) {
ret i32 0
}
void socfpga_cyclone5_mmc_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @socfpga_cyclone5_mmc_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Cmd_AddCommand(char const *, void *);
void CL_AddCgameCommand(const char *cmdName) {
  Cmd_AddCommand(cmdName, ((void *)0));
}


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

x86 assembly (clang, -O2):
<CL_AddCgameCommand>:
xor    %esi,%esi
jmp    1030 <Cmd_AddCommand@plt>

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

LLVM IR (-O2):
define void @CL_AddCgameCommand(i8* %0) {
%2 = tail call i32 @Cmd_AddCommand(i8* %0, i8* null)
ret void
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int);
char *format_time(time_t time) {
  static char str[10];
  int hh = time / 3600;
  int mm = (time - hh * 3600) / 60;
  sprintf(str, "%d:%02d", hh, mm);
  return str;
}


x86 assembly (clang, -O0):
<format_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   $0xe10,-0x8(%rbp),%ecx
sub    %ecx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0x2edc(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ec9(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_time>:
push   %rbx
movslq %edi,%rax
imul   $0xffffffff91a2b3c5,%rax,%rdx
shr    $0x20,%rdx
add    %eax,%edx
mov    %edx,%ecx
shr    $0x1f,%ecx
sar    $0xb,%edx
add    %ecx,%edx
imul   $0xfffff1f0,%edx,%ecx
add    %eax,%ecx
movslq %ecx,%rcx
imul   $0xffffffff88888889,%rcx,%rax
shr    $0x20,%rax
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x5,%ecx
add    %eax,%ecx
lea    0x2ed5(%rip),%rbx
lea    0xea5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@format_time.str = internal global [10 x i8] zeroinitializer
@.str = [8 x i8] c"%d:%02d\00"
define i8* @format_time(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 3600
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = mul nsw i32 %8, 3600
%10 = sub nsw i32 %7, %9
%11 = sdiv i32 %10, 60
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @sprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @format_time.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @format_time.str, i64 0, i64 0)
}

LLVM IR (-O2):
@format_time.str = internal global [10 x i8] zeroinitializer
@.str = [8 x i8] c"%d:%02d\00"
define i8* @format_time(i32 %0) {
%2 = sdiv i32 %0, 3600
%3 = mul nsw i32 %2, -3600
%4 = add i32 %3, %0
%5 = sdiv i32 %4, 60
%6 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @format_time.str, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %5)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @format_time.str, i64 0, i64 0)
}
void good1(int M, int N, int step, int matrix[M][step]) { matrix[0][0] = 0; }


x86 assembly (clang, -O0):
<good1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
imul   $0x0,%rcx,%rcx
movl   $0x0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<good1>:
movl   $0x0,(%rcx)
ret

LLVM IR (-O0):
define void @good1(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 = zext i32 %9 to i64
%11 = load i32, i32* %7
%12 = zext i32 %11 to i64
%13 = load i32*, i32** %8
%14 = mul nsw i64 0, %12
%15 = getelementptr inbounds i32, i32* %13, i64 %14
%16 = getelementptr inbounds i32, i32* %15, i64 0
store i32 0, i32* %16
ret void
}

LLVM IR (-O2):
define void @good1(i32 %0, i32 %1, i32 %2, i32* nocapture writeonly %3) {
store i32 0, i32* %3
ret void
}
const char *skip_space(const char *str) {
  while (*str == ' ' || *str == '\t') {
    str++;
  }
  return str;
}


x86 assembly (clang, -O0):
<skip_space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     112d <skip_space+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <skip_space+0x3d>
jmp    114e <skip_space+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_space+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space>:
mov    %rdi,%rax
jmp    1114 <skip_space+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <skip_space+0x10>
cmp    $0x9,%cl
je     1110 <skip_space+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_space(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
void TimerStop(unsigned long ulBase) {

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~0x00000001;
}


x86 assembly (clang, -O0):
<TimerStop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerStop>:
andq   $0xfffffffffffffffe,(%rdi)
ret

LLVM IR (-O0):
define void @TimerStop(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 0
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -2
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @TimerStop(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
%4 = and i64 %3, -2
store volatile i64 %4, i64* %2
ret void
}
int main(int argc, char **argv) { return argc / argc; }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ onload(int);
void onbutton(unsigned int button) {
  if (button == 5) {
    onload(32);
  }
}


x86 assembly (clang, -O0):
<onbutton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jne    112f <onbutton+0x1f>
mov    $0x20,%edi
call   1030 <onload@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onbutton>:
cmp    $0x5,%edi
jne    111f <onbutton+0xf>
mov    $0x20,%edi
jmp    1030 <onload@plt>
ret

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

LLVM IR (-O2):
define void @onbutton(i32 %0) {
%2 = icmp eq i32 %0, 5
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @onload(i32 32)
br label %5
5: ; preds = %3, %1
ret void
}
int f() { return f(); }


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

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

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

LLVM IR (-O2):
define i32 @f() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBDevMode(uint32_t ui32Base) {
  ;
  (*((volatile uint8_t *)(ui32Base + 0x0000041C))) = 0x00000002 | 0x00000001;
}


x86 assembly (clang, -O0):
<USBDevMode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x3,0x41c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBDevMode>:
movl   $0x3,0x41c(%rdi)
ret

LLVM IR (-O0):
define void @USBDevMode(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 1052
%5 = inttoptr i64 %4 to i32*
store volatile i32 3, i32* %5
ret void
}

LLVM IR (-O2):
define void @USBDevMode(i64 %0) {
%2 = add nsw i64 %0, 1052
%3 = inttoptr i64 %2 to i32*
store volatile i32 3, i32* %3
ret void
}
int test_imm_49int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x49 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_49int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 73
%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_49int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 4784128
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ volatile *mem_get_reg32(int);
volatile uint32_t *exti_get_PR() { return mem_get_reg32(0x40010400 + 0x14); }


x86 assembly (clang, -O0):
<exti_get_PR>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40010414,%edi
call   1030 <mem_get_reg32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<exti_get_PR>:
mov    $0x40010414,%edi
jmp    1030 <mem_get_reg32@plt>

LLVM IR (-O0):
define i32* @exti_get_PR() {
%1 = call i32* @mem_get_reg32(i32 1073808404)
ret i32* %1
}

LLVM IR (-O2):
define i32* @exti_get_PR() {
%1 = tail call i32* @mem_get_reg32(i32 1073808404)
ret i32* %1
}