xunge/DecIR huggingface dataset:
unsigned direct_hash(const void *src) { return (unsigned long)src; }


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

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

LLVM IR (-O0):
define i32 @direct_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @direct_hash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
int addr_classbits(char class) {
  switch (class) {
  case 'A':
    return 8;
  case 'B':
    return 16;
  case 'C':
    return 24;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<addr_classbits>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x41,%eax
je     1141 <addr_classbits+0x41>
jmp    111f <addr_classbits+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x42,%eax
je     114d <addr_classbits+0x4d>
jmp    1130 <addr_classbits+0x30>
mov    -0xc(%rbp),%eax
sub    $0x43,%eax
je     1159 <addr_classbits+0x59>
jmp    1165 <addr_classbits+0x65>
movl   $0x8,-0x4(%rbp)
jmp    116c <addr_classbits+0x6c>
movl   $0x10,-0x4(%rbp)
jmp    116c <addr_classbits+0x6c>
movl   $0x18,-0x4(%rbp)
jmp    116c <addr_classbits+0x6c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addr_classbits>:
lea    -0x41(%rdi),%eax
xor    %ecx,%ecx
cmp    $0x3,%eax
lea    -0x200(,%rdi,8),%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @addr_classbits(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
switch i32 %5, label %9 [
i32 65, label %6
i32 66, label %7
i32 67, label %8
]
6: ; preds = %1
store i32 8, i32* %2
br label %10
7: ; preds = %1
store i32 16, i32* %2
br label %10
8: ; preds = %1
store i32 24, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @addr_classbits(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -65
%4 = icmp ult i32 %3, 3
%5 = shl nsw i32 %3, 3
%6 = add nsw i32 %5, 8
%7 = select i1 %4, i32 %6, i32 0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void OptionsMessage(void) {
  printf("Please select one of the following functions to run:\n");
  printf("1) strcmp\n");
  printf("2) strncmp\n");
  printf("3) strchr\n\n\t");
}


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

x86 assembly (clang, -O2):
<OptionsMessage>:
push   %rax
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"Please select one of the following functions to run:\0A\00"
@.str.1 = [11 x i8] c"1) strcmp\0A\00"
@.str.2 = [12 x i8] c"2) strncmp\0A\00"
@.str.3 = [13 x i8] c"3) strchr\0A\0A\09\00"
define void @OptionsMessage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.3 = [13 x i8] c"3) strchr\0A\0A\09\00"
@str = [53 x i8] c"Please select one of the following functions to run:\00"
@str.4 = [10 x i8] c"1) strcmp\00"
@str.5 = [11 x i8] c"2) strncmp\00"
define void @OptionsMessage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void _zstlmap_assert(int x) {
  if (x) {
    fprintf(stderr, "Assertion failure in zs_tlmap!\n");
    assert(0);
  }
}


x86 assembly (clang, -O0):
<_zstlmap_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1151 <_zstlmap_assert+0x31>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_zstlmap_assert>:
test   %edi,%edi
je     1142 <_zstlmap_assert+0x22>
push   %rax
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
lea    0xecb(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Assertion failure in zs_tlmap!\0A\00"
define void @_zstlmap_assert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @assert(i32 0)
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Assertion failure in zs_tlmap!\0A\00"
define void @_zstlmap_assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @assert(i32 0)
br label %7
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
double PSItoMB(double);
double PSItoHPA(double PSI) {
  double HPA = PSItoMB(PSI);
  return HPA;
}


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

x86 assembly (clang, -O2):
<PSItoHPA>:
jmp    1030 <PSItoMB@plt>

LLVM IR (-O0):
define double @PSItoHPA(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @PSItoMB(double %4)
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @PSItoHPA(double %0) {
%2 = tail call double @PSItoMB(double %0)
ret double %2
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ print_quad(struct sockaddr *);
int /*<<< orphan*/ stderr;
void print_addr(struct sockaddr *sadr) {
  if (!sadr) {
    fprintf(stderr, "Error\n");
    exit(1);
  }
  print_quad(sadr);
}


x86 assembly (clang, -O0):
<print_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1166 <print_addr+0x36>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rdi
call   1050 <print_quad@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_addr>:
test   %rdi,%rdi
je     113a <print_addr+0xa>
jmp    1050 <print_quad@plt>
push   %rax
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [7 x i8] c"Error\0A\00"
define void @print_addr(%struct.sockaddr* %0) {
%2 = alloca %struct.sockaddr*
store %struct.sockaddr* %0, %struct.sockaddr** %2
%3 = load %struct.sockaddr*, %struct.sockaddr** %2
%4 = icmp ne %struct.sockaddr* %3, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = load %struct.sockaddr*, %struct.sockaddr** %2
%11 = call i32 @print_quad(%struct.sockaddr* %10)
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [7 x i8] c"Error\0A\00"
define void @print_addr(%struct.sockaddr* %0) {
%2 = icmp eq %struct.sockaddr* %0, null
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = tail call i32 @print_quad(%struct.sockaddr* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ request_print_header_sumary(int);
void request_print_header(int width) {
  request_print_header_sumary(width);
  printf(" ____________________________________________________________________"
         "_________\n");
  printf("   IP            At MAC Address      Requests IP      Count          "
         "         \n");
  printf(" --------------------------------------------------------------------"
         "---------\n");
}


x86 assembly (clang, -O0):
<request_print_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <request_print_header_sumary@plt>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
call   1030 <printf@plt>
lea    0xf4e(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<request_print_header>:
push   %rax
call   1040 <request_print_header_sumary@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xf16(%rip),%rdi
call   1030 <puts@plt>
lea    0xf59(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [80 x i8] c" _____________________________________________________________________________\0A\00"
@.str.1 = [80 x i8] c" IP At MAC Address Requests IP Count \0A\00"
@.str.2 = [80 x i8] c" -----------------------------------------------------------------------------\0A\00"
define void @request_print_header(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @request_print_header_sumary(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [79 x i8] c" _____________________________________________________________________________\00"
@str.3 = [79 x i8] c" IP At MAC Address Requests IP Count \00"
@str.4 = [79 x i8] c" -----------------------------------------------------------------------------\00"
define void @request_print_header(i32 %0) {
%2 = tail call i32 @request_print_header_sumary(i32 %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint_fast16_t;

/* Variables and functions */
__attribute__((unused)) uint_fast16_t cop_ld_ule16(const void *buf) {
  const unsigned char *b = buf;
  return ((uint_fast16_t)b[0] << 0) | ((uint_fast16_t)b[1] << 8);
}


x86 assembly (clang, -O0):
<cop_ld_ule16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x0,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cop_ld_ule16>:
movzwl (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @cop_ld_ule16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ board_right();
int /*<<< orphan*/ write(int, char *, int);
void event_handler_client_in_right(int fd) {
  write(fd, "\0", 1);
  board_right();
}


x86 assembly (clang, -O0):
<event_handler_client_in_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xecb(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x0,%al
call   1040 <board_right@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_handler_client_in_right>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <board_right@plt>

LLVM IR (-O0):
@.str = [2 x i8] zeroinitializer
define void @event_handler_client_in_right(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @write(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = call i32 (...) @board_right()
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] zeroinitializer
define void @event_handler_client_in_right(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 (...) @board_right()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ stderr;
void intsShouldEqual(int expected, int actual) {
  if (expected == actual)
    return;
  fprintf(stderr, "Expected: '%d' but was '%d'\n", expected, actual);
  assert(0);
}


x86 assembly (clang, -O0):
<intsShouldEqual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    113f <intsShouldEqual+0x1f>
jmp    1161 <intsShouldEqual+0x41>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xeab(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intsShouldEqual>:
cmp    %esi,%edi
jne    1125 <intsShouldEqual+0x5>
ret
push   %rax
mov    %esi,%ecx
mov    %edi,%edx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Expected: '%d' but was '%d'\0A\00"
define void @intsShouldEqual(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* %4
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %15
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
%14 = call i32 @assert(i32 0)
br label %15
15: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Expected: '%d' but was '%d'\0A\00"
define void @intsShouldEqual(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%7 = tail call i32 @assert(i32 0)
br label %8
8: ; preds = %2, %4
ret void
}
_Noreturn void j() {
  do
    ;
  while (1);
}


x86 assembly (clang, -O0):
<j>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <j+0x9>
jmp    110e <j+0xe>
mov    $0x1,%al
test   $0x1,%al
jne    1109 <j+0x9>
jmp    111d <j+0x1d>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @j() {
br label %1
1: ; preds = %2, %0
br label %2
2: ; preds = %1
br i1 true, label %1, label %3
3: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @j() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printZeroChannelsError() {
  fprintf(stderr, "Sound is either empty or incorrectly zero channels\n");
}


x86 assembly (clang, -O0):
<printZeroChannelsError>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printZeroChannelsError>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"Sound is either empty or incorrectly zero channels\0A\00"
define void @printZeroChannelsError() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"Sound is either empty or incorrectly zero channels\0A\00"
define void @printZeroChannelsError() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef unsigned long volatile uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void GPIODMATriggerEnable(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  (*((volatile unsigned long *)(ui32Port + 0x00000534))) |= ui8Pins;
}


x86 assembly (clang, -O0):
<GPIODMATriggerEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x534(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x534(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIODMATriggerEnable>:
mov    %rsi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
or     %rax,0x534(%rdi)
ret

LLVM IR (-O0):
define void @GPIODMATriggerEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 1332
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @GPIODMATriggerEnable(i64 %0, i64 %1) {
%3 = alloca i64
store volatile i64 %1, i64* %3
%4 = load volatile i64, i64* %3
%5 = add nsw i64 %0, 1332
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = or i64 %7, %4
store volatile i64 %8, i64* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x17() {
  Assert_real((isprint(23) == 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_isprint.c",
              120, ("isprint should be 0 for 0x17"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x17>:
push   %rax
mov    $0x17,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x78,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x17\00"
define void @t_isprint_0x17() {
%1 = call i64 @isprint(i32 23)
%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 120, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x17\00"
define void @t_isprint_0x17() {
%1 = tail call i64 @isprint(i32 23)
%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 120, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int msim_existsWestWall(unsigned int, unsigned int);
int msim_existsEastWall(unsigned int x, unsigned int y) {
  return msim_existsWestWall(x + 1, y);
}


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

x86 assembly (clang, -O2):
<msim_existsEastWall>:
add    $0x1,%edi
jmp    1030 <msim_existsWestWall@plt>

LLVM IR (-O0):
define i32 @msim_existsEastWall(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 = add i32 %5, 1
%7 = load i32, i32* %4
%8 = call i32 @msim_existsWestWall(i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @msim_existsEastWall(i32 %0, i32 %1) {
%3 = add i32 %0, 1
%4 = tail call i32 @msim_existsWestWall(i32 %3, i32 %1)
ret i32 %4
}
void HelpBackHist() {}


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

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

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

LLVM IR (-O2):
define void @HelpBackHist() {
ret void
}
void pFTOD() {
  long long Df;
  unsigned long long D1;
  double F1;
  F1 = FPop();
  Df = F1;
  D1 = Df;
  Push((unsigned long)(D1)), Push((unsigned long)((D1) >> 32));
}


x86 assembly (clang, -O0):
<pFTOD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <FPop@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <Push@plt>
mov    -0x10(%rbp),%rdi
shr    $0x20,%rdi
mov    $0x0,%al
call   1030 <Push@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pFTOD>:
push   %rbx
xor    %eax,%eax
call   1040 <FPop@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <Push@plt>
shr    $0x20,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <Push@plt>

LLVM IR (-O0):
define void @pFTOD() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca double
%4 = call i32 (...) @FPop()
%5 = sitofp i32 %4 to double
store double %5, double* %3
%6 = load double, double* %3
%7 = fptosi double %6 to i64
store i64 %7, i64* %1
%8 = load i64, i64* %1
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = call i32 (i64, ...) bitcast (i32 (...)* @Push to i32 (i64, ...)*)(i64 %9)
%11 = load i64, i64* %2
%12 = lshr i64 %11, 32
%13 = call i32 (i64, ...) bitcast (i32 (...)* @Push to i32 (i64, ...)*)(i64 %12)
ret void
}

LLVM IR (-O2):
define void @pFTOD() {
%1 = tail call i32 (...) @FPop()
%2 = sext i32 %1 to i64
%3 = tail call i32 (i64, ...) bitcast (i32 (...)* @Push to i32 (i64, ...)*)(i64 %2)
%4 = lshr i64 %2, 32
%5 = tail call i32 (i64, ...) bitcast (i32 (...)* @Push to i32 (i64, ...)*)(i64 %4)
ret void
}
int pathcon_nm7_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 2;
  if (sz_res)
    *sz_res = 2;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 0;
  return 0;
}


x86 assembly (clang, -O0):
<pathcon_nm7_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <pathcon_nm7_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <pathcon_nm7_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <pathcon_nm7_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <pathcon_nm7_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathcon_nm7_work>:
test   %rdi,%rdi
je     110b <pathcon_nm7_work+0xb>
movl   $0x2,(%rdi)
test   %rsi,%rsi
je     1116 <pathcon_nm7_work+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <pathcon_nm7_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <pathcon_nm7_work+0x2c>
movl   $0x0,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @pathcon_nm7_work(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 = icmp ne i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = load i32*, i32** %5
store i32 2, i32* %12
br label %13
13: ; preds = %11, %4
%14 = load i32*, i32** %6
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32*, i32** %6
store i32 2, i32* %17
br label %18
18: ; preds = %16, %13
%19 = load i32*, i32** %7
%20 = icmp ne i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i32*, i32** %7
store i32 0, i32* %22
br label %23
23: ; preds = %21, %18
%24 = load i32*, i32** %8
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i32*, i32** %8
store i32 0, i32* %27
br label %28
28: ; preds = %26, %23
ret i32 0
}

LLVM IR (-O2):
define i32 @pathcon_nm7_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 2, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ a(char *);
void b() {
  char c[10000000000];
  c[1099511627776] = 'b';
  a(c);
  a(c);
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
movabs $0x2540be400,%rax
sub    %rax,%rsp
lea    -0x540be400(%rbp),%rax
movabs $0x10000000000,%rcx
add    %rcx,%rax
movb   $0x62,(%rax)
lea    -0x540be400(%rbp),%rdi
call   1030 <a@plt>
lea    -0x540be400(%rbp),%rdi
call   1030 <a@plt>
add    $0x7fffffff,%rsp
add    $0x7fffffff,%rsp
add    $0x7fffffff,%rsp
add    $0x7fffffff,%rsp
add    $0x540be404,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
push   %rbx
movabs $0x2540be400,%rax
sub    %rax,%rsp
movabs $0x10000000000,%rax
movb   $0x62,(%rsp,%rax,1)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <a@plt>
mov    %rbx,%rdi
call   1030 <a@plt>
add    $0x7fffffff,%rsp
add    $0x7fffffff,%rsp
add    $0x7fffffff,%rsp
add    $0x7fffffff,%rsp
add    $0x540be404,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @b() {
%1 = alloca [10000000000 x i8]
%2 = getelementptr inbounds [10000000000 x i8], [10000000000 x i8]* %1, i64 0, i64 1099511627776
store i8 98, i8* %2
%3 = getelementptr inbounds [10000000000 x i8], [10000000000 x i8]* %1, i64 0, i64 0
%4 = call i32 @a(i8* %3)
%5 = getelementptr inbounds [10000000000 x i8], [10000000000 x i8]* %1, i64 0, i64 0
%6 = call i32 @a(i8* %5)
ret void
}

LLVM IR (-O2):
define void @b() {
%1 = alloca [10000000000 x i8]
%2 = getelementptr inbounds [10000000000 x i8], [10000000000 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [10000000000 x i8], [10000000000 x i8]* %1, i64 0, i64 1099511627776
store i8 98, i8* %3
%4 = call i32 @a(i8* %2)
%5 = call i32 @a(i8* %2)
ret void
}
void foo_1_1_1_2_1_2_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_2_1_2_1_1_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void getData(int *dataRef) {
  int temp;
  printf("give an integer number\n>");
  scanf("%d", &temp);
  *dataRef = temp;
}


x86 assembly (clang, -O0):
<getData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getData>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"give an integer number\0A>\00"
@.str.1 = [3 x i8] c"%d\00"
define void @getData(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = load i32*, i32** %2
store i32 %6, i32* %7
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"give an integer number\0A>\00"
@.str.1 = [3 x i8] c"%d\00"
define void @getData(i32* nocapture writeonly %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
store i32 %6, i32* %0
ret void
}
__attribute__((always_)) void
timer_stats_timer_set_start_info(struct timer_list *timer) {}


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

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

LLVM IR (-O0):
%struct.timer_list = type opaque
define void @timer_stats_timer_set_start_info(%struct.timer_list* %0) {
%2 = alloca %struct.timer_list*
store %struct.timer_list* %0, %struct.timer_list** %2
ret void
}

LLVM IR (-O2):
%struct.timer_list = type opaque
define void @timer_stats_timer_set_start_info(%struct.timer_list* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ I2C_RdData(int, int /*<<< orphan*/, int /*<<< orphan*/ *,
                              int);
uint32_t TSC_RdReg(uint8_t reg, uint8_t *val) {
  return I2C_RdData(0x41, reg, val, 1);
}


x86 assembly (clang, -O0):
<TSC_RdReg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x41,%edi
mov    $0x1,%ecx
call   1030 <I2C_RdData@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TSC_RdReg>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x41,%edi
mov    $0x1,%ecx
jmp    1030 <I2C_RdData@plt>

LLVM IR (-O0):
define i32 @TSC_RdReg(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** %4
%7 = call i32 @I2C_RdData(i32 65, i32 %5, i32* %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @TSC_RdReg(i32 %0, i32* %1) {
%3 = tail call i32 @I2C_RdData(i32 65, i32 %0, i32* %1, i32 1)
ret i32 %3
}
int mult(int a, int b) { return a * b; }


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

x86 assembly (clang, -O2):
<mult>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @mult(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* %4
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mult(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int send(int, void *, size_t, int /*<<< orphan*/);
int udp_send(void *arg, void *buf, size_t len) {
  int *fd = (int *)arg;
  return send(*fd, buf, len, 0);
}


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

x86 assembly (clang, -O2):
<udp_send>:
mov    (%rdi),%edi
xor    %ecx,%ecx
jmp    1030 <send@plt>

LLVM IR (-O0):
define i32 @udp_send(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
%10 = load i32*, i32** %7
%11 = load i32, i32* %10
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @send(i32 %11, i8* %12, i64 %13, i32 0)
ret i32 %14
}

LLVM IR (-O2):
define i32 @udp_send(i8* nocapture %0, i8* %1, i64 %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @send(i32 %5, i8* %1, i64 %2, i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int, size_t);
void pgm_clear(unsigned char *img, size_t width, size_t height) {
  memset(img, 0x00, width * height);
}


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

x86 assembly (clang, -O2):
<pgm_clear>:
imul   %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @pgm_clear(i8* %0, i64 %1, i64 %2) {
%4 = mul i64 %2, %1
%5 = tail call i32 @memset(i8* %0, i32 0, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UpnpResponse_MediaRenderer_AVTransport_Next(void *);
int /*<<< orphan*/ printf(char *, unsigned int);
void UpnpMediaRenderer_AVTransport_Next(void *upnptoken,
                                        unsigned int InstanceID) {
  printf("Invoke: UpnpMediaRenderer_AVTransport_Next(%u);\r\n", InstanceID);
  UpnpResponse_MediaRenderer_AVTransport_Next(upnptoken);
}


x86 assembly (clang, -O0):
<UpnpMediaRenderer_AVTransport_Next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UpnpResponse_MediaRenderer_AVTransport_Next@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpMediaRenderer_AVTransport_Next>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UpnpResponse_MediaRenderer_AVTransport_Next@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"Invoke: UpnpMediaRenderer_AVTransport_Next(%u);\0D\0A\00"
define void @UpnpMediaRenderer_AVTransport_Next(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @UpnpResponse_MediaRenderer_AVTransport_Next(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"Invoke: UpnpMediaRenderer_AVTransport_Next(%u);\0D\0A\00"
define void @UpnpMediaRenderer_AVTransport_Next(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UpnpResponse_MediaRenderer_AVTransport_Next(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_SETFD;
int fcntl(int, int /*<<< orphan*/, int);
int closeonexec(int fd) { return fcntl(fd, F_SETFD, 1); }


x86 assembly (clang, -O0):
<closeonexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeonexec>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_SETFD = global i32 0
define i32 @closeonexec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETFD
%5 = call i32 @fcntl(i32 %3, i32 %4, i32 1)
ret i32 %5
}

LLVM IR (-O2):
@F_SETFD = global i32 0
define i32 @closeonexec(i32 %0) {
%2 = load i32, i32* @F_SETFD
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 1)
ret i32 %3
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_60(uint64_t x) {
  __asm__("rolq $60, %0" : "=r"(x) : "0"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<ROL64_60>:
mov    %rdi,%rax
rol    $0x3c,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_60(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$60, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_60(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$60, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
int main() {
  int arr[2];
  int *p;
  p = &arr[1];
  p -= 1;
  *p = 123;
  if (arr[0] != 123)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x7b,(%rax)
cmpl   $0x7b,-0xc(%rbp)
je     1143 <main+0x43>
movl   $0x1,-0x4(%rbp)
jmp    114a <main+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned int ntob24(char *data) {
  unsigned int val;
  unsigned char *c = (unsigned char *)data;
  val = (c[0] << 16) | (c[1] << 8) | c[2];
  return val;
}


x86 assembly (clang, -O0):
<ntob24>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
shl    $0x10,%eax
mov    -0x18(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x18(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntob24>:
movzbl (%rdi),%eax
shl    $0x10,%eax
movzbl 0x1(%rdi),%ecx
shl    $0x8,%ecx
or     %eax,%ecx
movzbl 0x2(%rdi),%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ntob24(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 16
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = or i32 %9, %12
ret i32 %13
}
int main(int argc, char *argv[]) {
  int a[4];
  a[0] = a[1] = a[2] = a[3] = 0;
  __asm__("sidt %0 \n"
          "sgdt %1 \n"
          : "=m"(a), "=m"(a[2]));
  write(1, a, 16);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
lea    -0x20(%rbp),%rax
add    $0x8,%rax
sidt   -0x20(%rbp)
sgdt   (%rax)
lea    -0x20(%rbp),%rsi
mov    $0x1,%edi
mov    $0x10,%edx
mov    $0x0,%al
call   1030 <write@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
sidt   (%rsp)
sgdt   0x8(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edi
mov    $0x10,%edx
xor    %eax,%eax
call   1030 <write@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [4 x i32]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 3
store i32 0, i32* %6
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 2
store i32 0, i32* %7
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 1
store i32 0, i32* %8
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
store i32 0, i32* %9
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 2
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%12 = call i32 (i32, i32*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i32*, i32, ...)*)(i32 1, i32* %11, i32 16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4 x i32]
%4 = bitcast [4 x i32]* %3 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 2
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%7 = bitcast [4 x i32]* %3 to i8*
%8 = call i32 (i32, i32*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i32*, i32, ...)*)(i32 1, i32* %6, i32 16)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x91() {
  Assert_real((isbdigit(145) == 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_isbdigit.c",
              730, ("isbdigit should be 0 for 0x91"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x91>:
push   %rax
mov    $0x91,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2da,%edx
pop    %rax
jmp    1030 <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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x91\00"
define void @t_isbdigit_0x91() {
%1 = call i64 @isbdigit(i32 145)
%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 730, i8* getelementptr inbounds ([30 x i8], [30 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x91\00"
define void @t_isbdigit_0x91() {
%1 = tail call i64 @isbdigit(i32 145)
%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 730, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setState(int);
void myDashInit() { setState(1); }


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

x86 assembly (clang, -O2):
<myDashInit>:
mov    $0x1,%edi
jmp    1030 <setState@plt>

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

LLVM IR (-O2):
define void @myDashInit() {
%1 = tail call i32 @setState(i32 1)
ret void
}