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

/* Variables and functions */
void setGpioPinValu(uint32_t hGPIO, uint32_t nPin, uint32_t on) {
  uint32_t *GPIO_ODR;
  GPIO_ODR = (uint32_t *)(hGPIO + 0x14);
  *GPIO_ODR &= ~(0x01 << nPin);
  *GPIO_ODR |= (on << nPin);
}


x86 assembly (clang, -O0):
<setGpioPinValu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x14,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    $0xffffffff,%ecx
mov    -0x18(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setGpioPinValu>:
mov    %esi,%ecx
movslq %edi,%rax
shl    %cl,%edx
mov    0x14(%rax),%esi
btr    %ecx,%esi
or     %esi,%edx
mov    %edx,0x14(%rax)
ret

LLVM IR (-O0):
define void @setGpioPinValu(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 20
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %7
%12 = load i32, i32* %5
%13 = shl i32 1, %12
%14 = xor i32 %13, -1
%15 = load i32*, i32** %7
%16 = load i32, i32* %15
%17 = and i32 %16, %14
store i32 %17, i32* %15
%18 = load i32, i32* %6
%19 = load i32, i32* %5
%20 = shl i32 %18, %19
%21 = load i32*, i32** %7
%22 = load i32, i32* %21
%23 = or i32 %22, %20
store i32 %23, i32* %21
ret void
}

LLVM IR (-O2):
define void @setGpioPinValu(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, 20
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = shl nuw i32 1, %1
%8 = xor i32 %7, -1
%9 = load i32, i32* %6
%10 = and i32 %9, %8
%11 = shl i32 %2, %1
%12 = or i32 %10, %11
store i32 %12, i32* %6
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void integer_overflow_by_addition_Bad() {
  char arr[10];
  int32_t x = 2000000000;
  int32_t y = 2000000000;
  int32_t z = x + y;
  if (z < 10) {
    arr[z] = 0;
  }
}


x86 assembly (clang, -O0):
<integer_overflow_by_addition_Bad>:
push   %rbp
mov    %rsp,%rbp
movl   $0x77359400,-0x10(%rbp)
movl   $0x77359400,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0xa,-0x18(%rbp)
jge    112e <integer_overflow_by_addition_Bad+0x2e>
movslq -0x18(%rbp),%rax
movb   $0x0,-0xa(%rbp,%rax,1)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @integer_overflow_by_addition_Bad() {
%1 = alloca [10 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 2000000000, i32* %2
store i32 2000000000, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %14
10: ; preds = %0
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %12
store i8 0, i8* %13
br label %14
14: ; preds = %10, %0
ret void
}

LLVM IR (-O2):
define void @integer_overflow_by_addition_Bad() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ daemonize(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  daemonize(argv[0], 0);
  sleep(5);
  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)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
xor    %esi,%esi
call   1030 <daemonize@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rdi
xor    %esi,%esi
call   1030 <daemonize@plt>
mov    $0x5,%edi
call   1040 <sleep@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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @daemonize(i8* %8, i32 0)
%10 = call i32 @sleep(i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @daemonize(i8* %3, i32 0)
%5 = tail call i32 @sleep(i32 5)
ret i32 0
}
/* Variables and functions */
char getchar();
char get_input() {
  char input;
  input = getchar();
  return input;
}


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

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

LLVM IR (-O0):
define signext i8 @get_input() {
%1 = alloca i8
%2 = call signext i8 (...) @getchar()
store i8 %2, i8* %1
%3 = load i8, i8* %1
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @get_input() {
%1 = tail call signext i8 (...) @getchar()
ret i8 %1
}
int set_array(int a[2][5], int x, int y, int val) { a[x][y] = val; }


x86 assembly (clang, -O0):
<set_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @set_array([5 x i32]* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = sext i32 %1 to i64
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 %5, i64 %6
store i32 %3, i32* %7
ret i32 undef
}
int fiveeights(int x) {
  x <<= 3;
  return (x << 2) + x;
}


x86 assembly (clang, -O0):
<fiveeights>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiveeights>:
shl    $0x3,%edi
lea    (%rdi,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @fiveeights(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 3
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = shl i32 %5, 2
%7 = load i32, i32* %2
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @fiveeights(i32 %0) {
%2 = mul i32 %0, 40
ret i32 %2
}
int darm_my_rrx(int value, int carry_in) {
  if (carry_in == 0) {
    return (value >> 1);
  } else {
    return ((value >> 1) | 0x80000000);
  }
}


x86 assembly (clang, -O0):
<darm_my_rrx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1122 <darm_my_rrx+0x22>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1130 <darm_my_rrx+0x30>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
or     $0x80000000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<darm_my_rrx>:
mov    %edi,%ecx
sar    %ecx
shr    %edi
lea    -0x80000000(%rdi),%eax
test   %esi,%esi
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @darm_my_rrx(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = ashr i32 %9, 1
store i32 %10, i32* %3
br label %15
11: ; preds = %2
%12 = load i32, i32* %4
%13 = ashr i32 %12, 1
%14 = or i32 %13, -2147483648
store i32 %14, i32* %3
br label %15
15: ; preds = %11, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @darm_my_rrx(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = ashr i32 %0, 1
%5 = lshr i32 %0, 1
%6 = or i32 %5, -2147483648
%7 = select i1 %3, i32 %4, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *get_password_if_match(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *password;
  password = get_password_if_match("Enter password: ", "Re-enter password: ");
  if (password) {
    printf("Passwords match! (\"%s\")\n", password);
    free(password);
  }
}


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)
lea    0xeb3(%rip),%rdi
lea    0xebd(%rip),%rsi
call   1050 <get_password_if_match@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1181 <main+0x51>
mov    -0x18(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1050 <get_password_if_match@plt>
test   %rax,%rax
je     1163 <main+0x33>
mov    %rax,%rbx
lea    0xed2(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter password: \00"
@.str.1 = [20 x i8] c"Re-enter password: \00"
@.str.2 = [25 x i8] c"Passwords match! (\22%s\22)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @get_password_if_match(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8*, i8** %6
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %6
%14 = call i32 @free(i8* %13)
br label %15
15: ; preds = %10, %2
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter password: \00"
@.str.1 = [20 x i8] c"Re-enter password: \00"
@.str.2 = [25 x i8] c"Passwords match! (\22%s\22)\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @get_password_if_match(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%7 = tail call i32 @free(i8* %3)
br label %8
8: ; preds = %5, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_implode(char *string) {
  if (string)
    free(string);
}


x86 assembly (clang, -O0):
<free_implode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <free_implode+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @free_implode(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, int);
void g_memcpy(void *d_ptr, const void *s_ptr, int size) {
  memcpy(d_ptr, s_ptr, size);
}


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

x86 assembly (clang, -O2):
<g_memcpy>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @g_memcpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int checker_read_unsigned_int(int, char const *, int, unsigned int *);
int checker_read_corr_unsigned_int(const char *name, int eof_error_flag,
                                   unsigned int *p_val) {
  return checker_read_unsigned_int(2, name, eof_error_flag, p_val);
}


x86 assembly (clang, -O0):
<checker_read_corr_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x2,%edi
call   1030 <checker_read_unsigned_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checker_read_corr_unsigned_int>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x2,%edi
jmp    1030 <checker_read_unsigned_int@plt>

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

LLVM IR (-O2):
define i32 @checker_read_corr_unsigned_int(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 @checker_read_unsigned_int(i32 2, i8* %0, i32 %1, i32* %2)
ret i32 %4
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  int z = __VERIFIER_nondet_int();
  if (2 * y < z) {
    return 0;
  }
  while (x >= 0 && z == 1) {
    x = x - 2 * y + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
cmp    -0x10(%rbp),%eax
jge    1158 <main+0x48>
movl   $0x0,-0x4(%rbp)
jmp    11a3 <main+0x93>
jmp    115d <main+0x4d>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jl     1176 <main+0x66>
cmpl   $0x1,-0x10(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1186 <main+0x76>
jmp    119c <main+0x8c>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115d <main+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %2
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %3
%7 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %7, i32* %4
%8 = load i32, i32* %3
%9 = mul nsw i32 2, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %0
store i32 0, i32* %1
br label %29
13: ; preds = %0
br label %14
14: ; preds = %22, %13
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 1
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br i1 %21, label %22, label %28
22: ; preds = %20
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = mul nsw i32 2, %24
%26 = sub nsw i32 %23, %25
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %14
28: ; preds = %20
store i32 0, i32* %1
br label %29
29: ; preds = %28, %12
%30 = load i32, i32* %1
ret i32 %30
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outb(char, int);
void counterAModeRegister(char var) { outb(var, 0x0260 + 0x17); }


x86 assembly (clang, -O0):
<counterAModeRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x277,%esi
movsbl -0x1(%rbp),%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<counterAModeRegister>:
mov    $0x277,%esi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @counterAModeRegister(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @outb(i8 signext %3, i32 631)
ret void
}

LLVM IR (-O2):
define void @counterAModeRegister(i8 signext %0) {
%2 = tail call i32 @outb(i8 signext %0, i32 631)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getCursorPosition2(int *, int *);
int c_wherey(void) {
  int x, y;
  getCursorPosition2(&x, &y);
  return y;
}


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

x86 assembly (clang, -O2):
<c_wherey>:
push   %rax
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <getCursorPosition2@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @c_wherey() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @getCursorPosition2(i32* %1, i32* %2)
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
define i32 @c_wherey() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @getCursorPosition2(i32* %1, i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ bcopy(long long *, long long *, int);
main() {
  long long s[16384 / 8];
  long long d[16384 / 8];
  int i;
  for (i = 1; i < 67108864 / 16384; i++)
    bcopy(s, d, 16384);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x8020,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8014(%rbp)
cmpl   $0x1000,-0x8014(%rbp)
jge    1168 <main+0x58>
lea    -0x4010(%rbp),%rdi
lea    -0x8010(%rbp),%rsi
mov    $0x4000,%edx
call   1030 <bcopy@plt>
mov    -0x8014(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8014(%rbp)
jmp    112c <main+0x1c>
mov    -0x4(%rbp),%eax
add    $0x8020,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ wsh();
int main(int argc, char *argv[]) {
  wsh();
  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)
mov    $0x0,%al
call   1030 <wsh@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <wsh@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 = call i32 (...) @wsh()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @wsh()
ret i32 0
}
int abs(int num) {
  if (num >= 0) {
    return num;
  } else {
    return -num;
  }
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111c <abs+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <abs+0x24>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub nsw i32 0, %9
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
unsigned int hex2dec(char nibble) {
  char val = 0;
  if (nibble > 'a') {
    val = nibble - 'a' + 10;
  } else if (nibble > 'A') {
    val = nibble - 'A' + 10;
  } else {
    val = nibble - '0';
  }
  return val;
}


x86 assembly (clang, -O0):
<hex2dec>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jle    112d <hex2dec+0x2d>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %al,-0x2(%rbp)
jmp    115b <hex2dec+0x5b>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jle    114c <hex2dec+0x4c>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %al,-0x2(%rbp)
jmp    1156 <hex2dec+0x56>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x2(%rbp)
jmp    115b <hex2dec+0x5b>
movsbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex2dec>:
cmp    $0x42,%dil
mov    $0xc9,%eax
mov    $0xd0,%ecx
cmovge %eax,%ecx
cmp    $0x62,%dil
mov    $0xa9,%eax
cmovl  %ecx,%eax
add    %dil,%al
movsbl %al,%eax
ret

LLVM IR (-O0):
define i32 @hex2dec(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sgt i32 %5, 97
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 97
%11 = add nsw i32 %10, 10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %3
br label %29
13: ; preds = %1
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = icmp sgt i32 %15, 65
br i1 %16, label %17, label %23
17: ; preds = %13
%18 = load i8, i8* %2
%19 = sext i8 %18 to i32
%20 = sub nsw i32 %19, 65
%21 = add nsw i32 %20, 10
%22 = trunc i32 %21 to i8
store i8 %22, i8* %3
br label %28
23: ; preds = %13
%24 = load i8, i8* %2
%25 = sext i8 %24 to i32
%26 = sub nsw i32 %25, 48
%27 = trunc i32 %26 to i8
store i8 %27, i8* %3
br label %28
28: ; preds = %23, %17
br label %29
29: ; preds = %28, %7
%30 = load i8, i8* %3
%31 = sext i8 %30 to i32
ret i32 %31
}

LLVM IR (-O2):
define i32 @hex2dec(i8 signext %0) {
%2 = icmp sgt i8 %0, 97
%3 = icmp sgt i8 %0, 65
%4 = select i1 %3, i8 -55, i8 -48
%5 = select i1 %2, i8 -87, i8 %4
%6 = add i8 %5, %0
%7 = sext i8 %6 to i32
ret i32 %7
}
/* Variables and functions */
int process_move_internal(char **, int, int /*<<< orphan*/);
int process_below(char **x) { return process_move_internal(x, 1, 0); }


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

x86 assembly (clang, -O2):
<process_below>:
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <process_move_internal@plt>

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

LLVM IR (-O2):
define i32 @process_below(i8** %0) {
%2 = tail call i32 @process_move_internal(i8** %0, i32 1, i32 0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __set_CSSELR(int /*<<< orphan*/);
__attribute__((deprecated)) __attribute__((always_)) void
__set_CCSIDR(uint32_t value) {
  __set_CSSELR(value);
}


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

x86 assembly (clang, -O2):
<__set_CCSIDR>:
jmp    1030 <__set_CSSELR@plt>

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

LLVM IR (-O2):
define void @__set_CCSIDR(i32 %0) {
%2 = tail call i32 @__set_CSSELR(i32 %0)
ret void
}
void g_DUMMY_set_commandhistory(int win_id, char *history) {
  win_id = win_id;
  history = history;
}


x86 assembly (clang, -O0):
<g_DUMMY_set_commandhistory>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @g_DUMMY_set_commandhistory(i32 %0, i8* nocapture %1) {
ret void
}
float xdiv2f(float d) {
  if (*(int *)&d & 0x7FFFFFFF) {
    *(int *)&d -= 1 << 23;
  }
  return d;
}


x86 assembly (clang, -O0):
<xdiv2f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7fffffff,%eax
cmp    $0x0,%eax
je     1125 <xdiv2f+0x25>
mov    -0x4(%rbp),%eax
sub    $0x800000,%eax
mov    %eax,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdiv2f>:
movd   %xmm0,%eax
test   $0x7fffffff,%eax
je     1114 <xdiv2f+0x14>
add    $0xff800000,%eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
define float @xdiv2f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = bitcast float* %2 to i32*
%4 = load i32, i32* %3
%5 = and i32 %4, 2147483647
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = bitcast float* %2 to i32*
%9 = load i32, i32* %8
%10 = sub nsw i32 %9, 8388608
store i32 %10, i32* %8
br label %11
11: ; preds = %7, %1
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @xdiv2f(float %0) {
%2 = bitcast float %0 to i32
%3 = and i32 %2, 2147483647
%4 = icmp eq i32 %3, 0
%5 = add nsw i32 %2, -8388608
%6 = bitcast i32 %5 to float
%7 = select i1 %4, float %0, float %6
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x23() {
  Assert_real((isprint(35)),
              "/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",
              180, ("isprint should be 1 for #"));
}


x86 assembly (clang, -O0):
<t_isprint_0x23>:
push   %rbp
mov    %rsp,%rbp
mov    $0x23,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xb4,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x23>:
push   %rax
mov    $0x23,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xb4,%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 = [26 x i8] c"isprint should be 1 for #\00"
define void @t_isprint_0x23() {
%1 = call i32 @isprint(i32 35)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 180, i8* getelementptr inbounds ([26 x i8], [26 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 = [26 x i8] c"isprint should be 1 for #\00"
define void @t_isprint_0x23() {
%1 = tail call i32 @isprint(i32 35)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 180, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sigint_handler(int signum) { exit(0); }


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sigint_handler>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sigint_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sigint_handler(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
unsigned long compaction_suitable(struct zone *zone, int order) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.zone = type opaque
define i64 @compaction_suitable(%struct.zone* nocapture readnone %0, i32 %1) {
ret i64 0
}
/* Variables and functions */
int do_read_status_reg(int);
int check_wel(int fd) { return do_read_status_reg(fd) & (1 << 1); }


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

x86 assembly (clang, -O2):
<check_wel>:
push   %rax
call   1030 <do_read_status_reg@plt>
and    $0x2,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @check_wel(i32 %0) {
%2 = tail call i32 @do_read_status_reg(i32 %0)
%3 = and i32 %2, 2
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ u_long;

/* Variables and functions */
u_long ntohl(u_long netlong) {
  u_long result = 0;
  ((char *)&result)[0] = ((char *)&netlong)[3];
  ((char *)&result)[1] = ((char *)&netlong)[2];
  ((char *)&result)[2] = ((char *)&netlong)[1];
  ((char *)&result)[3] = ((char *)&netlong)[0];
  return result;
}


x86 assembly (clang, -O0):
<ntohl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x10(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0xf(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @ntohl(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = zext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int recv(int, unsigned char *, int, int /*<<< orphan*/);
int transport_getdatanb(void *sck, unsigned char *buf, int count) {
  int sock = *((int *)sck);
  int rc = recv(sock, buf, count, 0);
  if (rc == -1) {
    return 0;
  }
  return rc;
}


x86 assembly (clang, -O0):
<transport_getdatanb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    1156 <transport_getdatanb+0x46>
movl   $0x0,-0x4(%rbp)
jmp    115c <transport_getdatanb+0x4c>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transport_getdatanb>:
push   %rbx
mov    (%rdi),%edi
xor    %ebx,%ebx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
cmove  %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @transport_getdatanb(i8* nocapture %0, i8* %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @recv(i32 %5, i8* %1, i32 %2, i32 0)
%7 = icmp eq i32 %6, -1
%8 = select i1 %7, i32 0, i32 %6
ret i32 %8
}
const char *GetTypeName(const int type) {
  switch (type) {
  case 0x1000:
    return "INT";
    break;
  case 0x1001:
    return "STRING";
    break;
  default:
    return "NOPE";
    break;
  }
}


x86 assembly (clang, -O0):
<GetTypeName>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1000,%eax
je     1130 <GetTypeName+0x30>
jmp    111d <GetTypeName+0x1d>
mov    -0x10(%rbp),%eax
sub    $0x1001,%eax
je     1140 <GetTypeName+0x40>
jmp    1150 <GetTypeName+0x50>
lea    0xec9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <GetTypeName+0x5b>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <GetTypeName+0x5b>
lea    0xeb4(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetTypeName>:
cmp    $0x1001,%edi
lea    0xef7(%rip),%rax
lea    0xef7(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x1000,%edi
lea    0xedb(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"INT\00"
@.str.1 = [7 x i8] c"STRING\00"
@.str.2 = [5 x i8] c"NOPE\00"
define i8* @GetTypeName(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 4096, label %5
i32 4097, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [4 x i8] c"INT\00"
@.str.1 = [7 x i8] c"STRING\00"
@.str.2 = [5 x i8] c"NOPE\00"
define i8* @GetTypeName(i32 %0) {
%2 = icmp eq i32 %0, 4097
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 4096
%5 = select i1 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ FH_DU();
int /*<<< orphan*/ init();
int /*<<< orphan*/ interface();
int benchmark(void) {
  init();
  interface();
  FH_DU();
  return 0;
}


x86 assembly (clang, -O0):
<benchmark>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x0,%al
call   1030 <interface@plt>
mov    $0x0,%al
call   1050 <FH_DU@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<benchmark>:
push   %rax
xor    %eax,%eax
call   1040 <init@plt>
xor    %eax,%eax
call   1030 <interface@plt>
xor    %eax,%eax
call   1050 <FH_DU@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @benchmark() {
%1 = call i32 (...) @init()
%2 = call i32 (...) @interface()
%3 = call i32 (...) @FH_DU()
ret i32 0
}

LLVM IR (-O2):
define i32 @benchmark() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @interface()
%3 = tail call i32 (...) @FH_DU()
ret i32 0
}
/* Variables and functions */
double pow(double, int);
double f(double x) { return pow(x, 3); }


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

x86 assembly (clang, -O2):
<f>:
mov    $0x3,%edi
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call double @pow(double %0, i32 3)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ func_2();
void func_1(void) {
  int var_1 = 1;
  func_2();
}


x86 assembly (clang, -O0):
<func_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    $0x0,%al
call   1030 <func_2@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func_1() {
%1 = alloca i32
store i32 1, i32* %1
%2 = call i32 (...) @func_2()
ret void
}

LLVM IR (-O2):
define void @func_1() {
%1 = tail call i32 (...) @func_2()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addscore(int, int);
void scorekill2(void) {
  addscore(0, 125);
  addscore(1, 125);
}


x86 assembly (clang, -O0):
<scorekill2>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x7d,%esi
call   1030 <addscore@plt>
mov    $0x1,%edi
mov    $0x7d,%esi
call   1030 <addscore@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<scorekill2>:
push   %rax
xor    %edi,%edi
mov    $0x7d,%esi
call   1030 <addscore@plt>
mov    $0x1,%edi
mov    $0x7d,%esi
pop    %rax
jmp    1030 <addscore@plt>

LLVM IR (-O0):
define void @scorekill2() {
%1 = call i32 @addscore(i32 0, i32 125)
%2 = call i32 @addscore(i32 1, i32 125)
ret void
}

LLVM IR (-O2):
define void @scorekill2() {
%1 = tail call i32 @addscore(i32 0, i32 125)
%2 = tail call i32 @addscore(i32 1, i32 125)
ret void
}
void g_value_set_int() {}


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

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

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

LLVM IR (-O2):
define void @g_value_set_int() {
ret void
}
int johab_to_johab(char *s, int johab) {
  if (johab < 128) {
    *s = johab;
    return 1;
  }
  *s++ = 0x80 | (johab >> 8);
  *s = johab & 0xff;
  return 2;
}


x86 assembly (clang, -O0):
<johab_to_johab>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x80,-0x14(%rbp)
jge    112f <johab_to_johab+0x2f>
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1164 <johab_to_johab+0x64>
mov    -0x14(%rbp),%eax
sar    $0x8,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<johab_to_johab>:
mov    $0x1,%eax
cmp    $0x80,%esi
jl     111f <johab_to_johab+0x1f>
mov    %esi,%eax
shr    $0x8,%eax
or     $0x80,%al
mov    %al,(%rdi)
add    $0x1,%rdi
mov    $0x2,%eax
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define i32 @johab_to_johab(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, 128
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %5
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %4
store i8 %10, i8* %11
store i32 1, i32* %3
br label %23
12: ; preds = %2
%13 = load i32, i32* %5
%14 = ashr i32 %13, 8
%15 = or i32 128, %14
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %4
store i8 %16, i8* %17
%19 = load i32, i32* %5
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %4
store i8 %21, i8* %22
store i32 2, i32* %3
br label %23
23: ; preds = %12, %8
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @johab_to_johab(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp slt i32 %1, 128
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = lshr i32 %1, 8
%6 = trunc i32 %5 to i8
%7 = or i8 %6, -128
%8 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %7, i8* %0
br label %9
9: ; preds = %2, %4
%10 = phi i8* [ %8, %4 ], [ %0, %2 ]
%11 = phi i32 [ 2, %4 ], [ 1, %2 ]
%12 = trunc i32 %1 to i8
store i8 %12, i8* %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M578_f(char *s) {
  debug("M578_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M578_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M578_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M578_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M578_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M578_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M578_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void I2CMasterSlaveAddrSet(unsigned int baseAdd, unsigned int slaveAdd) {
  (*((volatile unsigned int *)(baseAdd + (0xAC)))) = slaveAdd;
}


x86 assembly (clang, -O0):
<I2CMasterSlaveAddrSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0xac,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterSlaveAddrSet>:
add    $0xac,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterSlaveAddrSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %6, 172
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @I2CMasterSlaveAddrSet(i32 %0, i32 %1) {
%3 = add i32 %0, 172
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 %1, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_2361() {
  Assert_real((isqrt(2361) == 48),
              "/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",
              1315, ("Integer square root of 2361 should be 48"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_2361>:
push   %rax
mov    $0x939,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x30,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x523,%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 = [41 x i8] c"Integer square root of 2361 should be 48\00"
define void @t_sqrt_2361() {
%1 = call i32 @isqrt(i32 2361)
%2 = icmp eq i32 %1, 48
%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 1315, i8* getelementptr inbounds ([41 x i8], [41 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 = [41 x i8] c"Integer square root of 2361 should be 48\00"
define void @t_sqrt_2361() {
%1 = tail call i32 @isqrt(i32 2361)
%2 = icmp eq i32 %1, 48
%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 1315, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}