xunge/DecIR huggingface dataset:
void CMovableModelEntity_OnInitClass(void) {}


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

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

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

LLVM IR (-O2):
define void @CMovableModelEntity_OnInitClass() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("hello world\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 = [13 x i8] c"hello world\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 ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/
UpnpResponse_MediaRenderer_ConnectionManager_GetProtocolInfo(void *, char *,
                                                             char *);
void UpnpMediaRenderer_ConnectionManager_GetProtocolInfo(void *upnptoken) {
  ;
  UpnpResponse_MediaRenderer_ConnectionManager_GetProtocolInfo(
      upnptoken, "",
      "http-get:*:audio/mpegurl:*,http-get:*:video/mpegurl:*,http-get:*:audio/"
      "mp3:*,http-get:*:audio/mpeg:*,http-get:*:audio/"
      "x-ms-wma:*,http-get:*:audio/wma:*,http-get:*:audio/"
      "mpeg3:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/mpeg:*");
}


x86 assembly (clang, -O0):
<UpnpMediaRenderer_ConnectionManager_GetProtocolInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xfbd(%rip),%rsi
lea    0xed2(%rip),%rdx
call   1030 <UpnpResponse_MediaRenderer_ConnectionManager_GetProtocolInfo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpMediaRenderer_ConnectionManager_GetProtocolInfo>:
lea    0xfcd(%rip),%rsi
lea    0xee2(%rip),%rdx
jmp    1030 <UpnpResponse_MediaRenderer_ConnectionManager_GetProtocolInfo@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [229 x i8] c"http-get:*:audio/mpegurl:*,http-get:*:video/mpegurl:*,http-get:*:audio/mp3:*,http-get:*:audio/mpeg:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wma:*,http-get:*:audio/mpeg3:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/mpeg:*\00"
define void @UpnpMediaRenderer_ConnectionManager_GetProtocolInfo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @UpnpResponse_MediaRenderer_ConnectionManager_GetProtocolInfo(i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([229 x i8], [229 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [229 x i8] c"http-get:*:audio/mpegurl:*,http-get:*:video/mpegurl:*,http-get:*:audio/mp3:*,http-get:*:audio/mpeg:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wma:*,http-get:*:audio/mpeg3:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/mpeg:*\00"
define void @UpnpMediaRenderer_ConnectionManager_GetProtocolInfo(i8* %0) {
%2 = tail call i32 @UpnpResponse_MediaRenderer_ConnectionManager_GetProtocolInfo(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([229 x i8], [229 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doLog(char *, char *, int, char *);
void Logging__error(char *fileName, int lineNo, char *msg) {
  doLog("ERROR", fileName, lineNo, msg);
}


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

x86 assembly (clang, -O2):
<Logging__error>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <doLog@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"ERROR\00"
define void @Logging__error(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @doLog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ decode_html_entities_utf8(char *, int /*<<< orphan*/ *);
size_t run_html_decode_on_strings(char **strings) {
  size_t count = 0;
  while (strings[count] != NULL) {
    decode_html_entities_utf8(strings[count], NULL);
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<run_html_decode_on_strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     115d <run_html_decode_on_strings+0x4d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <decode_html_entities_utf8@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <run_html_decode_on_strings+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_html_decode_on_strings>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
xor    %ebx,%ebx
test   %rdi,%rdi
je     1145 <run_html_decode_on_strings+0x35>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %esi,%esi
call   1030 <decode_html_entities_utf8@plt>
mov    0x8(%r14,%rbx,8),%rdi
add    $0x1,%rbx
test   %rdi,%rdi
jne    1130 <run_html_decode_on_strings+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @run_html_decode_on_strings(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %10, %4 ], [ %2, %1 ]
%6 = phi i64 [ %8, %4 ], [ 0, %1 ]
%7 = tail call i32 @decode_html_entities_utf8(i8* %5, i32* null)
%8 = add i64 %6, 1
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
char *skip_nonspace(char *p) {
  char *p1;
  p1 = p;
  while (!isspace(*p1))
    p1++;
  return p1;
}


x86 assembly (clang, -O0):
<skip_nonspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1145 <skip_nonspace+0x35>
jmp    1156 <skip_nonspace+0x46>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <skip_nonspace+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_nonspace>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %eax,%eax
je     1120 <skip_nonspace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip_nonspace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i32 @isspace(i8 signext %4)
%6 = icmp eq i32 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %2, label %8
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int baz(int);
int bar(int i) { return baz(i); }


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

x86 assembly (clang, -O2):
<bar>:
jmp    1030 <baz@plt>

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = tail call i32 @baz(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void str_free_key_func(void *key) { free((char *)key); }


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

x86 assembly (clang, -O2):
<str_free_key_func>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @str_free_key_func(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ right_sign_shift32();
int main() {
  right_sign_shift32();
  exit(0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @right_sign_shift32()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ caddr_t;

/* Variables and functions */
int DoDisk(int, int /*<<< orphan*/, int, int /*<<< orphan*/);
int errno;
ReadDisk(int blknum, caddr_t addr, int blks) {
  int err = DoDisk(blknum, addr, blks, 0);
  if (err)
    errno = err;
  return err ? -1 : 0;
}


x86 assembly (clang, -O0):
<ReadDisk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
call   1030 <DoDisk@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     114a <ReadDisk+0x3a>
mov    -0x10(%rbp),%ecx
mov    0x2e98(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadDisk>:
push   %rax
xor    %ecx,%ecx
call   1030 <DoDisk@plt>
test   %eax,%eax
je     1125 <ReadDisk+0x15>
mov    0x2ebd(%rip),%rcx
mov    %eax,(%rcx)
neg    %eax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @ReadDisk(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @DoDisk(i32 %8, i32 %9, i32 %10, i32 0)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = load i32, i32* %7
store i32 %15, i32* @errno
br label %16
16: ; preds = %14, %3
%17 = load i32, i32* %7
%18 = icmp ne i32 %17, 0
%19 = zext i1 %18 to i64
%20 = select i1 %18, i32 -1, i32 0
ret i32 %20
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @ReadDisk(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @DoDisk(i32 %0, i32 %1, i32 %2, i32 0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3
store i32 %4, i32* @errno
br label %7
7: ; preds = %6, %3
%8 = xor i1 %5, true
%9 = sext i1 %8 to i32
ret i32 %9
}
void CRYPTO_strdup(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_strdup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xe4() {
  Assert_real((isbdigit(228) == 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",
              1145, ("isbdigit should be 0 for 0xe4"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xe4>:
push   %rax
mov    $0xe4,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x479,%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 0xe4\00"
define void @t_isbdigit_0xe4() {
%1 = call i64 @isbdigit(i32 228)
%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 1145, 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 0xe4\00"
define void @t_isbdigit_0xe4() {
%1 = tail call i64 @isbdigit(i32 228)
%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 1145, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void my_strcpy2(char *dst, const char *src) {
  while (*dst = *src) {
    ++dst, ++src;
  }
}


x86 assembly (clang, -O0):
<my_strcpy2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     113d <my_strcpy2+0x3d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <my_strcpy2+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcpy2>:
mov    (%rsi),%al
mov    %al,(%rdi)
test   %al,%al
je     111f <my_strcpy2+0x1f>
mov    $0x1,%eax
nopl   (%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <my_strcpy2+0x10>
ret

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

LLVM IR (-O2):
define void @my_strcpy2(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %9, %5 ], [ %1, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
store i8 %10, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int safe_atoi(char const *, int *);
int safe_atoi32(const char *s, int32_t *ret_i) {
  struct _assert_struct_1 {
    char x[(sizeof(int32_t) == sizeof(int)) ? 0 : -1];
  };
  ;
  return safe_atoi(s, (int *)ret_i);
}


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

x86 assembly (clang, -O2):
<safe_atoi32>:
jmp    1030 <safe_atoi@plt>

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

LLVM IR (-O2):
define i32 @safe_atoi32(i8* %0, i32* %1) {
%3 = tail call i32 @safe_atoi(i8* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
long long or_ll(long long *, long long *);
long long intr_wrap_545(long long p1, long long p2) { return or_ll(&p1, &p2); }


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

x86 assembly (clang, -O2):
<intr_wrap_545>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <or_ll@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i64 @intr_wrap_545(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 @or_ll(i64* %3, i64* %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @intr_wrap_545(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 @or_ll(i64* %3, i64* %4)
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ val;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, void *, int);
int /*<<< orphan*/ printf(char *, int);
void print_int(void *buf) {
  uint32_t val;
  memcpy(&val, buf, sizeof(val));
  printf("%d", val);
}


x86 assembly (clang, -O0):
<print_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0xc(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    0x4(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @print_int(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
unsigned int functest(unsigned int x) { return __builtin_ctz(x); }


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

x86 assembly (clang, -O2):
<functest>:
bsf    %edi,%eax
ret

LLVM IR (-O0):
define i32 @functest(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.cttz.i32(i32 %3, i1 true)
ret i32 %4
}

LLVM IR (-O2):
define i32 @functest(i32 %0) {
%2 = tail call i32 @llvm.cttz.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void testc(unsigned char c, int ok) {
  if ((c >= 1) && (c <= 127)) {
    if (!ok)
      abort();
  } else if (ok)
    abort();
}


x86 assembly (clang, -O0):
<testc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jl     1151 <testc+0x41>
movzbl -0x1(%rbp),%eax
cmp    $0x7f,%eax
jg     1151 <testc+0x41>
cmpl   $0x0,-0x8(%rbp)
jne    114c <testc+0x3c>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1167 <testc+0x57>
cmpl   $0x0,-0x8(%rbp)
je     1162 <testc+0x52>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1167 <testc+0x57>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testc>:
push   %rax
test   %dil,%dil
jle    111c <testc+0xc>
test   %esi,%esi
je     1120 <testc+0x10>
pop    %rax
ret
test   %esi,%esi
je     111a <testc+0xa>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @testc(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = icmp sge i32 %6, 1
br i1 %7, label %8, label %18
8: ; preds = %2
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = icmp sle i32 %10, 127
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %12
br label %24
18: ; preds = %8, %2
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 (...) @abort()
unreachable
23: ; preds = %18
br label %24
24: ; preds = %23, %17
ret void
}

LLVM IR (-O2):
define void @testc(i8 zeroext %0, i32 %1) {
%3 = icmp sgt i8 %0, 0
%4 = icmp eq i32 %1, 0
br i1 %3, label %5, label %8
5: ; preds = %2
br i1 %4, label %6, label %11
6: ; preds = %5
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
br i1 %4, label %11, label %9
9: ; preds = %8
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %8, %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_25519_sub(uintptr_t, uintptr_t, uintptr_t);
void fiat_25519_sub(uint32_t out1[10], const uint32_t arg1[10],
                    const uint32_t arg2[10]) {
  internal_fiat_25519_sub((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_25519_sub>:
jmp    1030 <internal_fiat_25519_sub@plt>

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

LLVM IR (-O2):
define void @fiat_25519_sub(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_25519_sub(i64 %4, i64 %5, i64 %6)
ret void
}
int HashFunction(Name)
char *Name;
{ return Name[0] % 20; }


x86 assembly (clang, -O0):
<HashFunction>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HashFunction>:
movsbl (%rdi),%eax
imul   $0x67,%eax,%ecx
movzwl %cx,%edx
shr    $0xb,%ecx
shr    $0xf,%edx
add    %cl,%dl
movzbl %dl,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
movsbl %al,%eax
ret

LLVM IR (-O0):
define i32 @HashFunction(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = srem i32 %6, 20
ret i32 %7
}

LLVM IR (-O2):
define i32 @HashFunction(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = srem i8 %2, 20
%4 = sext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int bs_conv_14le_8(unsigned char const *, int, unsigned char *);
int bs_conv_swab16(unsigned char *, int, unsigned char *);
int bs_conv_14le_16le(const unsigned char *in_buf, int size,
                      unsigned char *out_buf) {
  size = bs_conv_14le_8(in_buf, size, out_buf);
  size = bs_conv_swab16(out_buf, size, out_buf);
  return size;
}


x86 assembly (clang, -O0):
<bs_conv_14le_16le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <bs_conv_14le_8@plt>
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <bs_conv_swab16@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bs_conv_14le_16le>:
push   %rbx
mov    %rdx,%rbx
call   1040 <bs_conv_14le_8@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <bs_conv_swab16@plt>

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

LLVM IR (-O2):
define i32 @bs_conv_14le_16le(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @bs_conv_14le_8(i8* %0, i32 %1, i8* %2)
%5 = tail call i32 @bs_conv_swab16(i8* %2, i32 %4, i8* %2)
ret i32 %5
}
/* Variables and functions */
int atoi(char *);
int getbaudrate(char *p) {
  int baud = atoi(p);
  return (baud);
}


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

x86 assembly (clang, -O2):
<getbaudrate>:
jmp    1030 <atoi@plt>

LLVM IR (-O0):
define i32 @getbaudrate(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @atoi(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @getbaudrate(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
int test4(int d) { return (d >> 3) & 4; }


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
and    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
mov    %edi,%eax
shr    $0x3,%eax
and    $0x4,%eax
ret

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

LLVM IR (-O2):
define i32 @test4(i32 %0) {
%2 = lshr i32 %0, 3
%3 = and i32 %2, 4
ret i32 %3
}
void main() {
  int i;
  for (i = 0; i < 1000; i++) {
    *((unsigned char *)(0x0400 + i)) = 0;
    *((unsigned char *)(0xD800 + i)) = 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3e8,-0x4(%rbp)
jge    1140 <main+0x40>
mov    -0x4(%rbp),%eax
add    $0x400,%eax
cltq
movb   $0x0,(%rax)
mov    -0x4(%rbp),%eax
add    $0xd800,%eax
cltq
movb   $0x0,(%rax)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <main+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xd804,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movw   $0x0,-0xd404(%rax)
movb   $0x0,-0x4(%rax)
movl   $0x0,-0x3(%rax)
movb   $0x0,-0xd402(%rax)
movw   $0x0,-0xd401(%rax)
add    $0x5,%rax
cmp    $0xdbec,%rax
jne    1110 <main+0x10>
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %14, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 1000
br i1 %4, label %5, label %17
5: ; preds = %2
%6 = load i32, i32* %1
%7 = add nsw i32 1024, %6
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8 0, i8* %9
%10 = load i32, i32* %1
%11 = add nsw i32 55296, %10
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
store i8 0, i8* %13
br label %14
14: ; preds = %5
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %2
17: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %23, %1 ]
%3 = add nuw nsw i64 %2, 1024
%4 = inttoptr i64 %3 to i8*
store i8 0, i8* %4
%5 = add nuw nsw i64 %2, 55296
%6 = inttoptr i64 %5 to i8*
store i8 0, i8* %6
%7 = add nuw nsw i64 %2, 1025
%8 = inttoptr i64 %7 to i8*
store i8 0, i8* %8
%9 = add nuw nsw i64 %2, 55297
%10 = inttoptr i64 %9 to i8*
store i8 0, i8* %10
%11 = add nuw nsw i64 %2, 1026
%12 = inttoptr i64 %11 to i8*
store i8 0, i8* %12
%13 = add nuw nsw i64 %2, 55298
%14 = inttoptr i64 %13 to i8*
store i8 0, i8* %14
%15 = add nuw nsw i64 %2, 1027
%16 = inttoptr i64 %15 to i8*
store i8 0, i8* %16
%17 = add nuw nsw i64 %2, 55299
%18 = inttoptr i64 %17 to i8*
store i8 0, i8* %18
%19 = add nuw nsw i64 %2, 1028
%20 = inttoptr i64 %19 to i8*
store i8 0, i8* %20
%21 = add nuw nsw i64 %2, 55300
%22 = inttoptr i64 %21 to i8*
store i8 0, i8* %22
%23 = add nuw nsw i64 %2, 5
%24 = icmp eq i64 %23, 1000
br i1 %24, label %25, label %1
25: ; preds = %1
ret void
}
void instruc_29() {}


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

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

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

LLVM IR (-O2):
define void @instruc_29() {
ret void
}
/* Type definitions */
struct _Locale_time {
  int dummy;
};
struct _Locale_name_hint {
  int dummy;
};

/* Variables and functions */
scalar_t__ _Locale_create(char const *, int *);
struct _Locale_time *_Locale_time_create(const char *name,
                                         struct _Locale_name_hint *hint
                                         __attribute__((__unused__)),
                                         int *__err_code) {
  return (struct _Locale_time *)_Locale_create(name, __err_code);
}


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

x86 assembly (clang, -O2):
<_Locale_time_create>:
mov    %rdx,%rsi
jmp    1030 <_Locale_create@plt>

LLVM IR (-O0):
%struct._Locale_time = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_time* @_Locale_time_create(i8* %0, %struct._Locale_name_hint* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca %struct._Locale_name_hint*
%6 = alloca i32*
store i8* %0, i8** %4
store %struct._Locale_name_hint* %1, %struct._Locale_name_hint** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32*, i32** %6
%9 = call i64 @_Locale_create(i8* %7, i32* %8)
%10 = inttoptr i64 %9 to %struct._Locale_time*
ret %struct._Locale_time* %10
}

LLVM IR (-O2):
%struct._Locale_time = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_time* @_Locale_time_create(i8* %0, %struct._Locale_name_hint* nocapture readnone %1, i32* %2) {
%4 = tail call i64 @_Locale_create(i8* %0, i32* %2)
%5 = inttoptr i64 %4 to %struct._Locale_time*
ret %struct._Locale_time* %5
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
char *pgf_js(char *content, int size) {
  const char _pgf_header[14] = {0x50, 0x47, 0x46, 0x31, 0x2f, 0x2a, 0x00,
                                0x0a, 0x2a, 0x2f, 0x3d, 0x31, 0x3b, 0x0a};
  char *buffer = (char *)malloc(14 + size);
  memcpy(buffer, _pgf_header, 14);
  memcpy(&buffer[14], content, size);
  return buffer;
}


x86 assembly (clang, -O0):
<pgf_js>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x1a(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x12(%rbp)
mov    0xec2(%rip),%ax
mov    %ax,-0xe(%rbp)
mov    -0xc(%rbp),%edi
add    $0xe,%edi
call   1040 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x1a(%rbp),%rsi
mov    $0xe,%edx
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%rdi
add    $0xe,%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgf_js>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%r15d
mov    %rdi,%r14
movabs $0xa3b313d2f2a0a00,%rax
31 3b 0a
mov    %rax,0x6(%rsp)
movabs $0xa002a2f31464750,%rax
mov    %rax,(%rsp)
lea    0xe(%r15),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rsp,%rsi
mov    %rax,%rdi
mov    $0xe,%edx
call   1030 <memcpy@plt>
lea    0xe(%rbx),%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.pgf_js._pgf_header = [14 x i8] c"PGF1/*\00\0A*/=1;\0A"
define i8* @pgf_js(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [14 x i8]
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = bitcast [14 x i8]* %5 to i8*
%8 = load i32, i32* %4
%9 = add nsw i32 14, %8
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = getelementptr inbounds [14 x i8], [14 x i8]* %5, i64 0, i64 0
%14 = call i32 @memcpy(i8* %12, i8* %13, i32 14)
%15 = load i8*, i8** %6
%16 = getelementptr inbounds i8, i8* %15, i64 14
%17 = load i8*, i8** %3
%18 = load i32, i32* %4
%19 = call i32 @memcpy(i8* %16, i8* %17, i32 %18)
%20 = load i8*, i8** %6
ret i8* %20
}

LLVM IR (-O2):
@__const.pgf_js._pgf_header = [14 x i8] c"PGF1/*\00\0A*/=1;\0A"
define i8* @pgf_js(i8* %0, i32 %1) {
%3 = alloca [14 x i8]
%4 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%5 = add nsw i32 %1, 14
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = call i32 @memcpy(i8* %7, i8* %4, i32 14)
%9 = getelementptr inbounds i8, i8* %7, i64 14
%10 = call i32 @memcpy(i8* %9, i8* %0, i32 %1)
ret i8* %7
}
/* Variables and functions */
char EOF;
int /*<<< orphan*/ printf(char *, char);
void putCharIntoFile(char *character) {
  unsigned int i = 0;
  while (character[i] != EOF) {
    printf("%c\n", character[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<putCharIntoFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
mov    0x2eb3(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1165 <putCharIntoFile+0x55>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
lea    0xeb2(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <putCharIntoFile+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putCharIntoFile>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
mov    0x2ec8(%rip),%r15
cmp    (%r15),%al
je     1159 <putCharIntoFile+0x49>
mov    %rdi,%rbx
mov    $0x1,%ebp
lea    0xecc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %ebp,%eax
movzbl (%rbx,%rax,1),%eax
add    $0x1,%ebp
cmp    (%r15),%al
jne    1140 <putCharIntoFile+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i8 0
@.str = [4 x i8] c"%c\0A\00"
define void @putCharIntoFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = load i8, i8* @EOF
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %10, %12
br i1 %13, label %14, label %23
14: ; preds = %4
%15 = load i8*, i8** %2
%16 = load i32, i32* %3
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %19)
%21 = load i32, i32* %3
%22 = add i32 %21, 1
store i32 %22, i32* %3
br label %4
23: ; preds = %4
ret void
}

LLVM IR (-O2):
@EOF = global i8 0
@.str = [4 x i8] c"%c\0A\00"
define void @putCharIntoFile(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = load i8, i8* @EOF
%4 = icmp eq i8 %2, %3
br i1 %4, label %15, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %12, %5 ], [ %2, %1 ]
%7 = phi i32 [ %9, %5 ], [ 0, %1 ]
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %6)
%9 = add i32 %7, 1
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = load i8, i8* @EOF
%14 = icmp eq i8 %12, %13
br i1 %14, label %15, label %5
15: ; preds = %5, %1
ret void
}
char *fo_sysconfig(const char *sectionname, const char *variablename) {
  return (0);
}


x86 assembly (clang, -O0):
<fo_sysconfig>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @fo_sysconfig(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @fo_sysconfig(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
void TimerCompare1Set(unsigned long ulBase, unsigned long ulCompare1) {

  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000034))) = ulCompare1;
}


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

x86 assembly (clang, -O2):
<TimerCompare1Set>:
mov    %rsi,0x34(%rdi)
ret

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

LLVM IR (-O2):
define void @TimerCompare1Set(i64 %0, i64 %1) {
%3 = add i64 %0, 52
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ init();
int /*<<< orphan*/ play();
int main(int argc, char *argv[]) {
  init();
  play();
  endwin();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @init()
%7 = call i32 (...) @play()
%8 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
%4 = tail call i32 (...) @play()
%5 = tail call i32 (...) @endwin()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *name) {
  fprintf(stderr,
          "usage: %s --pid <pid> [--count <num samples>] [--delay <delay in "
          "ms>] [--ksuseopc <pointer>] [--ksusetim <pointer>]\n\n",
          name);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
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 = [118 x i8] c"usage: %s --pid <pid> [--count <num samples>] [--delay <delay in ms>] [--ksuseopc <pointer>] [--ksusetim <pointer>]\0A\0A\00"
define void @usage(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 ([118 x i8], [118 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [118 x i8] c"usage: %s --pid <pid> [--count <num samples>] [--delay <delay in ms>] [--ksuseopc <pointer>] [--ksusetim <pointer>]\0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputw(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int n;
  FILE *fp;
  scanf("%d", &n);
  fp = fopen("abc.txt", "wb");
  fputw(n, fp);
  fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xea4(%rip),%rdi
lea    0xea5(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <fputw@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xea6(%rip),%rdi
lea    0xea7(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%edi
mov    %rax,%rsi
call   1040 <fputw@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"abc.txt\00"
@.str.2 = [3 x i8] c"wb\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %4, i32** %2
%5 = load i32, i32* %1
%6 = load i32*, i32** %2
%7 = call i32 @fputw(i32 %5, i32* %6)
%8 = load i32*, i32** %2
%9 = call i32 @fclose(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"abc.txt\00"
@.str.2 = [3 x i8] c"wb\00"
define void @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 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* %1
%6 = call i32 @fputw(i32 %5, i32* %4)
%7 = call i32 @fclose(i32* %4)
ret void
}
/* Variables and functions */
void *malloc(size_t const);
int /*<<< orphan*/ necro_exit(int);
int /*<<< orphan*/ printf(char *, size_t const);
void *__emalloc(const size_t a_size) {
  void *data = malloc(a_size);
  if (data == NULL) {
    printf("Could not allocate enough memory: %zu\n", a_size);
    necro_exit(1);
  }
  return data;
}


x86 assembly (clang, -O0):
<__emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <__emalloc+0x3e>
mov    -0x8(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1030 <necro_exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__emalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115d <__emalloc+0x2d>
lea    0xeb5(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1030 <necro_exit@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Could not allocate enough memory: %zu\0A\00"
define i8* @__emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = call i32 @necro_exit(i32 1)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [39 x i8] c"Could not allocate enough memory: %zu\0A\00"
define noalias i8* @__emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %0)
%6 = tail call i32 @necro_exit(i32 1)
br label %7
7: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ cf_xlnk_init(int);
void _xlnk_reset() { cf_xlnk_init(1); }


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

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

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

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