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

/* Variables and functions */
uint32_t ntohl(uint32_t netlong) {
  return (netlong << 24) | ((netlong && 0xff00) << 8) |
         ((netlong && 0xff0000) >> 8) | (netlong >> 24);
}


x86 assembly (clang, -O0):
<ntohl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1129 <ntohl+0x29>
mov    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1129 <ntohl+0x29>
mov    -0xc(%rbp),%eax
mov    -0x5(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xd(%rbp)
je     1156 <ntohl+0x56>
mov    $0x1,%al
mov    %al,-0xd(%rbp)
jmp    1156 <ntohl+0x56>
mov    -0x14(%rbp),%eax
mov    -0xd(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntohl>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
mov    %edi,%ecx
shl    $0x18,%ecx
shl    $0x8,%eax
or     %ecx,%eax
sar    $0x18,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @ntohl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %1
%9 = phi i1 [ false, %1 ], [ true, %7 ]
%10 = zext i1 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %4, %11
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %8
br label %16
16: ; preds = %15, %8
%17 = phi i1 [ false, %8 ], [ true, %15 ]
%18 = zext i1 %17 to i32
%19 = ashr i32 %18, 8
%20 = or i32 %12, %19
%21 = load i32, i32* %2
%22 = ashr i32 %21, 24
%23 = or i32 %20, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @ntohl(i32 %0) {
%2 = shl i32 %0, 24
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 0, i32 256
%5 = or i32 %4, %2
%6 = ashr i32 %0, 24
%7 = or i32 %5, %6
ret i32 %7
}
void initialize_statistics(void) {}


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

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

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

LLVM IR (-O2):
define void @initialize_statistics() {
ret void
}
/* Variables and functions */
char const *escnonprint_internal(char const *, char, int);
const char *escnonprint_uri(const char *str) {
  return escnonprint_internal(str, '%', 16);
}


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

x86 assembly (clang, -O2):
<escnonprint_uri>:
mov    $0x25,%esi
mov    $0x10,%edx
jmp    1030 <escnonprint_internal@plt>

LLVM IR (-O0):
define i8* @escnonprint_uri(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @escnonprint_internal(i8* %3, i8 signext 37, i32 16)
ret i8* %4
}

LLVM IR (-O2):
define i8* @escnonprint_uri(i8* %0) {
%2 = tail call i8* @escnonprint_internal(i8* %0, i8 signext 37, i32 16)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Testing 123");
  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 = [12 x i8] c"Testing 123\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Testing 123\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int rand();
uint64_t rand64(void) {
  uint64_t a = rand() & 0xffff;
  uint64_t b = rand() & 0xffff;
  uint64_t c = rand() & 0xffff;
  uint64_t d = rand() & 0xffff;
  return (a << 48) | (b << 32) | (c << 16) | d;
}


x86 assembly (clang, -O0):
<rand64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xffff,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xffff,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x30,%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
or     -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand64>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <rand@plt>

LLVM IR (-O0):
define i32 @rand64() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @rand()
%6 = and i32 %5, 65535
store i32 %6, i32* %1
%7 = call i32 (...) @rand()
%8 = and i32 %7, 65535
store i32 %8, i32* %2
%9 = call i32 (...) @rand()
%10 = and i32 %9, 65535
store i32 %10, i32* %3
%11 = call i32 (...) @rand()
%12 = and i32 %11, 65535
store i32 %12, i32* %4
%13 = load i32, i32* %1
%14 = shl i32 %13, 48
%15 = load i32, i32* %2
%16 = shl i32 %15, 32
%17 = or i32 %14, %16
%18 = load i32, i32* %3
%19 = shl i32 %18, 16
%20 = or i32 %17, %19
%21 = load i32, i32* %4
%22 = or i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @rand64() {
%1 = tail call i32 (...) @rand()
%2 = tail call i32 (...) @rand()
%3 = tail call i32 (...) @rand()
%4 = tail call i32 (...) @rand()
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ ICPrintParents(int);
int main(int argc, const char *argv[]) {
  ICPrintParents(12);
  ICPrintParents(15);
  ICPrintParents(10);
  for (int i = 0; i < 1000; ++i) {
    ICPrintParents(i);
  }
  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    $0xc,%edi
call   1030 <ICPrintParents@plt>
mov    $0xf,%edi
call   1030 <ICPrintParents@plt>
mov    $0xa,%edi
call   1030 <ICPrintParents@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jge    116e <main+0x5e>
mov    -0x14(%rbp),%edi
call   1030 <ICPrintParents@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114b <main+0x3b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xc,%edi
call   1030 <ICPrintParents@plt>
mov    $0xf,%edi
call   1030 <ICPrintParents@plt>
mov    $0xa,%edi
call   1030 <ICPrintParents@plt>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <ICPrintParents@plt>
add    $0x1,%ebx
cmp    $0x3e8,%ebx
jne    1140 <main+0x30>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @ICPrintParents(i32 12)
%4 = tail call i32 @ICPrintParents(i32 15)
%5 = tail call i32 @ICPrintParents(i32 10)
br label %7
6: ; preds = %7
ret i32 0
7: ; preds = %2, %7
%8 = phi i32 [ 0, %2 ], [ %10, %7 ]
%9 = tail call i32 @ICPrintParents(i32 %8)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, 1000
br i1 %11, label %6, label %7
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t smpte_fec_get_index(uint8_t *p_fec) { return p_fec[12] & 0x7; }


x86 assembly (clang, -O0):
<smpte_fec_get_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%eax
and    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_fec_get_index>:
mov    0x30(%rdi),%eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @smpte_fec_get_index(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 12
%5 = load i32, i32* %4
%6 = and i32 %5, 7
ret i32 %6
}

LLVM IR (-O2):
define i32 @smpte_fec_get_index(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 12
%3 = load i32, i32* %2
%4 = and i32 %3, 7
ret i32 %4
}
char number_of_bits_in_uint(unsigned int uvalue) {
  char bits = 0;
  while (uvalue != 0) {
    if (uvalue & 1) {
      bits += 1;
    }
    uvalue >>= 1;
  }
  return bits;
}


x86 assembly (clang, -O0):
<number_of_bits_in_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <number_of_bits_in_uint+0x3c>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     112e <number_of_bits_in_uint+0x2e>
movsbl -0x5(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <number_of_bits_in_uint+0xb>
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_of_bits_in_uint>:
xor    %eax,%eax
test   %edi,%edi
je     1120 <number_of_bits_in_uint+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%dl
add    %dl,%al
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <number_of_bits_in_uint+0x10>
ret

LLVM IR (-O0):
define signext i8 @number_of_bits_in_uint(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
store i8 0, i8* %3
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = load i32, i32* %2
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 1
%15 = trunc i32 %14 to i8
store i8 %15, i8* %3
br label %16
16: ; preds = %11, %7
%17 = load i32, i32* %2
%18 = lshr i32 %17, 1
store i32 %18, i32* %2
br label %4
19: ; preds = %4
%20 = load i8, i8* %3
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @number_of_bits_in_uint(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i8 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = trunc i32 %5 to i8
%7 = and i8 %6, 1
%8 = add i8 %7, %4
%9 = lshr i32 %5, 1
%10 = icmp ult i32 %5, 2
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i8 [ 0, %1 ], [ %8, %3 ]
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int *ptr1, *ptr2;
  int num;
  printf("\nEnter two numbers : ");
  scanf("%d %d", ptr1, ptr2);
  num = *ptr1;
  num = *ptr1 + *ptr2;
  printf("Sum = %d", num);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xeca(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
add    (%rcx),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"\0AEnter two numbers : \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [9 x i8] c"Sum = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7)
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
store i32 %10, i32* %4
%11 = load i32*, i32** %2
%12 = load i32, i32* %11
%13 = load i32*, i32** %3
%14 = load i32, i32* %13
%15 = add nsw i32 %12, %14
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"\0AEnter two numbers : \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [9 x i8] c"Sum = %d\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* undef, i32* undef)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void sar_reg64_cl(unsigned int reg64) {
  put8(0x48);
  put8(0xD3);
  put8(0xF8 + reg64);
}


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

x86 assembly (clang, -O2):
<sar_reg64_cl>:
push   %rbx
mov    %edi,%ebx
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0xd3,%edi
call   1030 <put8@plt>
add    $0xf8,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @sar_reg64_cl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 72)
%4 = call i32 @put8(i32 211)
%5 = load i32, i32* %2
%6 = add i32 248, %5
%7 = call i32 @put8(i32 %6)
ret void
}

LLVM IR (-O2):
define void @sar_reg64_cl(i32 %0) {
%2 = tail call i32 @put8(i32 72)
%3 = tail call i32 @put8(i32 211)
%4 = add i32 %0, 248
%5 = tail call i32 @put8(i32 %4)
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ getUInt32FromConsole(char const *);
int32_t getInt32FromConsole(const char *consoleStr) {
  int32_t ret = 0;
  if (consoleStr != NULL) {
    ret = (int32_t)getUInt32FromConsole(consoleStr);
  }
  return ret;
}


x86 assembly (clang, -O0):
<getInt32FromConsole>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <getInt32FromConsole+0x2c>
mov    -0x8(%rbp),%rdi
call   1030 <getUInt32FromConsole@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInt32FromConsole>:
test   %rdi,%rdi
je     111a <getInt32FromConsole+0xa>
jmp    1030 <getUInt32FromConsole@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @getInt32FromConsole(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @getUInt32FromConsole(i8* %7)
store i64 %8, i64* %3
br label %9
9: ; preds = %6, %1
%10 = load i64, i64* %3
ret i64 %10
}

LLVM IR (-O2):
define i64 @getInt32FromConsole(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 @getUInt32FromConsole(i8* %0)
br label %5
5: ; preds = %3, %1
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char *input;
  while (1) {
    scanf("%s", input);
    printf("You typed: %s\n", input);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
lea    0xed1(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [15 x i8] c"You typed: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = load i8*, i8** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %6)
br label %3
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [15 x i8] c"You typed: %s\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* undef)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* undef)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_203() {
  Assert_real((isqrt(203) == 14),
              "/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/stdlib/isqrt.c",
              1020, ("Integer square root of 203 should be 14"));
}


x86 assembly (clang, -O0):
<t_sqrt_203>:
push   %rbp
mov    %rsp,%rbp
mov    $0xcb,%edi
call   1030 <isqrt@plt>
cmp    $0xe,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x3fc,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_203>:
push   %rax
mov    $0xcb,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xe,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x3fc,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 203 should be 14\00"
define void @t_sqrt_203() {
%1 = call i32 @isqrt(i32 203)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1020, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 203 should be 14\00"
define void @t_sqrt_203() {
%1 = tail call i32 @isqrt(i32 203)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1020, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inlistadd(char *);
int /*<<< orphan*/ putstr(char *);
main() {
  char *str, *getstr();
  while (str = getstr()) {
    if (!inlistadd(str)) {
      putstr(str);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getstr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1174 <main+0x44>
mov    -0x10(%rbp),%rdi
call   1030 <inlistadd@plt>
cmp    $0x0,%eax
jne    116f <main+0x3f>
mov    -0x10(%rbp),%rdi
call   1050 <putstr@plt>
jmp    113f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getstr@plt>
test   %rax,%rax
je     1175 <main+0x45>
mov    %rax,%rbx
jmp    115f <main+0x2f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getstr@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1175 <main+0x45>
mov    %rbx,%rdi
call   1030 <inlistadd@plt>
test   %eax,%eax
jne    1150 <main+0x20>
mov    %rbx,%rdi
call   1050 <putstr@plt>
jmp    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* (...) @getstr()
%2 = icmp eq i8* %1, null
br i1 %2, label %12, label %3
3: ; preds = %0, %9
%4 = phi i8* [ %10, %9 ], [ %1, %0 ]
%5 = tail call i32 @inlistadd(i8* %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @putstr(i8* %4)
br label %9
9: ; preds = %7, %3
%10 = tail call i8* (...) @getstr()
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %3
12: ; preds = %9, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, int, int, int, int);
void decsera(int top, int left, int bottom, int right) {
  do_csi("%d;%d;%d;%d${", top, left, bottom, right);
}


x86 assembly (clang, -O0):
<decsera>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xec8(%rip),%rdi
call   1030 <do_csi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decsera>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee0(%rip),%rdi
jmp    1030 <do_csi@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%d;%d;%d;%d${\00"
define void @decsera(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @do_csi(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d;%d;%d;%d${\00"
define void @decsera(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @do_csi(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int);
int main(int argc, char **argv) {
  if (argc == 1)
    return 0;
  switch (argv[1][0]) {
  case '0':
    syscall(512);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    113c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1164 <main+0x54>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%al
sub    $0x30,%al
jne    115d <main+0x4d>
jmp    1153 <main+0x43>
mov    $0x200,%edi
call   1030 <syscall@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
je     1129 <main+0x19>
mov    0x8(%rsi),%rax
cmpb   $0x30,(%rax)
jne    1129 <main+0x19>
mov    $0x200,%edi
call   1030 <syscall@plt>
xor    %eax,%eax
pop    %rcx
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 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %19
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
switch i32 %15, label %18 [
i32 48, label %16
]
16: ; preds = %9
%17 = call i32 @syscall(i32 512)
br label %18
18: ; preds = %16, %9
store i32 0, i32* %3
br label %19
19: ; preds = %18, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 48
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @syscall(i32 512)
br label %11
11: ; preds = %9, %4, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ play_sound(int);
void beep() { play_sound(1000); }


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

x86 assembly (clang, -O2):
<beep>:
mov    $0x3e8,%edi
jmp    1030 <play_sound@plt>

LLVM IR (-O0):
define void @beep() {
%1 = call i32 @play_sound(i32 1000)
ret void
}

LLVM IR (-O2):
define void @beep() {
%1 = tail call i32 @play_sound(i32 1000)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t ip_get_version(const uint8_t *p_ip) { return (p_ip[0] >> 4) & 0xf; }


x86 assembly (clang, -O0):
<ip_get_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sar    $0x4,%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_get_version>:
mov    (%rdi),%eax
shr    $0x4,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @ip_get_version(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = ashr i32 %5, 4
%7 = and i32 %6, 15
ret i32 %7
}

LLVM IR (-O2):
define i32 @ip_get_version(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = lshr i32 %2, 4
%4 = and i32 %3, 15
ret i32 %4
}
char *bytset(d, c, n)
register char *d;
register char c;
register int n;
{
  memset(d, c, n);
  return (d + n);
}


x86 assembly (clang, -O0):
<bytset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%eax
movslq -0x10(%rbp),%rdx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytset>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movslq %edx,%r14
mov    %r14,%rdx
call   1030 <memset@plt>
add    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @bytset(i8* writeonly %0, i32 %1, i32 %2) {
%4 = trunc i32 %1 to i8
%5 = sext i32 %2 to i64
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 %4, i64 %5, i1 false)
%6 = getelementptr inbounds i8, i8* %0, i64 %5
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ AddCalibration(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ Split(char *const, char **, char **);
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ free(char *);
void ParseCalibrationLine(char *const command) {
  char *min;
  char *max;
  Split(command, &min, &max);
  AddCalibration(atoi(min), atoi(max));
  free(min);
  free(max);
}


x86 assembly (clang, -O0):
<ParseCalibrationLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1060 <Split@plt>
mov    -0x10(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <atoi@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
call   1040 <AddCalibration@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParseCalibrationLine>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
call   1060 <Split@plt>
mov    0x8(%rsp),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
mov    (%rsp),%rdi
call   1050 <atoi@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <AddCalibration@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @ParseCalibrationLine(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @Split(i8* %5, i8** %3, i8** %4)
%7 = load i8*, i8** %3
%8 = call i32 @atoi(i8* %7)
%9 = load i8*, i8** %4
%10 = call i32 @atoi(i8* %9)
%11 = call i32 @AddCalibration(i32 %8, i32 %10)
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
define void @ParseCalibrationLine(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = bitcast i8** %2 to i8*
%5 = bitcast i8** %3 to i8*
%6 = call i32 @Split(i8* %0, i8** %2, i8** %3)
%7 = load i8*, i8** %2
%8 = call i32 @atoi(i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @atoi(i8* %9)
%11 = call i32 @AddCalibration(i32 %8, i32 %10)
%12 = load i8*, i8** %2
%13 = call i32 @free(i8* %12)
%14 = load i8*, i8** %3
%15 = call i32 @free(i8* %14)
ret void
}
int android_startOpenglesRenderer(int width, int height) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @android_startOpenglesRenderer(i32 %0, i32 %1) {
ret i32 -1
}
extern int IsNumeric(char c) {
  if (c >= '0' && c <= '9')
    return c;
  return 0;
}


x86 assembly (clang, -O0):
<IsNumeric>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <IsNumeric+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <IsNumeric+0x30>
movsbl -0x5(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1137 <IsNumeric+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsNumeric>:
lea    -0x30(%rdi),%eax
xor    %ecx,%ecx
cmp    $0xa,%al
cmovb  %edi,%ecx
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @IsNumeric(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 sge i32 %5, 48
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
store i32 %13, i32* %2
br label %15
14: ; preds = %7, %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @IsNumeric(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = select i1 %3, i8 %0, i8 0
%5 = zext i8 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *val(char);
void program_getoptstr(char c, const char **r) {
  if (val(c))
    *r = val(c);
}


x86 assembly (clang, -O0):
<program_getoptstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <val@plt>
cmp    $0x0,%rax
je     1148 <program_getoptstr+0x38>
movsbl -0x1(%rbp),%edi
call   1030 <val@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<program_getoptstr>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <val@plt>
test   %rax,%rax
je     112e <program_getoptstr+0x1e>
movsbl %bpl,%edi
call   1030 <val@plt>
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @program_getoptstr(i8 signext %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 = call i8* @val(i8 signext %5)
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8, i8* %3
%10 = call i8* @val(i8 signext %9)
%11 = load i8**, i8*** %4
store i8* %10, i8** %11
br label %12
12: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @program_getoptstr(i8 signext %0, i8** nocapture writeonly %1) {
%3 = tail call i8* @val(i8 signext %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @val(i8 signext %0)
store i8* %6, i8** %1
br label %7
7: ; preds = %5, %2
ret void
}
void genctc1() {}


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

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

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

LLVM IR (-O2):
define void @genctc1() {
ret void
}
void RGBAToYJRow_C() {}


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

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

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

LLVM IR (-O2):
define void @RGBAToYJRow_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("test...\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test...\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 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"test...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int security_socket_create(int family, int type, int protocol, int kern) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @security_socket_create(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
ret i32 0
}

LLVM IR (-O2):
define i32 @security_socket_create(i32 %0, i32 %1, i32 %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printd(int);
int main(void) {
  int n;
  n = 15000;
  printd(n);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3a98,%edi
call   1030 <printd@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 15000, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printd(i32 %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @printd(i32 15000)
ret i32 0
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  int tv_sec;
};

/* Variables and functions */
int spec_to_usec(struct timespec time) {
  int temp;
  temp = time.tv_nsec / 1e3;
  temp += time.tv_sec * 1e6;
  return temp;
}


x86 assembly (clang, -O0):
<spec_to_usec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xef3(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xece(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spec_to_usec>:
cvtsi2sd %edi,%xmm0
shr    $0x20,%rdi
divsd  0xef0(%rip),%xmm0
cvtsi2sd %edi,%xmm1
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
mulsd  0xee4(%rip),%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i32 @spec_to_usec(i64 %0) {
%2 = alloca %struct.timespec
%3 = alloca i32
%4 = bitcast %struct.timespec* %2 to i64*
store i64 %0, i64* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = fdiv double %7, 1.000000e+03
%9 = fptosi double %8 to i32
store i32 %9, i32* %3
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
%11 = load i32, i32* %10
%12 = sitofp i32 %11 to double
%13 = load i32, i32* %3
%14 = sitofp i32 %13 to double
%15 = call double @llvm.fmuladd.f64(double %12, double 1.000000e+06, double %14)
%16 = fptosi double %15 to i32
store i32 %16, i32* %3
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @spec_to_usec(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = lshr i64 %0, 32
%4 = trunc i64 %3 to i32
%5 = sitofp i32 %2 to double
%6 = fdiv double %5, 1.000000e+03
%7 = fptosi double %6 to i32
%8 = sitofp i32 %4 to double
%9 = sitofp i32 %7 to double
%10 = tail call double @llvm.fmuladd.f64(double %8, double 1.000000e+06, double %9)
%11 = fptosi double %10 to i32
ret i32 %11
}
/* Variables and functions */
char serial_getchar();
char getchar() { return serial_getchar(); }


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

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

LLVM IR (-O0):
define signext i8 @getchar() {
%1 = call signext i8 (...) @serial_getchar()
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @getchar() {
%1 = tail call signext i8 (...) @serial_getchar()
ret i8 %1
}
/* Variables and functions */
long long strtoll(char const *, char **, int);
long long atoll(const char *nptr) { return (strtoll(nptr, (char **)NULL, 10)); }


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

x86 assembly (clang, -O2):
<atoll>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtoll@plt>

LLVM IR (-O0):
define i64 @atoll(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtoll(i8* %3, i8** null, i32 10)
ret i64 %4
}

LLVM IR (-O2):
define i64 @atoll(i8* nocapture %0) {
%2 = tail call i64 @strtoll(i8* nocapture %0, i8** null, i32 10)
ret i64 %2
}
int null_length() { return 0; }


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

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

LLVM IR (-O0):
define i32 @null_length() {
ret i32 0
}

LLVM IR (-O2):
define i32 @null_length() {
ret i32 0
}
void Plain_NullLinkCheck(void) {}


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

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

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

LLVM IR (-O2):
define void @Plain_NullLinkCheck() {
ret void
}
void f7(void) {
#pragma omp critical(foo2)
#pragma omp critical
  ;
#pragma omp critical(bar)
#pragma omp critical(bar)
  ;
#pragma omp critical
#pragma omp critical
  ;
}


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

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

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

LLVM IR (-O2):
define void @f7() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *realloc(void *, size_t);
void *checked_realloc(void *ptr, size_t size) {
  void *p;
  p = realloc(ptr, size);
  if (!p)
    abort();
  return p;
}


x86 assembly (clang, -O0):
<checked_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <checked_realloc+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_realloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     112d <checked_realloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @checked_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @checked_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void **);
int /*<<< orphan*/ yyerror();
void assignCfgVar(void *structVar, void *val) {
  void **sVar, **sVal;
  sVar = structVar;
  sVal = val;
  if (!val) {
    (void)yyerror();
  } else {
    (void)printf("assigning: %s\n", sVal);
    sVar = sVal;
  }
}


x86 assembly (clang, -O0):
<assignCfgVar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1157 <assignCfgVar+0x37>
mov    $0x0,%al
call   1030 <yyerror@plt>
jmp    116f <assignCfgVar+0x4f>
mov    -0x20(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assignCfgVar>:
test   %rsi,%rsi
je     1131 <assignCfgVar+0x11>
lea    0xed4(%rip),%rdi
jmp    1040 <printf@plt>
xor    %eax,%eax
jmp    1030 <yyerror@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"assigning: %s\0A\00"
define void @assignCfgVar(i8* nocapture readnone %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @yyerror()
br label %9
6: ; preds = %2
%7 = bitcast i8* %1 to i8**
%8 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %7)
br label %9
9: ; preds = %6, %4
ret void
}
__attribute__((format(printf, 1, 2))) int no_printk(const char *s, ...) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @no_printk(i8* nocapture readnone %0, ...) {
ret i32 0
}
__attribute__((no, noclone)) unsigned __int128 t162_4sub(unsigned __int128 x) {
  unsigned __int128 y = (0);
  unsigned __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t162_4sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rax
sub    %rsi,%rdx
sbb    %rax,%rcx
setb   %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    116e <t162_4sub+0x5e>
jmp    1175 <t162_4sub+0x65>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define { i64, i64 } @t162_4sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 0, i128* %6
%12 = load i128, i128* %5
%13 = load i128, i128* %6
%14 = call { i128, i1 } @llvm.usub.with.overflow.i128(i128 %12, i128 %13)
%15 = extractvalue { i128, i1 } %14, 1
%16 = extractvalue { i128, i1 } %14, 0
store i128 %16, i128* %7
br i1 %15, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %7
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t162_4sub(i64 %0, i64 %1) {
%3 = insertvalue { i64, i64 } poison, i64 %0, 0
%4 = insertvalue { i64, i64 } %3, i64 %1, 1
ret { i64, i64 } %4
}