xunge/DecIR huggingface dataset:
int i386_cannot_fetch_register(int regno) { return (regno >= 16); }


x86 assembly (clang, -O0):
<i386_cannot_fetch_register>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i386_cannot_fetch_register>:
xor    %eax,%eax
cmp    $0x10,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @i386_cannot_fetch_register(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 16
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @i386_cannot_fetch_register(i32 %0) {
%2 = icmp sgt i32 %0, 15
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/
UpnpResponse_MediaRenderer_ConnectionManager_GetProtocolInfo(void *, char *,
                                                             char *);
int /*<<< orphan*/ printf(char *);
void UpnpMediaRenderer_ConnectionManager_GetProtocolInfo(void *upnptoken) {
  printf("Invoke: UpnpMediaRenderer_ConnectionManager_GetProtocolInfo();\r\n");
  UpnpResponse_MediaRenderer_ConnectionManager_GetProtocolInfo(
      upnptoken, "Sample String", "Sample String");
}


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

x86 assembly (clang, -O2):
<UpnpMediaRenderer_ConnectionManager_GetProtocolInfo>:
push   %rbx
mov    %rdi,%rbx
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdx
mov    %rbx,%rdi
mov    %rdx,%rsi
pop    %rbx
jmp    1040 <UpnpResponse_MediaRenderer_ConnectionManager_GetProtocolInfo@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"Invoke: UpnpMediaRenderer_ConnectionManager_GetProtocolInfo();\0D\0A\00"
@.str.1 = [14 x i8] c"Sample String\00"
define void @UpnpMediaRenderer_ConnectionManager_GetProtocolInfo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @UpnpResponse_MediaRenderer_ConnectionManager_GetProtocolInfo(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"Sample String\00"
@str = [64 x i8] c"Invoke: UpnpMediaRenderer_ConnectionManager_GetProtocolInfo();\0D\00"
define void @UpnpMediaRenderer_ConnectionManager_GetProtocolInfo(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @UpnpResponse_MediaRenderer_ConnectionManager_GetProtocolInfo(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int STC3115_conv(short value, unsigned short factor) {
  int v;
  v = ((long)value * factor) >> 11;
  v = (v + 1) / 2;
  return (v);
}


x86 assembly (clang, -O0):
<STC3115_conv>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswq -0x2(%rbp),%rax
movzwl -0x4(%rbp),%ecx
imul   %rcx,%rax
sar    $0xb,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<STC3115_conv>:
movslq %edi,%rax
mov    %esi,%ecx
imul   %rax,%rcx
shr    $0xb,%rcx
mov    %ecx,%eax
add    $0x1,%eax
shr    $0x1f,%eax
add    %ecx,%eax
add    $0x1,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @STC3115_conv(i16 signext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i32
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = sext i16 %6 to i64
%8 = load i16, i16* %4
%9 = zext i16 %8 to i64
%10 = mul nsw i64 %7, %9
%11 = ashr i64 %10, 11
%12 = trunc i64 %11 to i32
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
%15 = sdiv i32 %14, 2
store i32 %15, i32* %5
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @STC3115_conv(i16 signext %0, i16 zeroext %1) {
%3 = sext i16 %0 to i64
%4 = zext i16 %1 to i64
%5 = mul nsw i64 %4, %3
%6 = ashr i64 %5, 11
%7 = trunc i64 %6 to i32
%8 = add nsw i32 %7, 1
%9 = sdiv i32 %8, 2
ret i32 %9
}
void xen_clockevents_resume(void) {}


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

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

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

LLVM IR (-O2):
define void @xen_clockevents_resume() {
ret void
}
/* Variables and functions */
size_t cstrlen(const char *str) {
  const char *s;
  for (s = str; *s; ++s)
    ;
  return (s - str);
}


x86 assembly (clang, -O0):
<cstrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <cstrlen+0x33>
jmp    1122 <cstrlen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <cstrlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstrlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <cstrlen+0x10>
ret

LLVM IR (-O0):
define i64 @cstrlen(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 = %10, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
br label %10
10: ; preds = %9
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i8*, i8** %2
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
ret i64 %18
}

LLVM IR (-O2):
define i64 @cstrlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
int to_31_num(int a) {
  int r = (a << 1) + 1;
  return r;
}


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

x86 assembly (clang, -O2):
<to_31_num>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @to_31_num(i32 %0) {
%2 = shl i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pem_password_cb;
typedef int /*<<< orphan*/ d2i_of_void;
typedef int /*<<< orphan*/ NETSCAPE_CERT_SEQUENCE;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *PEM_ASN1_read(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int /*<<< orphan*/ *, void **,
                                  int /*<<< orphan*/ *, void *);
int /*<<< orphan*/ PEM_STRING_X509;
scalar_t__ d2i_NETSCAPE_CERT_SEQUENCE;
NETSCAPE_CERT_SEQUENCE *
PEM_read_NETSCAPE_CERT_SEQUENCE(FILE *fp, NETSCAPE_CERT_SEQUENCE **x,
                                pem_password_cb *cb, void *u) {
  return PEM_ASN1_read((d2i_of_void *)d2i_NETSCAPE_CERT_SEQUENCE,
                       PEM_STRING_X509, fp, (void **)x, cb, u);
}


x86 assembly (clang, -O0):
<PEM_read_NETSCAPE_CERT_SEQUENCE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%rdi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1030 <PEM_ASN1_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_read_NETSCAPE_CERT_SEQUENCE>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
jmp    1030 <PEM_ASN1_read@plt>

LLVM IR (-O0):
@d2i_NETSCAPE_CERT_SEQUENCE = global i64 0
@PEM_STRING_X509 = global i32 0
define i32* @PEM_read_NETSCAPE_CERT_SEQUENCE(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32**
%7 = alloca i32*
%8 = alloca i8*
store i32* %0, i32** %5
store i32** %1, i32*** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i64, i64* @d2i_NETSCAPE_CERT_SEQUENCE
%10 = inttoptr i64 %9 to i32*
%11 = load i32, i32* @PEM_STRING_X509
%12 = load i32*, i32** %5
%13 = load i32**, i32*** %6
%14 = bitcast i32** %13 to i8**
%15 = load i32*, i32** %7
%16 = load i8*, i8** %8
%17 = call i32* @PEM_ASN1_read(i32* %10, i32 %11, i32* %12, i8** %14, i32* %15, i8* %16)
ret i32* %17
}

LLVM IR (-O2):
@d2i_NETSCAPE_CERT_SEQUENCE = global i64 0
@PEM_STRING_X509 = global i32 0
define i32* @PEM_read_NETSCAPE_CERT_SEQUENCE(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = load i64, i64* @d2i_NETSCAPE_CERT_SEQUENCE
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_X509
%8 = bitcast i32** %1 to i8**
%9 = tail call i32* @PEM_ASN1_read(i32* %6, i32 %7, i32* %0, i8** %8, i32* %2, i8* %3)
ret i32* %9
}
unsigned char lshift(unsigned char data, unsigned char shift) {
  return data << shift;
}


x86 assembly (clang, -O0):
<lshift>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
shl    %cl,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lshift>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define zeroext i8 @lshift(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = shl i32 %6, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @lshift(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = shl i32 %3, %4
%6 = trunc i32 %5 to i8
ret i8 %6
}
/* Type definitions */
typedef char int64_t;

/* Variables and functions */
char *malloc(unsigned int);
char *read_str_from_argv(unsigned int argc, const int64_t *argv) {
  char *r = malloc(argc + 1);
  r[argc] = 0;
  for (int i = 0; i < argc; i++)
    r[i] = argv[i];
  return r;
}


x86 assembly (clang, -O0):
<read_str_from_argv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x4(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1170 <read_str_from_argv+0x60>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1140 <read_str_from_argv+0x30>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_str_from_argv>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebx
lea    0x1(%rbx),%edi
call   1040 <malloc@plt>
mov    %rax,%r15
mov    %ebx,%edx
movb   $0x0,(%rax,%rdx,1)
test   %ebx,%ebx
je     114a <read_str_from_argv+0x2a>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <memcpy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define noalias i8* @read_str_from_argv(i32 %0, i8* nocapture %1) {
%3 = add i32 %0, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = zext i32 %0 to i64
%6 = getelementptr inbounds i8, i8* %4, i64 %5
store i8 0, i8* %6
%7 = icmp eq i32 %0, 0
br i1 %7, label %9, label %8
8: ; preds = %2
br label %9
9: ; preds = %8, %2
ret i8* %4
}
/* Variables and functions */
unsigned short app_usb_mount(unsigned short);
unsigned short Usb_on(unsigned short index) { return app_usb_mount(index); }


x86 assembly (clang, -O0):
<Usb_on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <app_usb_mount@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Usb_on>:
jmp    1030 <app_usb_mount@plt>

LLVM IR (-O0):
define zeroext i16 @Usb_on(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call zeroext i16 @app_usb_mount(i16 zeroext %3)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @Usb_on(i16 zeroext %0) {
%2 = tail call zeroext i16 @app_usb_mount(i16 zeroext %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void err(char *str) {
  perror(str);
  exit(1);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @err(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void InterpolateRow_C() {}


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

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

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

LLVM IR (-O2):
define void @InterpolateRow_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x89() {
  Assert_real((isalpha(137) == 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_isalpha.c",
              690, ("isalpha should be 0 for 0x89"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x89>:
push   %rax
mov    $0x89,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2b2,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x89\00"
define void @t_isalpha_0x89() {
%1 = call i64 @isalpha(i32 137)
%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 690, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x89\00"
define void @t_isalpha_0x89() {
%1 = tail call i64 @isalpha(i32 137)
%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 690, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void LedInit(void) {
  (*((volatile unsigned long *)0xE0028018)) |= 0x00800000;
  (*((volatile unsigned long *)0xE0028014)) = 0x00800000;
}


x86 assembly (clang, -O0):
<LedInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0028018,%eax
mov    (%rax),%rcx
or     $0x800000,%rcx
mov    $0xe0028018,%eax
mov    %rcx,(%rax)
mov    $0xe0028014,%eax
movq   $0x800000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LedInit>:
mov    $0xe0028018,%eax
orq    $0x800000,(%rax)
movq   $0x800000,-0x4(%rax)
ret

LLVM IR (-O0):
define void @LedInit() {
%1 = load volatile i64, i64* inttoptr (i64 3758260248 to i64*)
%2 = or i64 %1, 8388608
store volatile i64 %2, i64* inttoptr (i64 3758260248 to i64*)
store volatile i64 8388608, i64* inttoptr (i64 3758260244 to i64*)
ret void
}

LLVM IR (-O2):
define void @LedInit() {
%1 = load volatile i64, i64* inttoptr (i64 3758260248 to i64*)
%2 = or i64 %1, 8388608
store volatile i64 %2, i64* inttoptr (i64 3758260248 to i64*)
store volatile i64 8388608, i64* inttoptr (i64 3758260244 to i64*)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool data_looks_like_v1(void *data) {
  uint8_t *v = *((void **)data);
  return (v[0] + v[1]) < 2 || v[0] == 0xff || v[1] == 0xff;
}


x86 assembly (clang, -O0):
<data_looks_like_v1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
add    0x4(%rax),%ecx
mov    $0x1,%al
cmp    $0x2,%ecx
mov    %al,-0x11(%rbp)
jl     1154 <data_looks_like_v1+0x54>
mov    -0x10(%rbp),%rcx
mov    $0x1,%al
cmpl   $0xff,(%rcx)
mov    %al,-0x11(%rbp)
je     1154 <data_looks_like_v1+0x54>
mov    -0x10(%rbp),%rax
cmpl   $0xff,0x4(%rax)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<data_looks_like_v1>:
mov    (%rdi),%rax
mov    (%rax),%ecx
mov    0x4(%rax),%eax
lea    (%rax,%rcx,1),%edx
cmp    $0x2,%edx
setl   %dl
cmp    $0xff,%ecx
sete   %cl
cmp    $0xff,%eax
sete   %al
or     %cl,%al
or     %dl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @data_looks_like_v1(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %3
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = add nsw i32 %10, %13
%15 = icmp slt i32 %14, 2
br i1 %15, label %26, label %16
16: ; preds = %1
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 0
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, 255
br i1 %20, label %26, label %21
21: ; preds = %16
%22 = load i32*, i32** %3
%23 = getelementptr inbounds i32, i32* %22, i64 1
%24 = load i32, i32* %23
%25 = icmp eq i32 %24, 255
br label %26
26: ; preds = %21, %16, %1
%27 = phi i1 [ true, %16 ], [ true, %1 ], [ %25, %21 ]
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @data_looks_like_v1(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32**
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %3, i64 1
%6 = load i32, i32* %5
%7 = add nsw i32 %6, %4
%8 = icmp slt i32 %7, 2
%9 = icmp eq i32 %4, 255
%10 = or i1 %9, %8
%11 = icmp eq i32 %6, 255
%12 = select i1 %10, i1 true, i1 %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello World -- simple-cprov!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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 = [30 x i8] c"Hello World -- simple-cprov!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [29 x i8] c"Hello World -- simple-cprov!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ coins(int, long *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
long int main() {
  long int values[] = {200, 100, 50, 20, 10, 5, 2, 1};
  printf("%ld\n", coins(200, values, 0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rsi
mov    $0xc8,%edi
xor    %edx,%edx
call   1050 <coins@plt>
mov    %eax,%esi
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0xc8,%edi
xor    %edx,%edx
call   1040 <coins@plt>
lea    0xed7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.values = [8 x i64] [i64 200, i64 100, i64 50, i64 20, i64 10, i64 5, i64 2, i64 1]
@.str = [5 x i8] c"%ld\0A\00"
define i64 @main() {
%1 = alloca [8 x i64]
%2 = bitcast [8 x i64]* %1 to i8*
%3 = getelementptr inbounds [8 x i64], [8 x i64]* %1, i64 0, i64 0
%4 = call i32 @coins(i32 200, i64* %3, i32 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i64 0
}

LLVM IR (-O2):
@__const.main.values = [8 x i64] [i64 200, i64 100, i64 50, i64 20, i64 10, i64 5, i64 2, i64 1]
@.str = [5 x i8] c"%ld\0A\00"
define i64 @main() {
%1 = alloca [8 x i64]
%2 = bitcast [8 x i64]* %1 to i8*
%3 = getelementptr inbounds [8 x i64], [8 x i64]* %1, i64 0, i64 0
%4 = call i32 @coins(i32 200, i64* %3, i32 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i64 0
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int NGROUPS_MAX;
int /*<<< orphan*/ _getgrouplist(char const *, int /*<<< orphan*/,
                                 int /*<<< orphan*/ *, int *);
int setgroups(int, int /*<<< orphan*/ *);
int initgroups(const char *user, gid_t group) {
  int n = NGROUPS_MAX;
  gid_t grouplist[NGROUPS_MAX];
  _getgrouplist(user, group, grouplist, &n);
  return setgroups(n, grouplist);
}


x86 assembly (clang, -O0):
<initgroups>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%ecx
mov    %ecx,-0x10(%rbp)
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x28(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rcx
call   1040 <_getgrouplist@plt>
mov    -0x28(%rbp),%rsi
mov    -0x10(%rbp),%edi
call   1030 <setgroups@plt>
mov    -0x18(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initgroups>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%r14
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    %rsp,%rbx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    -0x14(%rbp),%rcx
mov    %rbx,%rdx
call   1040 <_getgrouplist@plt>
mov    -0x14(%rbp),%edi
mov    %rbx,%rsi
call   1030 <setgroups@plt>
mov    %r14,%rsp
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@NGROUPS_MAX = global i32 0
define i32 @initgroups(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i32, i32* @NGROUPS_MAX
store i32 %8, i32* %5
%9 = load i32, i32* @NGROUPS_MAX
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %6
%12 = alloca i32, i64 %10
store i64 %10, i64* %7
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = call i32 @_getgrouplist(i8* %13, i32 %14, i32* %12, i32* %5)
%16 = load i32, i32* %5
%17 = call i32 @setgroups(i32 %16, i32* %12)
%18 = load i8*, i8** %6
ret i32 %17
}

LLVM IR (-O2):
@NGROUPS_MAX = global i32 0
define i32 @initgroups(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* @NGROUPS_MAX
store i32 %5, i32* %3
%6 = zext i32 %5 to i64
%7 = tail call i8* @llvm.stacksave()
%8 = alloca i32, i64 %6
%9 = call i32 @_getgrouplist(i8* %0, i32 %1, i32* %8, i32* %3)
%10 = load i32, i32* %3
%11 = call i32 @setgroups(i32 %10, i32* %8)
ret i32 %11
}
int test_imm_A9uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xA9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A9uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 169
%7 = icmp ne i64 %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_A9uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11075584
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef unsigned char uint32_t;

/* Variables and functions */
uint32_t read_u32_be(unsigned char *buf) {
  uint32_t n = 0;
  n |= buf[0] << 24;
  n |= buf[1] << 16;
  n |= buf[2] << 8;
  n |= buf[3];
  return n;
}


x86 assembly (clang, -O0):
<read_u32_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
shl    $0x18,%ecx
movzbl -0x9(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%ecx
shl    $0x10,%ecx
movzbl -0x9(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%ecx
shl    $0x8,%ecx
movzbl -0x9(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%ecx
movzbl -0x9(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_u32_be>:
mov    0x3(%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @read_u32_be(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
store i8 0, i8* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 24
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = or i32 %10, %8
%12 = trunc i32 %11 to i8
store i8 %12, i8* %3
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = load i8, i8* %3
%19 = zext i8 %18 to i32
%20 = or i32 %19, %17
%21 = trunc i32 %20 to i8
store i8 %21, i8* %3
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 2
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = shl i32 %25, 8
%27 = load i8, i8* %3
%28 = zext i8 %27 to i32
%29 = or i32 %28, %26
%30 = trunc i32 %29 to i8
store i8 %30, i8* %3
%31 = load i8*, i8** %2
%32 = getelementptr inbounds i8, i8* %31, i64 3
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = load i8, i8* %3
%36 = zext i8 %35 to i32
%37 = or i32 %36, %34
%38 = trunc i32 %37 to i8
store i8 %38, i8* %3
%39 = load i8, i8* %3
ret i8 %39
}

LLVM IR (-O2):
define zeroext i8 @read_u32_be(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
ret i8 %3
}
/* Type definitions */
struct timespec {
  long member_0;
  long member_1;
};

/* Variables and functions */
int /*<<< orphan*/ sancus_time_fix(struct timespec *);
struct timespec sancus_time_new(long sec, long ns) {
  struct timespec ts = {sec, ns};
  sancus_time_fix(&ts);
  return ts;
}


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

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

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define { i64, i64 } @sancus_time_new(i64 %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%7 = load i64, i64* %4
store i64 %7, i64* %6
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%9 = load i64, i64* %5
store i64 %9, i64* %8
%10 = call i32 @sancus_time_fix(%struct.timespec* %3)
%11 = bitcast %struct.timespec* %3 to { i64, i64 }*
%12 = load { i64, i64 }, { i64, i64 }* %11
ret { i64, i64 } %12
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define { i64, i64 } @sancus_time_new(i64 %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
store i64 %0, i64* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 1
store i64 %1, i64* %5
%6 = call i32 @sancus_time_fix(%struct.timespec* %3)
%7 = load i64, i64* %4
%8 = insertvalue { i64, i64 } poison, i64 %7, 0
%9 = load i64, i64* %5
%10 = insertvalue { i64, i64 } %8, i64 %9, 1
ret { i64, i64 } %10
}
/* Variables and functions */
int /*<<< orphan*/ TEMP_LOG(int, char *, int, char *);
int system(char *);
int TEMP_ac_turn_off(void) {
  int ret;
  ret = system("irsend SEND_ONCE AC OFF");
  if (ret < 0) {
    TEMP_LOG((2),
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/cugfeng/Home_Automation/refs/heads/"
             "master/temperature/source/ac.c",
             40, "Turn off AC failed!\n");
  }
  return ret;
}


x86 assembly (clang, -O0):
<TEMP_ac_turn_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    115e <TEMP_ac_turn_off+0x3e>
mov    $0x2,%edi
lea    0xecb(%rip),%rsi
mov    $0x28,%edx
lea    0xf5b(%rip),%rcx
call   1040 <TEMP_LOG@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEMP_ac_turn_off>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1150 <TEMP_ac_turn_off+0x30>
lea    0xede(%rip),%rsi
lea    0xf73(%rip),%rcx
mov    $0x2,%edi
mov    $0x28,%edx
call   1040 <TEMP_LOG@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"irsend SEND_ONCE AC OFF\00"
@.str.1 = [156 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cugfeng/Home_Automation/refs/heads/master/temperature/source/ac.c\00"
@.str.2 = [21 x i8] c"Turn off AC failed!\0A\00"
define i32 @TEMP_ac_turn_off() {
%1 = alloca i32
%2 = call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @TEMP_LOG(i32 2, i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str.1, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [24 x i8] c"irsend SEND_ONCE AC OFF\00"
@.str.1 = [156 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cugfeng/Home_Automation/refs/heads/master/temperature/source/ac.c\00"
@.str.2 = [21 x i8] c"Turn off AC failed!\0A\00"
define i32 @TEMP_ac_turn_off() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @TEMP_LOG(i32 2, i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str.1, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 %1
}
/* Variables and functions */
char *cat(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *id = "scott.meyers";
  char *addr = "aristeia.com";
  char *s = cat(id, addr);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <cat@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xede(%rip),%rsi
call   1040 <cat@plt>
lea    0xedf(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"scott.meyers\00"
@.str.1 = [13 x i8] c"aristeia.com\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %1
%5 = load i8*, i8** %2
%6 = call i8* @cat(i8* %4, i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"scott.meyers\00"
@.str.1 = [13 x i8] c"aristeia.com\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @cat(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(unsigned int);
int /*<<< orphan*/ print_error(char *, unsigned int);
void *chk_malloc(unsigned n, unsigned size) {
  void *p;
  p = malloc(n * size);
  if (p == 0) {
    print_error(
        "chk_malloc: Ran out of memory (while trying to allocate %d bytes)\n",
        n * size);
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<chk_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
imul   -0x8(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117a <chk_malloc+0x4a>
mov    -0x4(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <print_error@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chk_malloc>:
push   %rbx
mov    %edi,%ebx
imul   %esi,%ebx
mov    %ebx,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1144 <chk_malloc+0x14>
pop    %rbx
ret
lea    0xeb5(%rip),%rdi
mov    %ebx,%esi
call   1030 <print_error@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [67 x i8] c"chk_malloc: Ran out of memory (while trying to allocate %d bytes)\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @chk_malloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul i32 %6, %7
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %19
12: ; preds = %2
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = mul i32 %13, %14
%16 = call i32 @print_error(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* @EXIT_FAILURE
%18 = call i32 @exit(i32 %17)
unreachable
19: ; preds = %2
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
@.str = [67 x i8] c"chk_malloc: Ran out of memory (while trying to allocate %d bytes)\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @chk_malloc(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i32 @print_error(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i32 %3)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %4
}
void *_dl_allocate_tls(void *mem) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @_dl_allocate_tls(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int GCD(int, int);
int LCMNomiCalculator(int n, int m) {
  int gcd = GCD(n, m);
  return n / gcd;
}


x86 assembly (clang, -O0):
<LCMNomiCalculator>:
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 <GCD@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCMNomiCalculator>:
push   %rbx
mov    %edi,%ebx
call   1030 <GCD@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @LCMNomiCalculator(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @GCD(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = sdiv i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @LCMNomiCalculator(i32 %0, i32 %1) {
%3 = tail call i32 @GCD(i32 %0, i32 %1)
%4 = sdiv i32 %0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assertNull(void *);
int /*<<< orphan*/ mfree(void *);
void testFreeNull(void) {
  void *ptr = NULL;
  mfree(ptr);
  assertNull(ptr);
}


x86 assembly (clang, -O0):
<testFreeNull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mfree@plt>
mov    -0x8(%rbp),%rdi
call   1040 <assertNull@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFreeNull>:
push   %rax
xor    %edi,%edi
call   1030 <mfree@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <assertNull@plt>

LLVM IR (-O0):
define void @testFreeNull() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @mfree(i8* %2)
%4 = load i8*, i8** %1
%5 = call i32 @assertNull(i8* %4)
ret void
}

LLVM IR (-O2):
define void @testFreeNull() {
%1 = tail call i32 @mfree(i8* null)
%2 = tail call i32 @assertNull(i8* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ beolv(char *, int *);
int /*<<< orphan*/ getMulti();
int /*<<< orphan*/ kiir(char *, int /*<<< orphan*/);
int /*<<< orphan*/ setMulti(int);
int multimenu() {
  int l;
  kiir("Bekapcsolod a tobbjatekos modot?(1 - igen, 0 - nem)(Jelenleg %d): ",
       getMulti());
  beolv("%d", &l);
  if (l >= 0 && l <= 1) {
    setMulti(l);
  }
  return 1;
}


x86 assembly (clang, -O0):
<multimenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <getMulti@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1030 <kiir@plt>
lea    0xedf(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <beolv@plt>
cmpl   $0x0,-0x4(%rbp)
jl     1189 <multimenu+0x49>
cmpl   $0x1,-0x4(%rbp)
jg     1189 <multimenu+0x49>
mov    -0x4(%rbp),%edi
call   1040 <setMulti@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multimenu>:
push   %rax
xor    %eax,%eax
call   1060 <getMulti@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <kiir@plt>
lea    0xee6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <beolv@plt>
mov    0x4(%rsp),%edi
cmp    $0x1,%edi
ja     1175 <multimenu+0x35>
call   1040 <setMulti@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [67 x i8] c"Bekapcsolod a tobbjatekos modot?(1 - igen, 0 - nem)(Jelenleg %d): \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @multimenu() {
%1 = alloca i32
%2 = call i32 (...) @getMulti()
%3 = call i32 @kiir(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @beolv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %0
%8 = load i32, i32* %1
%9 = icmp sle i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %1
%12 = call i32 @setMulti(i32 %11)
br label %13
13: ; preds = %10, %7, %0
ret i32 1
}

LLVM IR (-O2):
@.str = [67 x i8] c"Bekapcsolod a tobbjatekos modot?(1 - igen, 0 - nem)(Jelenleg %d): \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @multimenu() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @getMulti()
%4 = tail call i32 @kiir(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @beolv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp ult i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @setMulti(i32 %6)
br label %10
10: ; preds = %8, %0
ret i32 1
}
void GfxDrv_BeginDrawing() {}


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

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

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

LLVM IR (-O2):
define void @GfxDrv_BeginDrawing() {
ret void
}
/* Variables and functions */
unsigned int sys_call(int, unsigned int, unsigned int, unsigned int,
                      int /*<<< orphan*/);
unsigned int fb_sync_write(unsigned int offset, void *buffer,
                           unsigned int length) {
  return sys_call(0x10, offset, (unsigned int)buffer, length, 0);
}


x86 assembly (clang, -O0):
<fb_sync_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
mov    -0x14(%rbp),%ecx
mov    $0x10,%edi
xor    %r8d,%r8d
call   1030 <sys_call@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_sync_write>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x10,%edi
xor    %r8d,%r8d
jmp    1030 <sys_call@plt>

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

LLVM IR (-O2):
define i32 @fb_sync_write(i32 %0, i8* %1, i32 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @sys_call(i32 16, i32 %0, i32 %5, i32 %2, i32 0)
ret i32 %6
}
/* Variables and functions */
char *test() {
  do {
    if (!(true))
      return "Fail Message";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <test+0x9>
jmp    110e <test+0xe>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @test() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @test() {
ret i8* null
}
void encodeDmaEnd(void) {}


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

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

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

LLVM IR (-O2):
define void @encodeDmaEnd() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parallel_clr_nrfd(int);
int /*<<< orphan*/ parallel_set_nrfd(int);
void parallel_drv3_set_nrfd(unsigned char val) {
  if (val) {
    parallel_set_nrfd(0x20);
  } else {
    parallel_clr_nrfd(~0x20);
  }
}


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

x86 assembly (clang, -O2):
<parallel_drv3_set_nrfd>:
test   %edi,%edi
je     112e <parallel_drv3_set_nrfd+0xe>
mov    $0x20,%edi
jmp    1040 <parallel_set_nrfd@plt>
mov    $0xffffffdf,%edi
jmp    1030 <parallel_clr_nrfd@plt>

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

LLVM IR (-O2):
define void @parallel_drv3_set_nrfd(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @parallel_set_nrfd(i32 32)
br label %7
5: ; preds = %1
%6 = tail call i32 @parallel_clr_nrfd(i32 -33)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_sock(int sock) { close(sock); }


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

x86 assembly (clang, -O2):
<close_sock>:
jmp    1030 <close@plt>

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

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