xunge/DecIR huggingface dataset:
/* Variables and functions */
char const *remote_n2();
const char *__attribute__((section(".test.b"))) call_remote_n2(void) {
  return remote_n2() + 1;
}


x86 assembly (clang, -O0):
<call_remote_n2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <remote_n2@plt>
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_remote_n2>:
push   %rax
xor    %eax,%eax
call   1030 <remote_n2@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @call_remote_n2() section ".test.b" {
%1 = call i8* (...) @remote_n2()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}

LLVM IR (-O2):
define i8* @call_remote_n2() section ".test.b" {
%1 = tail call i8* (...) @remote_n2()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void showhelp(char *mainpgm) {
  fprintf(stderr,
          "Usage: %s [-o outfile] [-c count*10 of line] [ -s start pos] [-e "
          "end pos] [infile]\n",
          mainpgm);
}


x86 assembly (clang, -O0):
<showhelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showhelp>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [84 x i8] c"Usage: %s [-o outfile] [-c count*10 of line] [ -s start pos] [-e end pos] [infile]\0A\00"
define void @showhelp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [84 x i8] c"Usage: %s [-o outfile] [-c count*10 of line] [ -s start pos] [-e end pos] [infile]\0A\00"
define void @showhelp(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void gtk_selection_data_get_pixbuf() {}


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

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

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

LLVM IR (-O2):
define void @gtk_selection_data_get_pixbuf() {
ret void
}
/* Variables and functions */
int is_inops(char c, char *ops) {
  int i;
  i = -1;
  if (!(ops == NULL)) {
    while (ops[++i] != '\0') {
      if (ops[i] == c)
        return (1);
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<is_inops>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1170 <is_inops+0x70>
jmp    1125 <is_inops+0x25>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     116b <is_inops+0x6b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1166 <is_inops+0x66>
movl   $0x1,-0x4(%rbp)
jmp    1177 <is_inops+0x77>
jmp    1125 <is_inops+0x25>
jmp    1170 <is_inops+0x70>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_inops>:
xor    %eax,%eax
test   %rsi,%rsi
je     1125 <is_inops+0x25>
nopw   0x0(%rax,%rax,1)
movzbl (%rsi),%ecx
test   %cl,%cl
je     1125 <is_inops+0x25>
add    $0x1,%rsi
cmp    %dil,%cl
jne    1110 <is_inops+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_inops(i8 signext %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %12, label %4
4: ; preds = %2, %10
%5 = phi i64 [ %6, %10 ], [ -1, %2 ]
%6 = add nsw i64 %5, 1
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = icmp eq i8 %8, %0
br i1 %11, label %12, label %4
12: ; preds = %4, %10, %2
%13 = phi i32 [ 0, %2 ], [ 0, %4 ], [ 1, %10 ]
ret i32 %13
}
/* Variables and functions */
size_t strnlen(const char *str, size_t n) {
  size_t len = 0;
  while (str[len] && len < n) {
    ++len;
  }
  return len;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     113c <strnlen+0x3c>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <strnlen+0x4c>
jmp    115d <strnlen+0x5d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,(%rdi,%rcx,1)
je     1122 <strnlen+0x22>
cmp    %rsi,%rcx
mov    %rax,%rcx
jb     1110 <strnlen+0x10>
add    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %19, %2
%7 = load i8*, i8** %3
%8 = load i64, i64* %5
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %6
%14 = load i64, i64* %5
%15 = load i64, i64* %4
%16 = icmp ult i64 %14, %15
br label %17
17: ; preds = %13, %6
%18 = phi i1 [ false, %6 ], [ %16, %13 ]
br i1 %18, label %19, label %22
19: ; preds = %17
%20 = load i64, i64* %5
%21 = add i64 %20, 1
store i64 %21, i64* %5
br label %6
22: ; preds = %17
%23 = load i64, i64* %5
ret i64 %23
}

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %10, %3 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
%8 = icmp ult i64 %4, %1
%9 = select i1 %7, i1 %8, i1 false
%10 = add nuw i64 %4, 1
br i1 %9, label %3, label %11
11: ; preds = %3
ret i64 %4
}
int test_imm_23uint8_mem(unsigned char *val) {
  return ((*val) & (-0x23 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_23uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffffdd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_23uint8_mem>:
testb  $0xdd,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_23uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -35
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler() { printf("signal handler func\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"signal handler func\00"
define void @handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void __attribute__((constructor)) meaningless_library() { exit(93); }


x86 assembly (clang, -O0):
<meaningless_library>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5d,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<meaningless_library>:
push   %rax
mov    $0x5d,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @meaningless_library, i8* null }]
define void @meaningless_library() {
%1 = call i32 @exit(i32 93)
unreachable
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @meaningless_library, i8* null }]
define void @meaningless_library() {
%1 = tail call i32 @exit(i32 93)
unreachable
}
/* Variables and functions */
size_t read(int /*<<< orphan*/, unsigned char *, int);
int /*<<< orphan*/ usleep(int);
unsigned char kb_getc_w(void) {
  unsigned char ch;
  size_t size;
  while (1) {
    usleep(20000);
    size = read(0, &ch, 1);
    if (size > 0) {
      break;
    }
  }
  return ch;
}


x86 assembly (clang, -O0):
<kb_getc_w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4e20,%edi
call   1040 <usleep@plt>
xor    %edi,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    1156 <kb_getc_w+0x36>
jmp    115b <kb_getc_w+0x3b>
jmp    1128 <kb_getc_w+0x8>
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kb_getc_w>:
push   %rbx
sub    $0x10,%rsp
lea    0xf(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    $0x4e20,%edi
call   1040 <usleep@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <read@plt>
test   %rax,%rax
je     1130 <kb_getc_w+0x10>
mov    0xf(%rsp),%al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @kb_getc_w() {
%1 = alloca i8
%2 = alloca i64
br label %3
3: ; preds = %0, %9
%4 = call i32 @usleep(i32 20000)
%5 = call i64 @read(i32 0, i8* %1, i32 1)
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = icmp ugt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %3
br label %10
9: ; preds = %3
br label %3
10: ; preds = %8
%11 = load i8, i8* %1
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @kb_getc_w() {
%1 = alloca i8
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @usleep(i32 20000)
%4 = call i64 @read(i32 0, i8* %1, i32 1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = load i8, i8* %1
ret i8 %7
}
/* Variables and functions */
unsigned int bits_popcount(unsigned int);
unsigned int bits_hamming(unsigned int x, unsigned int y) {
  return bits_popcount(x ^ y);
}


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

x86 assembly (clang, -O2):
<bits_hamming>:
xor    %esi,%edi
jmp    1030 <bits_popcount@plt>

LLVM IR (-O0):
define i32 @bits_hamming(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 = xor i32 %5, %6
%8 = call i32 @bits_popcount(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @bits_hamming(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = tail call i32 @bits_popcount(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xf8() {
  Assert_real((isdigit(248) == 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_isdigit.c",
              1245, ("isdigit should be 0 for 0xf8"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xf8>:
push   %rax
mov    $0xf8,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4dd,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xf8\00"
define void @t_isdigit_0xf8() {
%1 = call i64 @isdigit(i32 248)
%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 1245, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xf8\00"
define void @t_isdigit_0xf8() {
%1 = tail call i64 @isdigit(i32 248)
%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 1245, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutBitmapString(void *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, float);
void glutBitmapFloat(void *fontface, float i) {
  char buf[64];
  snprintf(buf, 64, "%.2f", i);
  glutBitmapString(fontface, buf);
}


x86 assembly (clang, -O0):
<glutBitmapFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
lea    -0x50(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
mov    $0x40,%esi
lea    0xeba(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1040 <glutBitmapString@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glutBitmapFloat>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
lea    0xecf(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <glutBitmapString@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%.2f\00"
define void @glutBitmapFloat(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
%5 = alloca [64 x i8]
store i8* %0, i8** %3
store float %1, float* %4
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%7 = load float, float* %4
%8 = call i32 @snprintf(i8* %6, i32 64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%11 = call i32 @glutBitmapString(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.2f\00"
define void @glutBitmapFloat(i8* %0, float %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %1)
%6 = call i32 @glutBitmapString(i8* %0, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
void c_srand(unsigned int arg0) { srand(arg0); }


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

x86 assembly (clang, -O2):
<c_srand>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @c_srand(i32 %0) {
%2 = tail call i32 @srand(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ genStd4(char);
void foo_foo() { genStd4('l'); }


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

x86 assembly (clang, -O2):
<foo_foo>:
mov    $0x6c,%edi
jmp    1030 <genStd4@plt>

LLVM IR (-O0):
define void @foo_foo() {
%1 = call i32 @genStd4(i8 signext 108)
ret void
}

LLVM IR (-O2):
define void @foo_foo() {
%1 = tail call i32 @genStd4(i8 signext 108)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Idle_1302();
void Setup_1302_Port(void) {
  unsigned char c;
  c = *(volatile unsigned char *)(0x10000000 + 0xcb);
  c = c & 0xef;
  *(volatile unsigned char *)(0x10000000 + 0xcb) = c;
  c = *(volatile unsigned char *)(0x10000000 + 0x1c5);
  c = c | (1 + 2 + 4);
  *(volatile unsigned char *)(0x10000000 + 0x1c5) = c;
  Idle_1302();
  return;
}


x86 assembly (clang, -O0):
<Setup_1302_Port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x100000cb,%eax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xef,%eax
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
mov    $0x100000cb,%eax
mov    %cl,(%rax)
mov    $0x100001c5,%eax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
or     $0x7,%eax
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
mov    $0x100001c5,%eax
mov    %cl,(%rax)
mov    $0x0,%al
call   1030 <Idle_1302@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Setup_1302_Port>:
andb   $0xef,0x100000cb
ef
orb    $0x7,0x100001c5
07
xor    %eax,%eax
jmp    1030 <Idle_1302@plt>

LLVM IR (-O0):
define void @Setup_1302_Port() {
%1 = alloca i8
%2 = load volatile i8, i8* inttoptr (i64 268435659 to i8*)
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = and i32 %4, 239
%6 = trunc i32 %5 to i8
store i8 %6, i8* %1
%7 = load i8, i8* %1
store volatile i8 %7, i8* inttoptr (i64 268435659 to i8*)
%8 = load volatile i8, i8* inttoptr (i64 268435909 to i8*)
store i8 %8, i8* %1
%9 = load i8, i8* %1
%10 = zext i8 %9 to i32
%11 = or i32 %10, 7
%12 = trunc i32 %11 to i8
store i8 %12, i8* %1
%13 = load i8, i8* %1
store volatile i8 %13, i8* inttoptr (i64 268435909 to i8*)
%14 = call i32 (...) @Idle_1302()
ret void
}

LLVM IR (-O2):
define void @Setup_1302_Port() {
%1 = load volatile i8, i8* inttoptr (i64 268435659 to i8*)
%2 = and i8 %1, -17
store volatile i8 %2, i8* inttoptr (i64 268435659 to i8*)
%3 = load volatile i8, i8* inttoptr (i64 268435909 to i8*)
%4 = or i8 %3, 7
store volatile i8 %4, i8* inttoptr (i64 268435909 to i8*)
%5 = tail call i32 (...) @Idle_1302()
ret void
}
/* Variables and functions */
scalar_t__ is_utf8_part(char);
scalar_t__ is_whitespace(char);
int is_printable_char(char c) {
  if (c > 32 || is_utf8_part(c) || is_whitespace(c))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_printable_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jg     1161 <is_printable_char+0x41>
movsbl -0x5(%rbp),%edi
call   1040 <is_utf8_part@plt>
cmp    $0x0,%rax
jne    1161 <is_printable_char+0x41>
movsbl -0x5(%rbp),%edi
call   1030 <is_whitespace@plt>
cmp    $0x0,%rax
je     116d <is_printable_char+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1174 <is_printable_char+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_printable_char>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebx
cmp    $0x20,%dil
jg     114d <is_printable_char+0x2d>
movsbl %dil,%ebp
mov    %ebp,%edi
call   1040 <is_utf8_part@plt>
test   %rax,%rax
jne    114d <is_printable_char+0x2d>
mov    %ebp,%edi
call   1030 <is_whitespace@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_printable_char(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sgt i32 %5, 32
br i1 %6, label %15, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = call i64 @is_utf8_part(i8 signext %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = call i64 @is_whitespace(i8 signext %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11, %7, %1
store i32 1, i32* %2
br label %17
16: ; preds = %11
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_printable_char(i8 signext %0) {
%2 = icmp sgt i8 %0, 32
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @is_utf8_part(i8 signext %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 @is_whitespace(i8 signext %0)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %1, %3
%11 = phi i32 [ 1, %3 ], [ 1, %1 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
double exp2(double);
double __wrap_exp2(double x) { return exp2(x); }


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

x86 assembly (clang, -O2):
<__wrap_exp2>:
jmp    1030 <exp2@plt>

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

LLVM IR (-O2):
define double @__wrap_exp2(double %0) {
%2 = tail call double @exp2(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x08() {
  Assert_real((isdigit(8) == 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_isdigit.c",
              45, ("isdigit should be 0 for 0x08"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x08>:
push   %rax
mov    $0x8,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2d,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x08\00"
define void @t_isdigit_0x08() {
%1 = call i64 @isdigit(i32 8)
%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 45, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x08\00"
define void @t_isdigit_0x08() {
%1 = tail call i64 @isdigit(i32 8)
%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 45, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t strlen(char const *);
int /*<<< orphan*/ terminal_putchar(char const);
void terminal_writestring(const char *data) {
  size_t datalen = strlen(data);
  size_t i = 0;
  while (i < datalen) {
    terminal_putchar(data[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<terminal_writestring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1171 <terminal_writestring+0x51>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <terminal_putchar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1141 <terminal_writestring+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminal_writestring>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %rax,%rax
je     1153 <terminal_writestring+0x33>
mov    %rax,%r15
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1040 <terminal_putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <terminal_writestring+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @terminal_writestring(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
store i64 0, i64* %4
br label %7
7: ; preds = %11, %1
%8 = load i64, i64* %4
%9 = load i64, i64* %3
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %19
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = load i64, i64* %4
%14 = getelementptr inbounds i8, i8* %12, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @terminal_putchar(i8 signext %15)
%17 = load i64, i64* %4
%18 = add i64 %17, 1
store i64 %18, i64* %4
br label %7
19: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @terminal_writestring(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i32 @terminal_putchar(i8 signext %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %2
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printdir(char *, int /*<<< orphan*/);
int main(void) {
  printdir("..", 0);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"..\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printdir(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"..\00"
define i32 @main() {
%1 = tail call i32 @printdir(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
void myFunc(void) {
  char name[30];
  printf("Enter your name:\n");
  scanf("%s", name);
  printf("Hello %s \n", name);
  return;
}


x86 assembly (clang, -O0):
<myFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x20(%rbp),%rsi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myFunc>:
push   %rbx
sub    $0x20,%rsp
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter your name:\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [11 x i8] c"Hello %s \0A\00"
define void @myFunc() {
%1 = alloca [30 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [11 x i8] c"Hello %s \0A\00"
@str = [17 x i8] c"Enter your name:\00"
define void @myFunc() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void usage(int argc, char **argv) {
  if (argc != 3) {
    printf("Usage: %s <IP> <PORT>\n", argv[0]);
    exit(0);
  }
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
je     1153 <usage+0x33>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
cmp    $0x3,%edi
jne    1126 <usage+0x6>
ret
push   %rax
mov    (%rsi),%rsi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Usage: %s <IP> <PORT>\0A\00"
define void @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 ne i32 %5, 3
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Usage: %s <IP> <PORT>\0A\00"
define void @usage(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_PUNPCKHBW(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x60);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x70);
  addbyte(0xc0 | (dst_reg << 3) | dst_reg);
  addbyte(0x0e);
}


x86 assembly (clang, -O0):
<MMX_PUNPCKHBW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x60,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x8(%rbp),%edi
call   1030 <addbyte@plt>
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x70,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x4(%rbp),%edi
call   1030 <addbyte@plt>
mov    $0xe,%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_PUNPCKHBW>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %edi,%r14d
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x60,%edi
call   1030 <addbyte@plt>
mov    %r14d,%ebx
or     $0x18,%ebx
shl    $0x3,%ebx
or     %ebx,%ebp
mov    %ebp,%edi
call   1030 <addbyte@plt>
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x70,%edi
call   1030 <addbyte@plt>
or     %r14d,%ebx
mov    %ebx,%edi
call   1030 <addbyte@plt>
mov    $0xe,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_PUNPCKHBW(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 96)
%8 = load i32, i32* %3
%9 = shl i32 %8, 3
%10 = or i32 192, %9
%11 = load i32, i32* %4
%12 = or i32 %10, %11
%13 = call i32 @addbyte(i32 %12)
%14 = call i32 @addbyte(i32 102)
%15 = call i32 @addbyte(i32 15)
%16 = call i32 @addbyte(i32 112)
%17 = load i32, i32* %3
%18 = shl i32 %17, 3
%19 = or i32 192, %18
%20 = load i32, i32* %3
%21 = or i32 %19, %20
%22 = call i32 @addbyte(i32 %21)
%23 = call i32 @addbyte(i32 14)
ret void
}

LLVM IR (-O2):
define void @MMX_PUNPCKHBW(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 96)
%6 = shl i32 %0, 3
%7 = or i32 %6, 192
%8 = or i32 %7, %1
%9 = tail call i32 @addbyte(i32 %8)
%10 = tail call i32 @addbyte(i32 102)
%11 = tail call i32 @addbyte(i32 15)
%12 = tail call i32 @addbyte(i32 112)
%13 = or i32 %7, %0
%14 = tail call i32 @addbyte(i32 %13)
%15 = tail call i32 @addbyte(i32 14)
ret void
}
char toHexDigit(int digit) {
  if (digit < 10)
    return (char)('0' + digit);
  return (char)('A' + digit - 10);
}


x86 assembly (clang, -O0):
<toHexDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    111f <toHexDigit+0x1f>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    112b <toHexDigit+0x2b>
mov    -0x8(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toHexDigit>:
cmp    $0xa,%edi
mov    $0x30,%ecx
mov    $0x37,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @toHexDigit(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 48, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %2
br label %15
10: ; preds = %1
%11 = load i32, i32* %3
%12 = add nsw i32 65, %11
%13 = sub nsw i32 %12, 10
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %10, %6
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @toHexDigit(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 55
%5 = add i8 %4, %3
ret i8 %5
}
/* Type definitions */
typedef scalar_t__ ulong;

/* Variables and functions */
int rand();
void make_random(ulong *data, ulong N) {
  for (; N > 0; --N, ++data)
    *data = rand() | (rand() << 16);
}


x86 assembly (clang, -O0):
<make_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    116d <make_random+0x5d>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
shl    $0x10,%ecx
or     %ecx,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <make_random+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_random>:
push   %rbp
push   %r14
push   %rbx
test   %rsi,%rsi
jle    1158 <make_random+0x48>
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
shl    $0x10,%eax
or     %ebp,%eax
cltq
mov    %rax,(%rbx)
add    $0x8,%rbx
add    $0xffffffffffffffff,%r14
cmp    $0x1,%r14
ja     1130 <make_random+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @make_random(i64* nocapture writeonly %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2, %4
%5 = phi i64 [ %12, %4 ], [ %1, %2 ]
%6 = phi i64* [ %13, %4 ], [ %0, %2 ]
%7 = tail call i32 (...) @rand()
%8 = tail call i32 (...) @rand()
%9 = shl i32 %8, 16
%10 = or i32 %9, %7
%11 = sext i32 %10 to i64
store i64 %11, i64* %6
%12 = add nsw i64 %5, -1
%13 = getelementptr inbounds i64, i64* %6, i64 1
%14 = icmp ugt i64 %5, 1
br i1 %14, label %4, label %15
15: ; preds = %4, %2
ret void
}
/* Variables and functions */
double choose_float(bool cond, double a, double b) { return cond ? a : b; }


x86 assembly (clang, -O0):
<choose_float>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112a <choose_float+0x2a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1134 <choose_float+0x34>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<choose_float>:
test   %edi,%edi
je     1107 <choose_float+0x7>
movaps %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @choose_float(i32 %0, double %1, double %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, double %2, double %1
ret double %5
}
double fonction1(double arg) { return arg * arg; }


x86 assembly (clang, -O0):
<fonction1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fonction1>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @fonction1(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
scalar_t__ wblong(int, unsigned long);
int write(int, char *, int);
int smf_track_head(int fd, unsigned long size) {
  int num;
  num = write(fd, "MTrk", 4);
  num += wblong(fd, size);
  return num;
}


x86 assembly (clang, -O0):
<smf_track_head>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    0xec7(%rip),%rsi
mov    $0x4,%edx
call   1040 <write@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <wblong@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smf_track_head>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
lea    0xed0(%rip),%rsi
mov    $0x4,%edx
call   1040 <write@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %r14,%rsi
call   1030 <wblong@plt>
add    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"MTrk\00"
define i32 @smf_track_head(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* %3
%7 = call i32 @write(i32 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i64, i64* %4
%10 = call i64 @wblong(i32 %8, i64 %9)
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = add nsw i64 %12, %10
%14 = trunc i64 %13 to i32
store i32 %14, i32* %5
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
@.str = [5 x i8] c"MTrk\00"
define i32 @smf_track_head(i32 %0, i64 %1) {
%3 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = tail call i64 @wblong(i32 %0, i64 %1)
%5 = trunc i64 %4 to i32
%6 = add i32 %3, %5
ret i32 %6
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t comp(const void *p, const void *q) {
  int x = *(const int *)p;
  int y = *(const int *)q;
  if (x < y)
    return -1;
  else if (x < y)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <comp+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <comp+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    114e <comp+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <comp+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setl   %al
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = sext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_mulhi_pu16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test22(__m64 a, __m64 b) { return _mm_mulhi_pu16(a, b); }


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

x86 assembly (clang, -O2):
<test22>:
jmp    1030 <_mm_mulhi_pu16@plt>

LLVM IR (-O0):
define i32 @test22(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 @_mm_mulhi_pu16(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test22(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_mulhi_pu16(i32 %0, i32 %1)
ret i32 %3
}
void foo(int x, int y) {
bad1:
#pragma omp target data map(tofrom : y)
  goto bad1;
  goto bad2;
#pragma omp target data map(tofrom : y)
  {
  bad2:;
  }
#pragma omp target data map(tofrom : y)
  {
    int i;
    goto ok1;
    for (i = 0; i < 10; ++i) {
    ok1:
      break;
    }
  }
  switch (x) {
#pragma omp target data map(tofrom : y)
    { case 0:; }
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
jmp    110a <foo+0xa>

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

LLVM IR (-O0):
define void @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %6
6: ; preds = %6, %2
br label %6
7: ; No predecessors!
br label %13
8: ; No predecessors!
store i32 0, i32* %5
br label %9
9: ; preds = %14, %8
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %17
12: ; preds = %9
br label %13
13: ; preds = %12, %7
br label %17
14: ; No predecessors!
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %9
17: ; preds = %13, %9
%18 = load i32, i32* %3
switch i32 %18, label %20 [
i32 0, label %19
]
19: ; preds = %17
br label %20
20: ; preds = %19, %17
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
br label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;

/* Variables and functions */
int /*<<< orphan*/ glRasterPos2fv(int /*<<< orphan*/ *);
void RasterPos2fv(GLfloat v[2]) { glRasterPos2fv(v); }


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

x86 assembly (clang, -O2):
<RasterPos2fv>:
jmp    1030 <glRasterPos2fv@plt>

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

LLVM IR (-O2):
define void @RasterPos2fv(i32* %0) {
%2 = tail call i32 @glRasterPos2fv(i32* %0)
ret void
}