xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int main() {
  for (int i = 0; i < 100000000; i++) {
    fprintf(stderr, "foo %d\n", i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5f5e100,-0x8(%rbp)
jge    1159 <main+0x49>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %ebx,%ebx
mov    0x2ec2(%rip),%r15
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15),%edi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
add    $0x1,%ebx
cmp    $0x5f5e100,%ebx
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"foo %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 100000000
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = load i32, i32* %2
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"foo %d\0A\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %6, %2 ]
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 100000000
br i1 %7, label %1, label %2
}
_Noreturn int f4(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @f4() {
ret i32 1
}

LLVM IR (-O2):
define i32 @f4() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void _delay(int t) { sleep(t); }


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

x86 assembly (clang, -O2):
<_delay>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define void @_delay(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}
sm(ps) char *ps;
{ brcstr(ps, 'h'); }


x86 assembly (clang, -O0):
<sm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x68,%esi
mov    $0x0,%al
call   1030 <brcstr@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sm>:
mov    $0x68,%esi
xor    %eax,%eax
jmp    1030 <brcstr@plt>

LLVM IR (-O0):
define i32 @sm(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @brcstr to i32 (i8*, i32, ...)*)(i8* %4, i32 104)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @sm(i8* %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @brcstr to i32 (i8*, i32, ...)*)(i8* %0, i32 104)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("Number of files in the given directory is: %d\n", (argc - 1));
  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    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [47 x i8] c"Number of files in the given directory is: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"Number of files in the given directory is: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = add nsw i32 %0, -1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int mkstemp(char *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int xmkstemp(char *template) {
  int fd;
  fd = mkstemp(template);
  if (fd < 0)
    die("Unable to create temporary file: %s", strerror(errno));
  return fd;
}


x86 assembly (clang, -O0):
<xmkstemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mkstemp@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    116e <xmkstemp+0x3e>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%esi
lea    0xe97(%rip),%rdi
call   1040 <die@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmkstemp>:
push   %rbx
call   1030 <mkstemp@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1158 <xmkstemp+0x28>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
call   1040 <die@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Unable to create temporary file: %s\00"
@errno = global i32 0
define i32 @xmkstemp(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @mkstemp(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @errno
%10 = call i32 @strerror(i32 %9)
%11 = call i32 @die(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [36 x i8] c"Unable to create temporary file: %s\00"
@errno = global i32 0
define i32 @xmkstemp(i8* %0) {
%2 = tail call i32 @mkstemp(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @die(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int z;
  int s = 0, c = 0;
  scanf("%d", &z);
  s = z * z;
  c = z * z * z;
  printf("\n%d", s);
  printf("\n%d", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xebd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
imul   %ebx,%esi
imul   %esi,%ebx
lea    0xeb8(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int f257(int *);
int f258(int *p) { return f257(p); }


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

x86 assembly (clang, -O2):
<f258>:
jmp    1030 <f257@plt>

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

LLVM IR (-O2):
define i32 @f258(i32* %0) {
%2 = tail call i32 @f257(i32* %0)
ret i32 %2
}
void shell_sort(int count, int **in) {}


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

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

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

LLVM IR (-O2):
define void @shell_sort(i32 %0, i32** nocapture %1) {
ret void
}
void class_device_put(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<class_device_put>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<class_device_put>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.class_device_put = [17 x i8] c"class_device_put\00"
define void @class_device_put() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.class_device_put, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.class_device_put = [17 x i8] c"class_device_put\00"
define void @class_device_put() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.class_device_put, i64 0, i64 0))
ret void
}
unsigned int bitgraph_empty(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @bitgraph_empty() {
ret i32 0
}
char *astrcpy(char *s, char *ct) {
  char *out = s;
  while ((*s++ = *ct++))
    ;
  return out;
}


x86 assembly (clang, -O0):
<astrcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <astrcpy+0x43>
jmp    1114 <astrcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<astrcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <astrcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @astrcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
void WAKUP_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @WAKUP_IRQHandler() {
ret void
}
const char *Parrot_dlerror(void) { return 0; }


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

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

LLVM IR (-O0):
define i8* @Parrot_dlerror() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @Parrot_dlerror() {
ret i8* null
}
/* Type definitions */
struct backlight {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ backlight_notify_state_change(struct backlight *);
int backlight_set_percentage_no_notify(struct backlight *, unsigned int);
int /*<<< orphan*/ update_screen_blanking(struct backlight *);
int backlight_set_percentage(struct backlight *b, unsigned int percent) {
  int err;
  err = backlight_set_percentage_no_notify(b, percent);
  if (!err) {
    backlight_notify_state_change(b);
    update_screen_blanking(b);
  }
  return err;
}


x86 assembly (clang, -O0):
<backlight_set_percentage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <backlight_set_percentage_no_notify@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    116a <backlight_set_percentage+0x3a>
mov    -0x8(%rbp),%rdi
call   1040 <backlight_notify_state_change@plt>
mov    -0x8(%rbp),%rdi
call   1050 <update_screen_blanking@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backlight_set_percentage>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <backlight_set_percentage_no_notify@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1151 <backlight_set_percentage+0x21>
mov    %rbx,%rdi
call   1040 <backlight_notify_state_change@plt>
mov    %rbx,%rdi
call   1050 <update_screen_blanking@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.backlight = type { i32 }
define i32 @backlight_set_percentage(%struct.backlight* %0, i32 %1) {
%3 = alloca %struct.backlight*
%4 = alloca i32
%5 = alloca i32
store %struct.backlight* %0, %struct.backlight** %3
store i32 %1, i32* %4
%6 = load %struct.backlight*, %struct.backlight** %3
%7 = load i32, i32* %4
%8 = call i32 @backlight_set_percentage_no_notify(%struct.backlight* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = load %struct.backlight*, %struct.backlight** %3
%13 = call i32 @backlight_notify_state_change(%struct.backlight* %12)
%14 = load %struct.backlight*, %struct.backlight** %3
%15 = call i32 @update_screen_blanking(%struct.backlight* %14)
br label %16
16: ; preds = %11, %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
%struct.backlight = type { i32 }
define i32 @backlight_set_percentage(%struct.backlight* %0, i32 %1) {
%3 = tail call i32 @backlight_set_percentage_no_notify(%struct.backlight* %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @backlight_notify_state_change(%struct.backlight* %0)
%7 = tail call i32 @update_screen_blanking(%struct.backlight* %0)
br label %8
8: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
char *memcpy(char *, char const *, scalar_t__);
scalar_t__ strlen(char const *);
char *strcpy(char *dest, const char *src) {
  return memcpy(dest, src, strlen(src) + 1);
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define i8* @strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i8* @memcpy(i8* %5, i8* %6, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %4, i1 false)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
void notmain(int i) {
  f(3);
  f(4);
}


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

x86 assembly (clang, -O2):
<notmain>:
push   %rax
mov    $0x3,%edi
call   1030 <f@plt>
mov    $0x4,%edi
pop    %rax
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define void @notmain(i32 %0) {
%2 = tail call i32 @f(i32 3)
%3 = tail call i32 @f(i32 4)
ret void
}
void Vector_Add(float vectorOut[3], float vectorIn1[3], float vectorIn2[3]) {
  for (int c = 0; c < 3; c++) {
    vectorOut[c] = vectorIn1[c] + vectorIn2[c];
  }
}


x86 assembly (clang, -O0):
<Vector_Add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    1156 <Vector_Add+0x56>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
addss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <Vector_Add+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vector_Add>:
movss  (%rsi),%xmm0
addss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
addss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
addss  0x8(%rdx),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @Vector_Add(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
%7 = alloca i32
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
store i32 0, i32* %7
br label %8
8: ; preds = %27, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 3
br i1 %10, label %11, label %30
11: ; preds = %8
%12 = load float*, float** %5
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds float, float* %12, i64 %14
%16 = load float, float* %15
%17 = load float*, float** %6
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds float, float* %17, i64 %19
%21 = load float, float* %20
%22 = fadd float %16, %21
%23 = load float*, float** %4
%24 = load i32, i32* %7
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds float, float* %23, i64 %25
store float %22, float* %26
br label %27
27: ; preds = %11
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
br label %8
30: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @Vector_Add(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fadd float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %2, i64 2
%16 = load float, float* %15
%17 = fadd float %14, %16
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
ret void
}
int bitParity(int a) {}


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

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

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

LLVM IR (-O2):
define i32 @bitParity(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("No FIPS DRBG support\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"No FIPS DRBG support\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"No FIPS DRBG support\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ createArray(int);
int main() {
  createArray(20);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
call   1030 <createArray@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @createArray(i32 20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @createArray(i32 20)
ret i32 0
}
int poll_slave_modbus() {}


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

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

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

LLVM IR (-O2):
define i32 @poll_slave_modbus() {
ret i32 undef
}
unsigned long insert_bdm(insn, value, errmsg)
unsigned long insn;
long value;
const char **errmsg;
{
  if ((value & 0x8000) != 0)
    insn |= 1 << 21;
  return insn | (value & 0xfffc);
}


x86 assembly (clang, -O0):
<insert_bdm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0x8000,%rax
cmp    $0x0,%rax
je     1132 <insert_bdm+0x32>
mov    -0x8(%rbp),%rax
or     $0x200000,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
and    $0xfffc,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_bdm>:
mov    %esi,%eax
shl    $0x6,%eax
and    $0x200000,%eax
and    $0xfffc,%esi
or     %rdi,%rsi
or     %rsi,%rax
ret

LLVM IR (-O0):
define i64 @insert_bdm(i64 %0, i64 %1, i8** %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8**
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8** %2, i8*** %6
%7 = load i64, i64* %5
%8 = and i64 %7, 32768
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i64, i64* %4
%12 = or i64 %11, 2097152
store i64 %12, i64* %4
br label %13
13: ; preds = %10, %3
%14 = load i64, i64* %4
%15 = load i64, i64* %5
%16 = and i64 %15, 65532
%17 = or i64 %14, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @insert_bdm(i64 %0, i64 %1, i8** nocapture readnone %2) {
%4 = shl i64 %1, 6
%5 = and i64 %4, 2097152
%6 = and i64 %1, 65532
%7 = or i64 %6, %0
%8 = or i64 %7, %5
ret i64 %8
}
int test_imm_D9uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xD9 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D9uint64_midword_reg>:
test   $0xd90000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D9uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 217
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_D9uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 14221312
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void foo761(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo761(i32 %0) {
ret void
}
void ata_acpi_on_disable(struct ata_device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.ata_device = type opaque
define void @ata_acpi_on_disable(%struct.ata_device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *, char *, char *);
int /*<<< orphan*/ fail(char *);
int /*<<< orphan*/ match(char);
scalar_t__ strlen(char *);
void doBreak(char *exitLabel) {
  match('b');
  if (NULL == exitLabel || 0 == strlen(exitLabel))
    fail("No loop to break from");
  else
    emitln("JMP\t%s\t#BREAK to %s", exitLabel, exitLabel);
}


x86 assembly (clang, -O0):
<doBreak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x62,%edi
call   1060 <match@plt>
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1179 <doBreak+0x39>
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    118a <doBreak+0x4a>
lea    0xe80(%rip),%rdi
call   1040 <fail@plt>
jmp    119e <doBreak+0x5e>
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xe7d(%rip),%rdi
call   1030 <emitln@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doBreak>:
push   %rbx
mov    %rdi,%rbx
mov    $0x62,%edi
call   1050 <match@plt>
test   %rbx,%rbx
je     115b <doBreak+0x2b>
cmpb   $0x0,(%rbx)
je     115b <doBreak+0x2b>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <emitln@plt>
lea    0xe9e(%rip),%rdi
pop    %rbx
jmp    1040 <fail@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"No loop to break from\00"
@.str.1 = [20 x i8] c"JMP\09%s\09#BREAK to %s\00"
define void @doBreak(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @match(i8 signext 98)
%4 = load i8*, i8** %2
%5 = icmp eq i8* null, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
%9 = icmp eq i64 0, %8
br i1 %9, label %10, label %12
10: ; preds = %6, %1
%11 = call i32 @fail(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %16
12: ; preds = %6
%13 = load i8*, i8** %2
%14 = load i8*, i8** %2
%15 = call i32 @emitln(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %13, i8* %14)
br label %16
16: ; preds = %12, %10
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"No loop to break from\00"
@.str.1 = [20 x i8] c"JMP\09%s\09#BREAK to %s\00"
define void @doBreak(i8* %0) {
%2 = tail call i32 @match(i8 signext 98)
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4, %1
%8 = tail call i32 @fail(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %4
%10 = tail call i32 @emitln(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %0)
br label %11
11: ; preds = %9, %7
ret void
}
unsigned char *_PreparePacket(unsigned char *pPacket) { return pPacket + 4; }


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

x86 assembly (clang, -O2):
<_PreparePacket>:
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @_PreparePacket(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 4
ret i8* %4
}

LLVM IR (-O2):
define i8* @_PreparePacket(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %2
}
unsigned short e86_get_mem_uint16(void *mem, unsigned long addr) {
  return (0xaaaa);
}


x86 assembly (clang, -O0):
<e86_get_mem_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xaaaa,%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<e86_get_mem_uint16>:
mov    $0xaaaa,%ax
ret

LLVM IR (-O0):
define zeroext i16 @e86_get_mem_uint16(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret i16 -21846
}

LLVM IR (-O2):
define zeroext i16 @e86_get_mem_uint16(i8* nocapture readnone %0, i64 %1) {
ret i16 -21846
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
char *strdup(char *);
char *savestring(char *s) {
  char *cp;
  cp = strdup(s);
  if (cp == NULL) {
    fprintf(stderr, "savestring: out of virtual memory\n");
    exit(2);
  }
  return (cp);
}


x86 assembly (clang, -O0):
<savestring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <savestring+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<savestring>:
push   %rax
call   1050 <strdup@plt>
test   %rax,%rax
je     113d <savestring+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"savestring: out of virtual memory\0A\00"
define i8* @savestring(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 2)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"savestring: out of virtual memory\0A\00"
define noalias i8* @savestring(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 2)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
unsigned long htonl(unsigned long);
unsigned long ntohl(unsigned long netlong) { return htonl(netlong); }


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

x86 assembly (clang, -O2):
<ntohl>:
jmp    1030 <htonl@plt>

LLVM IR (-O0):
define i64 @ntohl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @htonl(i64 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @ntohl(i64 %0) {
%2 = tail call i64 @htonl(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ unpack_v0();
int /*<<< orphan*/ unpack_v1();
int /*<<< orphan*/ unpack_v2();
int main() {
  unpack_v0();
  unpack_v1();
  unpack_v2();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <unpack_v0@plt>
mov    $0x0,%al
call   1030 <unpack_v1@plt>
mov    $0x0,%al
call   1050 <unpack_v2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @unpack_v0()
%3 = call i32 (...) @unpack_v1()
%4 = call i32 (...) @unpack_v2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @unpack_v0()
%2 = tail call i32 (...) @unpack_v1()
%3 = tail call i32 (...) @unpack_v2()
ret i32 0
}
/* Variables and functions */
int f147(int *);
int f148(int *p) { return f147(p); }


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

x86 assembly (clang, -O2):
<f148>:
jmp    1030 <f147@plt>

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

LLVM IR (-O2):
define i32 @f148(i32* %0) {
%2 = tail call i32 @f147(i32* %0)
ret i32 %2
}
/* Variables and functions */
size_t ls_pos(unsigned long int hash, size_t set_size) {
  return hash % set_size;
}


x86 assembly (clang, -O0):
<ls_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_pos>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1118 <ls_pos+0x18>
xor    %edx,%edx
div    %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i64 @ls_pos(i64 %0, i64 %1) {
%3 = urem i64 %0, %1
ret i64 %3
}
void write_log_file(int status, const char *msg) { char log_buf[1024]; }


x86 assembly (clang, -O0):
<write_log_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x390,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
add    $0x390,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @write_log_file(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [1024 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @write_log_file(i32 %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
struct craft {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct craft *);
int craft_free(struct craft *self) {
  free(self);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.craft = type { i32 }
define i32 @craft_free(%struct.craft* %0) {
%2 = alloca %struct.craft*
store %struct.craft* %0, %struct.craft** %2
%3 = load %struct.craft*, %struct.craft** %2
%4 = call i32 @free(%struct.craft* %3)
ret i32 0
}

LLVM IR (-O2):
%struct.craft = type { i32 }
define i32 @craft_free(%struct.craft* nocapture %0) {
%2 = tail call i32 @free(%struct.craft* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ parallel_clr_dav(int);
int /*<<< orphan*/ parallel_set_dav(int);
void parallel_emu_set_dav(unsigned char val) {
  if (val) {
    parallel_set_dav(0x01);
  } else {
    parallel_clr_dav(~0x01);
  }
}


x86 assembly (clang, -O0):
<parallel_emu_set_dav>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1147 <parallel_emu_set_dav+0x27>
mov    $0x1,%edi
call   1040 <parallel_set_dav@plt>
jmp    1151 <parallel_emu_set_dav+0x31>
mov    $0xfffffffe,%edi
call   1030 <parallel_clr_dav@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parallel_emu_set_dav>:
test   %edi,%edi
je     112e <parallel_emu_set_dav+0xe>
mov    $0x1,%edi
jmp    1040 <parallel_set_dav@plt>
mov    $0xfffffffe,%edi
jmp    1030 <parallel_clr_dav@plt>

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

LLVM IR (-O2):
define void @parallel_emu_set_dav(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @parallel_set_dav(i32 1)
br label %7
5: ; preds = %1
%6 = tail call i32 @parallel_clr_dav(i32 -2)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xb3() {
  Assert_real((isodigit(179) == 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_isodigit.c",
              900, ("isodigit should be 0 for 0xb3"));
}


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

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

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xb3\00"
define void @t_isodigit_0xb3() {
%1 = call i64 @isodigit(i32 179)
%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 900, 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xb3\00"
define void @t_isodigit_0xb3() {
%1 = tail call i64 @isodigit(i32 179)
%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 900, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void output_int(FILE *output_file, int i) {
  fputc((i >> 24) & 0xff, output_file);
  fputc((i >> 16) & 0xff, output_file);
  fputc((i >> 8) & 0xff, output_file);
  fputc(i & 0xff, output_file);
}


x86 assembly (clang, -O0):
<output_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
sar    $0x18,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%edi
sar    $0x10,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_int>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%eax
shr    $0x18,%eax
mov    %eax,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
movzbl %bh,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
movzbl %bl,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @output_int(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 = ashr i32 %5, 24
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = call i32 @fputc(i32 %7, i32* %8)
%10 = load i32, i32* %4
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = load i32*, i32** %3
%14 = call i32 @fputc(i32 %12, i32* %13)
%15 = load i32, i32* %4
%16 = ashr i32 %15, 8
%17 = and i32 %16, 255
%18 = load i32*, i32** %3
%19 = call i32 @fputc(i32 %17, i32* %18)
%20 = load i32, i32* %4
%21 = and i32 %20, 255
%22 = load i32*, i32** %3
%23 = call i32 @fputc(i32 %21, i32* %22)
ret void
}

LLVM IR (-O2):
define void @output_int(i32* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = tail call i32 @fputc(i32 %3, i32* %0)
%5 = lshr i32 %1, 16
%6 = and i32 %5, 255
%7 = tail call i32 @fputc(i32 %6, i32* %0)
%8 = lshr i32 %1, 8
%9 = and i32 %8, 255
%10 = tail call i32 @fputc(i32 %9, i32* %0)
%11 = and i32 %1, 255
%12 = tail call i32 @fputc(i32 %11, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "usage: comcontrol <filename> [dtrwait <n>] [drainwait <n>]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [60 x i8] c"usage: comcontrol <filename> [dtrwait <n>] [drainwait <n>]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [60 x i8] c"usage: comcontrol <filename> [dtrwait <n>] [drainwait <n>]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void RTHandleTableCreate(void) {}


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

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

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

LLVM IR (-O2):
define void @RTHandleTableCreate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xa1() {
  Assert_real((isbdigit(161) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              810, ("isbdigit should be 0 for 0xa1"));
}


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

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

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xa1\00"
define void @t_isbdigit_0xa1() {
%1 = call i64 @isbdigit(i32 161)
%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 810, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xa1\00"
define void @t_isbdigit_0xa1() {
%1 = tail call i64 @isbdigit(i32 161)
%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 810, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void logger_platform_trace(const char *text) {}


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

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

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

LLVM IR (-O2):
define void @logger_platform_trace(i8* nocapture %0) {
ret void
}