xunge/DecIR huggingface dataset:
/* Variables and functions */
int rand();
void randomArray(int nums[], int n) {
  int i;
  for (i = 0; i < n; i++) {
    nums[i] = rand() % 1000;
  }
}


x86 assembly (clang, -O0):
<randomArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <randomArray+0x4a>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <randomArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomArray>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1162 <randomArray+0x52>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <randomArray+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @randomArray(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 1000
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
store i32 %12, i32* %16
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @randomArray(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 1000
%10 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %9, i32* %10
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void av_frame_get_pkt_duration() {}


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

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

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

LLVM IR (-O2):
define void @av_frame_get_pkt_duration() {
ret void
}
int get_fstein_dither(void) { return 0x80; }


x86 assembly (clang, -O0):
<get_fstein_dither>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_fstein_dither() {
ret i32 128
}

LLVM IR (-O2):
define i32 @get_fstein_dither() {
ret i32 128
}
/* Variables and functions */
double atof(char *);
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("Value = %g\n", atof("10.42"));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Value = %g\0A\00"
@.str.1 = [6 x i8] c"10.42\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @atof(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Value = %g\0A\00"
@.str.1 = [6 x i8] c"10.42\00"
define i32 @main() {
%1 = tail call double @atof(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
void os_init(void) { *(volatile unsigned int *)0x20200004 = 1 << 18; }


x86 assembly (clang, -O0):
<os_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20200004,%eax
movl   $0x40000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_init>:
movl   $0x40000,0x20200004
ret

LLVM IR (-O0):
define void @os_init() {
store volatile i32 262144, i32* inttoptr (i64 538968068 to i32*)
ret void
}

LLVM IR (-O2):
define void @os_init() {
store volatile i32 262144, i32* inttoptr (i64 538968068 to i32*)
ret void
}
/* Type definitions */
struct passwd {
  int /*<<< orphan*/ pw_gid;
};
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
struct passwd *getpwnam(char const *);
gid_t get_primary_group(const char *user) {
  struct passwd *pwd;
  if ((pwd = getpwnam(user)) == NULL) {
    return (gid_t)-1;
  }
  return pwd->pw_gid;
}


x86 assembly (clang, -O0):
<get_primary_group>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getpwnam@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    113f <get_primary_group+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1148 <get_primary_group+0x38>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_primary_group>:
push   %rax
call   1030 <getpwnam@plt>
test   %rax,%rax
je     111f <get_primary_group+0xf>
mov    (%rax),%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
define i32 @get_primary_group(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.passwd*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call %struct.passwd* @getpwnam(i8* %5)
store %struct.passwd* %6, %struct.passwd** %4
%7 = icmp eq %struct.passwd* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %13
9: ; preds = %1
%10 = load %struct.passwd*, %struct.passwd** %4
%11 = getelementptr inbounds %struct.passwd, %struct.passwd* %10, i32 0, i32 0
%12 = load i32, i32* %11
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define i32 @get_primary_group(i8* nocapture %0) {
%2 = tail call %struct.passwd* @getpwnam(i8* %0)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t GetRandomPos(uint8_t i) {
  return ((i * 1000004249) ^ 0xA48C4B19) & 0x1fff1fff;
}


x86 assembly (clang, -O0):
<GetRandomPos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3b9ada99,-0x4(%rbp),%eax
xor    $0xa48c4b19,%eax
and    $0x1fff1fff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetRandomPos>:
imul   $0x3b9ada99,%edi,%eax
and    $0x1fff1fff,%eax
xor    $0x48c0b19,%eax
ret

LLVM IR (-O0):
define i32 @GetRandomPos(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000004249
%5 = xor i32 %4, -1534309607
%6 = and i32 %5, 536813567
ret i32 %6
}

LLVM IR (-O2):
define i32 @GetRandomPos(i32 %0) {
%2 = mul nsw i32 %0, 1000004249
%3 = and i32 %2, 536813567
%4 = xor i32 %3, 76286745
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int series(int);
main() {
  int n = 10;
  int res = series(n);
  printf("the sum of 1 to %d is %d", n, res);
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"the sum of 1 to %d is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 10, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @series(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"the sum of 1 to %d is %d\00"
define i32 @main() {
%1 = tail call i32 @series(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 10, i32 %1)
ret i32 0
}
/* Variables and functions */
int f(int);
main() { return f(7) + 3; }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7,%edi
call   1030 <f@plt>
add    $0x3,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 7)
%2 = add nsw i32 %1, 3
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _delay_ms(int);
int /*<<< orphan*/ timer_beep_tone(int);
void beep(unsigned char times) {
  for (int i = 0; i < times; i++) {
    timer_beep_tone(8);
    _delay_ms(100);
    timer_beep_tone(0);
    _delay_ms(100);
  }
}


x86 assembly (clang, -O0):
<beep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jge    1177 <beep+0x57>
mov    $0x8,%edi
call   1030 <timer_beep_tone@plt>
mov    $0x64,%edi
call   1040 <_delay_ms@plt>
xor    %edi,%edi
call   1030 <timer_beep_tone@plt>
mov    $0x64,%edi
call   1040 <_delay_ms@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <beep+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beep>:
push   %rbx
test   %edi,%edi
je     115a <beep+0x3a>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x8,%edi
call   1030 <timer_beep_tone@plt>
mov    $0x64,%edi
call   1040 <_delay_ms@plt>
xor    %edi,%edi
call   1030 <timer_beep_tone@plt>
mov    $0x64,%edi
call   1040 <_delay_ms@plt>
add    $0xffffffff,%ebx
jne    1130 <beep+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @beep(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %17
9: ; preds = %4
%10 = call i32 @timer_beep_tone(i32 8)
%11 = call i32 @_delay_ms(i32 100)
%12 = call i32 @timer_beep_tone(i32 0)
%13 = call i32 @_delay_ms(i32 100)
br label %14
14: ; preds = %9
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @beep(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = icmp eq i8 %0, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i32 [ %11, %5 ], [ 0, %1 ]
%7 = tail call i32 @timer_beep_tone(i32 8)
%8 = tail call i32 @_delay_ms(i32 100)
%9 = tail call i32 @timer_beep_tone(i32 0)
%10 = tail call i32 @_delay_ms(i32 100)
%11 = add nuw nsw i32 %6, 1
%12 = icmp eq i32 %11, %2
br i1 %12, label %4, label %5
}
/* Variables and functions */
int init_server_long(int *, int, int /*<<< orphan*/ *);
int init_server(int *sock, int port) {
  return (init_server_long(sock, port, NULL));
}


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

x86 assembly (clang, -O2):
<init_server>:
xor    %edx,%edx
jmp    1030 <init_server_long@plt>

LLVM IR (-O0):
define i32 @init_server(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 @init_server_long(i32* %5, i32 %6, i32* null)
ret i32 %7
}

LLVM IR (-O2):
define i32 @init_server(i32* %0, i32 %1) {
%3 = tail call i32 @init_server_long(i32* %0, i32 %1, i32* null)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void gdbmiPrintHelpOdirure() {
  printf("log -- Log instructions to a log file\n");
  printf("getoct -- Converts EXP into octal value\n");
  printf("inton -- Set interrupt request\n");
  printf("intoff -- Clear interrupt request\n");
}


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

x86 assembly (clang, -O2):
<gdbmiPrintHelpOdirure>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf31(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"log -- Log instructions to a log file\0A\00"
@.str.1 = [41 x i8] c"getoct -- Converts EXP into octal value\0A\00"
@.str.2 = [32 x i8] c"inton -- Set interrupt request\0A\00"
@.str.3 = [35 x i8] c"intoff -- Clear interrupt request\0A\00"
define void @gdbmiPrintHelpOdirure() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"log -- Log instructions to a log file\00"
@str.4 = [40 x i8] c"getoct -- Converts EXP into octal value\00"
@str.5 = [31 x i8] c"inton -- Set interrupt request\00"
@str.6 = [34 x i8] c"intoff -- Clear interrupt request\00"
define void @gdbmiPrintHelpOdirure() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.6, i64 0, i64 0))
ret void
}
char *driver_get_window_title(void *handle) {
  static char title[256];
  return "UNIMPLEMENTED";
}


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

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

LLVM IR (-O0):
@driver_get_window_title.title = internal global [256 x i8] zeroinitializer
@.str = [14 x i8] c"UNIMPLEMENTED\00"
define i8* @driver_get_window_title(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"UNIMPLEMENTED\00"
define i8* @driver_get_window_title(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
void av_oformat_next() {}


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

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

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

LLVM IR (-O2):
define void @av_oformat_next() {
ret void
}
/* Variables and functions */
int ap_cmd_set_float(int, int, float);
int ap_set_pan(int session, float pan) {
  return (ap_cmd_set_float(session, 0xcc22, pan));
}


x86 assembly (clang, -O0):
<ap_set_pan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
movss  -0x8(%rbp),%xmm0
mov    $0xcc22,%esi
call   1030 <ap_cmd_set_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_set_pan>:
mov    $0xcc22,%esi
jmp    1030 <ap_cmd_set_float@plt>

LLVM IR (-O0):
define i32 @ap_set_pan(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load i32, i32* %3
%6 = load float, float* %4
%7 = call i32 @ap_cmd_set_float(i32 %5, i32 52258, float %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ap_set_pan(i32 %0, float %1) {
%3 = tail call i32 @ap_cmd_set_float(i32 %0, i32 52258, float %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ msgMessage(int, char *);
void _CheckFree(void *ptr) {
  if (!ptr)
    msgMessage((0x1000 | 0x0800 | 0x0001), "Can't free a NULL block");
  free(ptr);
}


x86 assembly (clang, -O0):
<_CheckFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <_CheckFree+0x28>
mov    $0x1801,%edi
lea    0xebd(%rip),%rsi
call   1040 <msgMessage@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_CheckFree>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    113a <_CheckFree+0x1a>
lea    0xed0(%rip),%rsi
mov    $0x1801,%edi
call   1040 <msgMessage@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Can't free a NULL block\00"
define void @_CheckFree(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 %7, label %5
5: ; preds = %1
%6 = call i32 @msgMessage(i32 6145, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Can't free a NULL block\00"
define void @_CheckFree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @msgMessage(i32 6145, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int lcd_readStatus();
int /*<<< orphan*/ lcd_shortDelay();
void lcd_waitBusy() {
  lcd_shortDelay();
  while (lcd_readStatus() & 0x80)
    ;
}


x86 assembly (clang, -O0):
<lcd_waitBusy>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <lcd_shortDelay@plt>
mov    $0x0,%al
call   1030 <lcd_readStatus@plt>
and    $0x80,%eax
cmp    $0x0,%eax
je     1145 <lcd_waitBusy+0x25>
jmp    112b <lcd_waitBusy+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_waitBusy>:
push   %rax
xor    %eax,%eax
call   1040 <lcd_shortDelay@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <lcd_readStatus@plt>
test   $0x80,%al
jne    1130 <lcd_waitBusy+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @lcd_waitBusy() {
%1 = call i32 (...) @lcd_shortDelay()
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @lcd_readStatus()
%4 = and i32 %3, 128
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @lcd_waitBusy() {
%1 = tail call i32 (...) @lcd_shortDelay()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @lcd_readStatus()
%4 = and i32 %3, 128
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
ret void
}
/* Variables and functions */
int GPTLpr_summary_file(int, char const *);
int GPTLpr_summary(int comm) {
  const char *outfile = "timing.summary";
  int ret;
  ret = GPTLpr_summary_file(comm, outfile);
  return 0;
}


x86 assembly (clang, -O0):
<GPTLpr_summary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <GPTLpr_summary_file@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"timing.summary\00"
define i32 @GPTLpr_summary(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 %0, i32* %2
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = load i32, i32* %2
%6 = load i8*, i8** %3
%7 = call i32 @GPTLpr_summary_file(i32 %5, i8* %6)
store i32 %7, i32* %4
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"timing.summary\00"
define i32 @GPTLpr_summary(i32 %0) {
%2 = tail call i32 @GPTLpr_summary_file(i32 %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
void *ckalloc(size_t bytes) {
  register void *ret;
  void die(char *format, ...);
  if (!(ret = malloc(bytes)))
    die("Out of  memory\n");
  return ret;
}


x86 assembly (clang, -O0):
<ckalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1151 <ckalloc+0x31>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ckalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <ckalloc+0x1c>
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Out of memory\0A\00"
define i8* @ckalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
br label %8
8: ; preds = %7, %1
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
@.str = [16 x i8] c"Out of memory\0A\00"
define noalias i8* @ckalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %5
4: ; preds = %1
tail call void (i8*, ...) @die(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
scalar_t__ getfloat(float *);
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float num;
  while (getfloat(&num) > 0) {
    printf("%g\n", num);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <getfloat@plt>
cmp    $0x0,%rax
jle    1158 <main+0x38>
movss  -0x8(%rbp),%xmm0
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <getfloat@plt>
test   %rax,%rax
jle    115b <main+0x3b>
lea    0xec6(%rip),%r14
lea    0x4(%rsp),%rbx
nop
movss  0x4(%rsp),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <getfloat@plt>
test   %rax,%rax
jg     1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
br label %3
3: ; preds = %6, %0
%4 = call i64 @getfloat(float* %2)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load float, float* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %7)
br label %3
9: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%g\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i64 @getfloat(float* %1)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = load float, float* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %6)
%8 = call i64 @getfloat(float* %1)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x1b() {
  Assert_real((isalnum(27) == 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_isalnum.c",
              140, ("isalnum should be 0 for 0x1b"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x1b>:
push   %rax
mov    $0x1b,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x8c,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x1b\00"
define void @t_isalnum_0x1b() {
%1 = call i64 @isalnum(i32 27)
%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 140, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x1b\00"
define void @t_isalnum_0x1b() {
%1 = tail call i64 @isalnum(i32 27)
%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 140, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *vga_get_graphics_device_name(void) {
  return "Video Electronics Standard Association (VESA) compatible graphics "
         "card.";
}


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

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

LLVM IR (-O0):
@.str = [72 x i8] c"Video Electronics Standard Association (VESA) compatible graphics card.\00"
define i8* @vga_get_graphics_device_name() {
ret i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [72 x i8] c"Video Electronics Standard Association (VESA) compatible graphics card.\00"
define i8* @vga_get_graphics_device_name() {
ret i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0)
}
void ff_hevc_put_hevc_uni_qpel_v12_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_v12_10_sse4() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ first_error;
};
typedef TYPE_1__ XExtCodes;

/* Variables and functions */
int get_XExtCodes_first_error(void *_p) {
  return (int)((XExtCodes *)_p)->first_error;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XExtCodes_first_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XExtCodes_first_error(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int ip_authenticate(char *auth_data) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @ip_authenticate(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
scalar_t__ write(int, char *, int);
void reset_display() {
  if (write(1, "\033c", 2))
    do {
    } while (0);
}


x86 assembly (clang, -O0):
<reset_display>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
je     1143 <reset_display+0x33>
jmp    1139 <reset_display+0x29>
jmp    113e <reset_display+0x2e>
jmp    1143 <reset_display+0x33>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_display>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x2,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\1Bc\00"
define void @reset_display() {
%1 = call i64 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
br label %4
4: ; preds = %3
br label %5
5: ; preds = %4
br label %6
6: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\1Bc\00"
define void @reset_display() {
%1 = tail call i64 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
char decode64Char1(char ci1, char ci2) {
  return ((ci1 << 2) | ((ci2 >> 4) & 3));
}


x86 assembly (clang, -O0):
<decode64Char1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
shl    $0x2,%eax
movsbl -0x2(%rbp),%ecx
sar    $0x4,%ecx
and    $0x3,%ecx
or     %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode64Char1>:
lea    0x0(,%rdi,4),%eax
shr    $0x4,%sil
and    $0x3,%sil
or     %sil,%al
ret

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

LLVM IR (-O2):
define signext i8 @decode64Char1(i8 signext %0, i8 signext %1) {
%3 = shl i8 %0, 2
%4 = lshr i8 %1, 4
%5 = and i8 %4, 3
%6 = or i8 %5, %3
ret i8 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void AESConfigSet(uint32_t ui32Base, uint32_t ui32Config) {
  ;

  ;

  ;

  ;

  ;

  ;
  if ((*((volatile unsigned long *)(ui32Base + 0x00000050))) & 0x20000000) {
    ui32Config |= 0x20000000;
  }
  (*((volatile unsigned long *)(ui32Base + 0x00000050))) = ui32Config;
}


x86 assembly (clang, -O0):
<AESConfigSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%eax
cltq
mov    (%rax),%rax
and    $0x20000000,%rax
cmp    $0x0,%rax
je     1130 <AESConfigSet+0x30>
mov    -0x8(%rbp),%eax
or     $0x20000000,%eax
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rcx
mov    -0x4(%rbp),%eax
add    $0x50,%eax
cltq
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESConfigSet>:
movslq %edi,%rax
mov    0x50(%rax),%rcx
and    $0x20000000,%ecx
or     %esi,%ecx
movslq %ecx,%rcx
mov    %rcx,0x50(%rax)
ret

LLVM IR (-O0):
define void @AESConfigSet(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 nsw i32 %5, 80
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, 536870912
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* %4
%14 = or i32 %13, 536870912
store i32 %14, i32* %4
br label %15
15: ; preds = %12, %2
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 80
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i64*
store volatile i64 %17, i64* %21
ret void
}

LLVM IR (-O2):
define void @AESConfigSet(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 80
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = and i32 %7, 536870912
%9 = or i32 %8, %1
%10 = sext i32 %9 to i64
store volatile i64 %10, i64* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xc2() {
  Assert_real((isxdigit(194) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              975, ("isxdigit should be 0 for 0xc2"));
}


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

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

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xc2\00"
define void @t_isxdigit_0xc2() {
%1 = call i64 @isxdigit(i32 194)
%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 975, 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xc2\00"
define void @t_isxdigit_0xc2() {
%1 = tail call i64 @isxdigit(i32 194)
%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 975, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void swap(int *x, int i, int j) {
  int t = x[i];
  x[i] = x[j];
  x[j] = t;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @swap(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 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
int Operand_simm8x256_decode(unsigned int *valp) {
  unsigned simm8x256_0, imm8_0;
  imm8_0 = *valp & 0xff;
  simm8x256_0 = (((int)imm8_0 << 24) >> 24) << 8;
  *valp = simm8x256_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_simm8x256_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x18,%eax
sar    $0x18,%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_simm8x256_decode>:
movsbl (%rdi),%eax
shl    $0x8,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_simm8x256_decode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = and i32 %6, 255
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = shl i32 %8, 24
%10 = ashr i32 %9, 24
%11 = shl i32 %10, 8
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = load i32*, i32** %2
store i32 %12, i32* %13
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_simm8x256_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = ashr exact i32 %3, 16
store i32 %4, i32* %0
ret i32 0
}
int __ffs(int x) {
  int cnt;
  int tmp;
  asm("bsfl %2,%0\n"
      "cmovel %1,%0\n"
      : "=&r"(cnt), "=r"(tmp)
      : "rm"(x), "1"(-1));
  return cnt + 1;
}


x86 assembly (clang, -O0):
<__ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0xffffffff,%eax
bsf    -0x10(%rbp),%ecx
cmove  %eax,%ecx
mov    %ecx,-0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__ffs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call { i32, i32 } asm "bsfl $2,$0\0Acmovel $1,$0\0A", "=&r,=r,rm,1,~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 -1)
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %3
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @__ffs(i32 %0) {
%2 = tail call { i32, i32 } asm "bsfl $2,$0\0Acmovel $1,$0\0A", "=&r,=r,rm,1,~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 -1)
%3 = extractvalue { i32, i32 } %2, 0
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int sprintf(char *, char *, char const *);
scalar_t__ strlen(char const *);
int append_string(char *buf, const char *string) {
  if (buf == NULL) {
    return (int)strlen(string);
  }
  return sprintf(buf, "%s", string);
}


x86 assembly (clang, -O0):
<append_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114c <append_string+0x2c>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x4(%rbp)
jmp    1163 <append_string+0x43>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xea5(%rip),%rsi
call   1040 <sprintf@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_string>:
push   %rbx
test   %rdi,%rdi
je     1133 <append_string+0x13>
mov    %rdi,%rbx
call   1030 <stpcpy@plt>
sub    %rbx,%rax
pop    %rbx
ret
mov    %rsi,%rdi
call   1040 <strlen@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @append_string(i8* %0, i8* nocapture %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i64 @strlen(i8* dereferenceable(1) %1)
br label %11
6: ; preds = %2
%7 = tail call i8* @stpcpy(i8* %0, i8* %1)
%8 = ptrtoint i8* %7 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
br label %11
11: ; preds = %6, %4
%12 = phi i64 [ %5, %4 ], [ %10, %6 ]
%13 = trunc i64 %12 to i32
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void bcm2835_spi_setBitOrder(uint8_t __attribute__((unused)) order) {}


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

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

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

LLVM IR (-O2):
define void @bcm2835_spi_setBitOrder(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit_program(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void check_usage(int argc, char **argv) {
  if (argc < 1) {
    fprintf(stderr,
            "Usage: log_to_file [config_file_with_ip_and_port_in_it]\n");
    exit_program(1);
  }
}


x86 assembly (clang, -O0):
<check_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    1158 <check_usage+0x38>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit_program@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_usage>:
test   %edi,%edi
jle    1125 <check_usage+0x5>
ret
push   %rax
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <exit_program@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"Usage: log_to_file [config_file_with_ip_and_port_in_it]\0A\00"
define void @check_usage(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
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit_program(i32 1)
br label %11
11: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"Usage: log_to_file [config_file_with_ip_and_port_in_it]\0A\00"
define void @check_usage(i32 %0, i8** nocapture readnone %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit_program(i32 1)
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void if_le(void) { printf("less or equal\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"less or equal\0A\00"
define void @if_le() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"less or equal\00"
define void @if_le() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
long double modfl(long double x, long double *iptr) {
  return __builtin_modfl(x, iptr);
}


x86 assembly (clang, -O0):
<modfl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    -0x18(%rbp),%rdi
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <modfl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @modfl(x86_fp80 %0, x86_fp80* %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80*
store x86_fp80 %0, x86_fp80* %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80*, x86_fp80** %4
%7 = call x86_fp80 @modfl(x86_fp80 %5, x86_fp80* %6)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @modfl(x86_fp80 %0, x86_fp80* nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
br label %3
}
void count_entries(const void *key, const void *val, void *arg) {
  (void)key;
  (void)val;
  int *count = (int *)arg;
  (*count)++;
}


x86 assembly (clang, -O0):
<count_entries>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_entries>:
addl   $0x1,(%rdx)
ret

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

LLVM IR (-O2):
define void @count_entries(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
store i32 %6, i32* %4
ret void
}
/* Variables and functions */
double ldexp(double, int);
double scalbn(double x, int n) { return ldexp(x, n); }


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

x86 assembly (clang, -O2):
<scalbn>:
jmp    1030 <ldexp@plt>

LLVM IR (-O0):
define double @scalbn(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = load i32, i32* %4
%7 = call double @ldexp(double %5, i32 %6)
ret double %7
}

LLVM IR (-O2):
define double @scalbn(double %0, i32 %1) {
%3 = tail call double @ldexp(double %0, i32 %1)
ret double %3
}