xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_inquiry_result_with_rssi_get_rssi(const uint8_t *event) {
  return event[16];
}


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

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

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

LLVM IR (-O2):
define i32 @hci_event_inquiry_result_with_rssi_get_rssi(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 16
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ LDA_();
int /*<<< orphan*/ c64_memIndirectZeroX();
void LDA_izx(void) {
  c64_memIndirectZeroX();
  LDA_();
}


x86 assembly (clang, -O0):
<LDA_izx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <c64_memIndirectZeroX@plt>
mov    $0x0,%al
call   1040 <LDA_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LDA_izx>:
push   %rax
xor    %eax,%eax
call   1030 <c64_memIndirectZeroX@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <LDA_@plt>

LLVM IR (-O0):
define void @LDA_izx() {
%1 = call i32 (...) @c64_memIndirectZeroX()
%2 = call i32 (...) @LDA_()
ret void
}

LLVM IR (-O2):
define void @LDA_izx() {
%1 = tail call i32 (...) @c64_memIndirectZeroX()
%2 = tail call i32 (...) @LDA_()
ret void
}
int UTF8_IS_TRAILING(unsigned char c) { return c >> 7 & ~c >> 6; }


x86 assembly (clang, -O0):
<UTF8_IS_TRAILING>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x7,%eax
movzbl -0x1(%rbp),%ecx
xor    $0xffffffff,%ecx
sar    $0x6,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTF8_IS_TRAILING>:
mov    %edi,%eax
shr    $0x7,%eax
shr    $0x6,%edi
not    %edi
and    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @UTF8_IS_TRAILING(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = lshr i32 %2, 7
%4 = lshr i32 %2, 6
%5 = xor i32 %4, -1
%6 = and i32 %3, %5
ret i32 %6
}
char precedence(char elem) {
  switch (elem) {
  case '+':
  case '-':
    return 1;
  case '*':
  case '/':
    return 2;
  case '^':
    return 3;
  case ')':
  case '#':
    return 0;
  }
}


x86 assembly (clang, -O0):
<precedence>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffffdd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3b,%eax
ja     1153 <precedence+0x53>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x1,-0x1(%rbp)
jmp    1153 <precedence+0x53>
movb   $0x2,-0x1(%rbp)
jmp    1153 <precedence+0x53>
movb   $0x3,-0x1(%rbp)
jmp    1153 <precedence+0x53>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<precedence>:
mov    $0x1,%al
lea    -0x23(%rdi),%ecx
cmp    $0xc,%ecx
ja     1120 <precedence+0x20>
lea    0xeef(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
xor    %eax,%eax
ret
mov    $0x2,%al
ret
cmp    $0x5e,%edi
jne    111c <precedence+0x1c>
mov    $0x3,%al
ret

LLVM IR (-O0):
define signext i8 @precedence(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 43, label %6
i32 45, label %6
i32 42, label %7
i32 47, label %7
i32 94, label %8
i32 41, label %9
i32 35, label %9
]
6: ; preds = %1, %1
store i8 1, i8* %2
br label %10
7: ; preds = %1, %1
store i8 2, i8* %2
br label %10
8: ; preds = %1
store i8 3, i8* %2
br label %10
9: ; preds = %1, %1
store i8 0, i8* %2
br label %10
10: ; preds = %6, %7, %8, %9, %1
%11 = load i8, i8* %2
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @precedence(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 35, label %5
i32 41, label %5
i32 42, label %3
i32 47, label %3
i32 94, label %4
]
3: ; preds = %1, %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1, %1
br label %6
6: ; preds = %3, %4, %5, %1
%7 = phi i8 [ 0, %5 ], [ 3, %4 ], [ 2, %3 ], [ 1, %1 ]
ret i8 %7
}
extern void writel(unsigned short b, unsigned long addr) {
  *(volatile unsigned int *)(addr + ((0xfffffc0000000000UL) + 0x300000000UL)) =
      b;
}


x86 assembly (clang, -O0):
<writel>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%ecx
movabs $0xfffffc0300000000,%rax
fc ff ff
add    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writel>:
movabs $0xfffffc0300000000,%rax
fc ff ff
mov    %edi,(%rsi,%rax,1)
ret

LLVM IR (-O0):
define void @writel(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = add i64 %7, -4385161609216
%9 = inttoptr i64 %8 to i32*
store volatile i32 %6, i32* %9
ret void
}

LLVM IR (-O2):
define void @writel(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = add i64 %1, -4385161609216
%5 = inttoptr i64 %4 to i32*
store volatile i32 %3, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trace_initialize();
void trace_memtransfer_init(void) { trace_initialize(); }


x86 assembly (clang, -O0):
<trace_memtransfer_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <trace_initialize@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_memtransfer_init>:
xor    %eax,%eax
jmp    1030 <trace_initialize@plt>

LLVM IR (-O0):
define void @trace_memtransfer_init() {
%1 = call i32 (...) @trace_initialize()
ret void
}

LLVM IR (-O2):
define void @trace_memtransfer_init() {
%1 = tail call i32 (...) @trace_initialize()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void glulx_free(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<glulx_free>:
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):
<glulx_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @glulx_free(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 @glulx_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void _falmbDefaultDrawImageString() { return; }


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

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

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

LLVM IR (-O2):
define void @_falmbDefaultDrawImageString() {
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int flag;
  int c, x, y;
  flag = 1;
  c = 0;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (flag != 0) {
    if (x >= y) {
      flag = 0;
    }
    x = x + 1;
    c = c + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1175 <main+0x65>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     115e <main+0x4e>
movl   $0x0,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <main+0x31>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %4
%7 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %7, i32* %5
br label %8
8: ; preds = %16, %0
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %8
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = icmp sge i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 0, i32* %2
br label %16
16: ; preds = %15, %11
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %8
21: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
void gtk_icon_set_new_from_pixbuf() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_set_new_from_pixbuf() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int string_equal(const char *str1, const char *str2) {
  return strcmp(str1, str2) == 0;
}


x86 assembly (clang, -O0):
<string_equal>:
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 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_equal>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @string_equal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @string_equal(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void zero_string_to_nullc(char *X) {
  for (; *X != '\0'; X++) {
    *X = '\0';
  }
}


x86 assembly (clang, -O0):
<zero_string_to_nullc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1130 <zero_string_to_nullc+0x30>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <zero_string_to_nullc+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_string_to_nullc>:
cmpb   $0x0,(%rdi)
je     111d <zero_string_to_nullc+0x1d>
add    $0x1,%rdi
nopl   0x0(%rax)
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <zero_string_to_nullc+0x10>
ret

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

LLVM IR (-O2):
define void @zero_string_to_nullc(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
store i8 0, i8* %5
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
void fc211(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
a : {
  typedef int(*f)[n];
  {
    typedef int(*g)[n];
    0;
  };
  {
    typedef int(*h)[n];
    0;
  };
  goto a;
  ;
  typedef int(*i)[n];
  0;
};
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc211>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc211+0x7>

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

LLVM IR (-O0):
define void @fc211(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %1
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
br label %11
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc211(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int onEnteringLP(const void *self) { return 20; }


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

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

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

LLVM IR (-O2):
define i32 @onEnteringLP(i8* nocapture readnone %0) {
ret i32 20
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void nomem(void *cc) { fprintf(stderr, "out of memory\n"); }


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

x86 assembly (clang, -O2):
<nomem>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define void @nomem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define void @nomem(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
};
typedef int in_addr_t;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
scalar_t__ __ipparse(struct sockaddr_in *, int /*<<< orphan*/, char const *);
in_addr_t inet_addr(const char *p) {
  struct sockaddr_in sin;
  if (__ipparse(&sin, AF_INET, p))
    return -1;
  return sin.sin_addr.s_addr;
}


x86 assembly (clang, -O0):
<inet_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rdi
call   1030 <__ipparse@plt>
cmp    $0x0,%rax
je     1148 <inet_addr+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <inet_addr+0x3e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_addr>:
push   %rax
mov    %rdi,%rdx
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdi
call   1030 <__ipparse@plt>
neg    %rax
sbb    %eax,%eax
or     (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
@AF_INET = global i32 0
define i32 @inet_addr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.sockaddr_in
store i8* %0, i8** %3
%5 = load i32, i32* @AF_INET
%6 = load i8*, i8** %3
%7 = call i64 @__ipparse(%struct.sockaddr_in* %4, i32 %5, i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %14
10: ; preds = %1
%11 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 0
%12 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %11, i32 0, i32 0
%13 = load i32, i32* %12
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
@AF_INET = global i32 0
define i32 @inet_addr(i8* %0) {
%2 = alloca %struct.sockaddr_in
%3 = bitcast %struct.sockaddr_in* %2 to i8*
%4 = load i32, i32* @AF_INET
%5 = call i64 @__ipparse(%struct.sockaddr_in* %2, i32 %4, i8* %0)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0, i32 0
%8 = load i32, i32* %7
%9 = select i1 %6, i32 %8, i32 -1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ qt();
int main(int argc, char *const *argv) {
  qt();
  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   1030 <qt@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <qt@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 (...) @qt()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @qt()
ret i32 0
}
void *h264_calloc(int n, int i_size) {
  unsigned char *buf;
  buf = (unsigned char *)h264_malloc(n * i_size);
  memset(buf, 0, n * i_size);
  return buf;
}


x86 assembly (clang, -O0):
<h264_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
imul   -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <h264_malloc@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
movslq %eax,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264_calloc>:
push   %rbx
mov    %edi,%ebx
imul   %esi,%ebx
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <h264_malloc@plt>
movslq %eax,%rdi
movslq %ebx,%rdx
xor    %esi,%esi
pop    %rbx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define i8* @h264_calloc(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 nsw i32 %6, %7
%9 = call i32 (i32, ...) bitcast (i32 (...)* @h264_malloc to i32 (i32, ...)*)(i32 %8)
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = mul nsw i32 %13, %14
%16 = sext i32 %15 to i64
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @h264_calloc(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @h264_malloc to i32 (i32, ...)*)(i32 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = sext i32 %3 to i64
tail call void @llvm.memset.p0i8.i64(i8* align 1 %6, i8 0, i64 %7, i1 false)
ret i8* %6
}
void *render_byte(int byte, void *dest) {
  *(unsigned char *)dest = (unsigned char)byte;
  return (unsigned char *)dest + 1;
}


x86 assembly (clang, -O0):
<render_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<render_byte>:
mov    %dil,(%rsi)
lea    0x1(%rsi),%rax
ret

LLVM IR (-O0):
define i8* @render_byte(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = trunc i32 %5 to i8
%7 = load i8*, i8** %4
store i8 %6, i8* %7
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 1
ret i8* %9
}

LLVM IR (-O2):
define i8* @render_byte(i32 %0, i8* writeonly %1) {
%3 = trunc i32 %0 to i8
store i8 %3, i8* %1
%4 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %4
}
/* Variables and functions */
int write(int, unsigned char *, int);
int WriteSword(int hFilename, unsigned dValue) {
  unsigned char cBuffer[2];
  cBuffer[0] = dValue & 0xFF;
  cBuffer[1] = (dValue >> 8) & 0xFF;
  return write(hFilename, cBuffer, 2);
}


x86 assembly (clang, -O0):
<WriteSword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x9(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xa(%rbp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteSword>:
push   %rax
mov    %si,0x6(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @WriteSword(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %8, i8* %9
%10 = load i32, i32* %4
%11 = lshr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 %13, i8* %14
%15 = load i32, i32* %3
%16 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%17 = call i32 @write(i32 %15, i8* %16, i32 2)
ret i32 %17
}

LLVM IR (-O2):
define i32 @WriteSword(i32 %0, i32 %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = trunc i32 %1 to i8
store i8 %5, i8* %4
%6 = lshr i32 %1, 8
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @write(i32 %0, i8* %4, i32 2)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void btic1g_free(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<btic1g_free>:
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):
<btic1g_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @btic1g_free(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 @btic1g_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ ebcdic_isupper(char);
__attribute__((always_)) char ebcdic_tolower(char c) {
  if (ebcdic_isupper(c))
    c -= 0x40;
  return c;
}


x86 assembly (clang, -O0):
<ebcdic_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <ebcdic_isupper@plt>
cmp    $0x0,%rax
je     113b <ebcdic_tolower+0x2b>
movsbl -0x1(%rbp),%eax
sub    $0x40,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ebcdic_tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <ebcdic_isupper@plt>
lea    -0x40(%rbx),%ecx
test   %rax,%rax
movzbl %cl,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @ebcdic_tolower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @ebcdic_isupper(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 64
%10 = trunc i32 %9 to i8
store i8 %10, i8* %2
br label %11
11: ; preds = %6, %1
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @ebcdic_tolower(i8 signext %0) {
%2 = tail call i64 @ebcdic_isupper(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = add i8 %0, -64
%5 = select i1 %3, i8 %0, i8 %4
ret i8 %5
}
void f1(int n, int b) {
  extern void f2(int);
  int j;
  if (b)
    n = 1;
  if (n < 1)
    __builtin_unreachable();
  for (j = 0; j < n; j++)
    f2(j);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <f1+0x1f>
movl   $0x1,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    1139 <f1+0x29>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1162 <f1+0x52>
mov    -0xc(%rbp),%edi
call   1030 <f2@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1140 <f1+0x30>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
mov    $0x1,%ebp
cmove  %edi,%ebp
xor    %ebx,%ebx
nop
mov    %ebx,%edi
call   1030 <f2@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1120 <f1+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @f1(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* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %9
9: ; preds = %8, %2
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %9
unreachable
13: ; preds = %9
store i32 0, i32* %5
br label %14
14: ; preds = %20, %13
%15 = load i32, i32* %5
%16 = load i32, i32* %3
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load i32, i32* %5
br label %20
20: ; preds = %18
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %14
23: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @f1(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 %0, i32 1
%5 = icmp sgt i32 %4, 0
tail call void @llvm.assume(i1 %5)
br label %6
6: ; preds = %2, %6
%7 = phi i32 [ 0, %2 ], [ %8, %6 ]
tail call void @f2(i32 %7)
%8 = add nuw nsw i32 %7, 1
%9 = icmp eq i32 %8, %4
br i1 %9, label %10, label %6
10: ; preds = %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_close_console();
void log_close(void) { log_close_console(); }


x86 assembly (clang, -O0):
<log_close>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <log_close_console@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_close>:
xor    %eax,%eax
jmp    1030 <log_close_console@plt>

LLVM IR (-O0):
define void @log_close() {
%1 = call i32 (...) @log_close_console()
ret void
}

LLVM IR (-O2):
define void @log_close() {
%1 = tail call i32 (...) @log_close_console()
ret void
}
int max3(int a, int b, int c) {
  int max = a;
  if (b > max)
    max = b;
  if (c > max)
    max = c;
  return max;
}


x86 assembly (clang, -O0):
<max3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1125 <max3+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1137 <max3+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max3>:
mov    %edi,%eax
cmp    %edi,%esi
cmovg  %esi,%eax
cmp    %edx,%eax
cmovl  %edx,%eax
ret

LLVM IR (-O0):
define i32 @max3(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
store i32 %8, i32* %7
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load i32, i32* %5
store i32 %13, i32* %7
br label %14
14: ; preds = %12, %3
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = icmp sgt i32 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load i32, i32* %6
store i32 %19, i32* %7
br label %20
20: ; preds = %18, %14
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @max3(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %0
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp slt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
int timetomultiple(const char *string) {
  switch (string[0]) {
  case 'm':
    return 60;
  case 'h':
    return 60 * 60;
  case 'd':
    return 60 * 60 * 24;
  default:
    break;
  }
  return 1;
}


x86 assembly (clang, -O0):
<timetomultiple>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x64,%eax
je     115a <timetomultiple+0x5a>
jmp    1120 <timetomultiple+0x20>
mov    -0x14(%rbp),%eax
sub    $0x68,%eax
je     114e <timetomultiple+0x4e>
jmp    1131 <timetomultiple+0x31>
mov    -0x14(%rbp),%eax
sub    $0x6d,%eax
jne    1166 <timetomultiple+0x66>
jmp    1142 <timetomultiple+0x42>
movl   $0x3c,-0x4(%rbp)
jmp    1172 <timetomultiple+0x72>
movl   $0xe10,-0x4(%rbp)
jmp    1172 <timetomultiple+0x72>
movl   $0x15180,-0x4(%rbp)
jmp    1172 <timetomultiple+0x72>
jmp    116b <timetomultiple+0x6b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timetomultiple>:
movsbl (%rdi),%eax
cmp    $0x64,%eax
je     1118 <timetomultiple+0x18>
cmp    $0x6d,%eax
je     111e <timetomultiple+0x1e>
cmp    $0x68,%eax
jne    1124 <timetomultiple+0x24>
mov    $0xe10,%eax
ret
mov    $0x15180,%eax
ret
mov    $0x3c,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @timetomultiple(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %11 [
i32 109, label %8
i32 104, label %9
i32 100, label %10
]
8: ; preds = %1
store i32 60, i32* %2
br label %13
9: ; preds = %1
store i32 3600, i32* %2
br label %13
10: ; preds = %1
store i32 86400, i32* %2
br label %13
11: ; preds = %1
br label %12
12: ; preds = %11
store i32 1, i32* %2
br label %13
13: ; preds = %12, %10, %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @timetomultiple(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
switch i32 %3, label %6 [
i32 109, label %7
i32 104, label %4
i32 100, label %5
]
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4
%8 = phi i32 [ 1, %6 ], [ 86400, %5 ], [ 3600, %4 ], [ 60, %1 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ const time_t;
struct tm {
  scalar_t__ tm_hour;
  scalar_t__ tm_min;
  scalar_t__ tm_sec;
};

/* Variables and functions */
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ const *, struct tm *);
int /*<<< orphan*/ const mktime(struct tm *);
int /*<<< orphan*/ const time(int /*<<< orphan*/ *);
int /*<<< orphan*/ tzset();
time_t time_at_start_of_day() {
  tzset();
  struct tm timedesc;
  time_t timenow = time(NULL);
  localtime_r(&timenow, &timedesc);
  timedesc.tm_sec = 0;
  timedesc.tm_min = 0;
  timedesc.tm_hour = 0;
  const time_t sod = mktime(&timedesc);
  return sod;
}


x86 assembly (clang, -O0):
<time_at_start_of_day>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <tzset@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <localtime_r@plt>
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1060 <mktime@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_at_start_of_day>:
push   %rbx
sub    $0x30,%rsp
xor    %eax,%eax
call   1040 <tzset@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1030 <localtime_r@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
mov    %rbx,%rdi
call   1060 <mktime@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i64, i64, i64 }
define i32 @time_at_start_of_day() {
%1 = alloca %struct.tm
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @tzset()
%5 = call i32 @time(i32* null)
store i32 %5, i32* %2
%6 = call i32 @localtime_r(i32* %2, %struct.tm* %1)
%7 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 2
store i64 0, i64* %7
%8 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 1
store i64 0, i64* %8
%9 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 0
store i64 0, i64* %9
%10 = call i32 @mktime(%struct.tm* %1)
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
%struct.tm = type { i64, i64, i64 }
define i32 @time_at_start_of_day() {
%1 = alloca %struct.tm
%2 = alloca i32
%3 = tail call i32 (...) @tzset()
%4 = bitcast %struct.tm* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = tail call i32 @time(i32* null)
store i32 %6, i32* %2
%7 = call i32 @localtime_r(i32* %2, %struct.tm* %1)
%8 = bitcast %struct.tm* %1 to i8*
%9 = call i32 @mktime(%struct.tm* %1)
ret i32 %9
}
/* Variables and functions */
scalar_t__ isspace(char const);
const char *skipSpace(const char *s) {
  while (isspace(*s)) {
    s++;
  }
  return s;
}


x86 assembly (clang, -O0):
<skipSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skipSpace+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipSpace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipSpace>:
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   %rax,%rax
jne    1120 <skipSpace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipSpace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ ems1Rep(char const *, char const *, int, int /*<<< orphan*/,
                           int *);
void emsRepv(const char *err, const char *text, va_list args, int *status) {
  ems1Rep(err, text, 1, args, status);
}


x86 assembly (clang, -O0):
<emsRepv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    $0x1,%edx
call   1030 <ems1Rep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emsRepv>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    $0x1,%edx
jmp    1030 <ems1Rep@plt>

LLVM IR (-O0):
define void @emsRepv(i8* %0, i8* %1, i32 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32*, i32** %8
%13 = call i32 @ems1Rep(i8* %9, i8* %10, i32 1, i32 %11, i32* %12)
ret void
}

LLVM IR (-O2):
define void @emsRepv(i8* %0, i8* %1, i32 %2, i32* %3) {
%5 = tail call i32 @ems1Rep(i8* %0, i8* %1, i32 1, i32 %2, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char, unsigned char);
void bit_shift(unsigned char input) {
  unsigned char output = 0;
  output = (1U << input) >> 1;
  printf("%u to %u \n", input, output);
}


x86 assembly (clang, -O0):
<bit_shift>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
shr    $0x1,%eax
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
lea    0xec3(%rip),%rdi
movzbl %al,%esi
movzbl -0x2(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_shift>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
shr    %eax
movzbl %al,%edx
lea    0xedb(%rip),%rdi
mov    %ecx,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%u to %u \0A\00"
define void @bit_shift(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = shl i32 1, %5
%7 = lshr i32 %6, 1
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %2
%10 = load i8, i8* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 zeroext %9, i8 zeroext %10)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%u to %u \0A\00"
define void @bit_shift(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = shl nuw i32 1, %2
%4 = lshr i32 %3, 1
%5 = trunc i32 %4 to i8
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 zeroext %0, i8 zeroext %5)
ret void
}
/* Variables and functions */
scalar_t__ IsSpanCompletelyOutside(int, int, int);
bool IsCompletelyOutside(int x, int y, int w, int h, int clipw, int cliph) {
  return IsSpanCompletelyOutside(x, w, clipw) ||
         IsSpanCompletelyOutside(y, h, cliph);
}


x86 assembly (clang, -O0):
<IsCompletelyOutside>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <IsSpanCompletelyOutside@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
jne    1164 <IsCompletelyOutside+0x54>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <IsSpanCompletelyOutside@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsCompletelyOutside>:
push   %rbp
push   %r14
push   %rbx
mov    %r9d,%r14d
mov    %ecx,%ebp
mov    %esi,%ebx
mov    %edx,%esi
mov    %r8d,%edx
call   1030 <IsSpanCompletelyOutside@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1149 <IsCompletelyOutside+0x39>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <IsSpanCompletelyOutside@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @IsCompletelyOutside(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i32, i32* %9
%15 = load i32, i32* %11
%16 = call i64 @IsSpanCompletelyOutside(i32 %13, i32 %14, i32 %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %24, label %18
18: ; preds = %6
%19 = load i32, i32* %8
%20 = load i32, i32* %10
%21 = load i32, i32* %12
%22 = call i64 @IsSpanCompletelyOutside(i32 %19, i32 %20, i32 %21)
%23 = icmp ne i64 %22, 0
br label %24
24: ; preds = %18, %6
%25 = phi i1 [ true, %6 ], [ %23, %18 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @IsCompletelyOutside(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i64 @IsSpanCompletelyOutside(i32 %0, i32 %2, i32 %4)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = tail call i64 @IsSpanCompletelyOutside(i32 %1, i32 %3, i32 %5)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %6
%14 = phi i32 [ 1, %6 ], [ %12, %9 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xa9() {
  Assert_real((isbdigit(169) == 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",
              850, ("isbdigit should be 0 for 0xa9"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xa9>:
push   %rax
mov    $0xa9,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x352,%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 0xa9\00"
define void @t_isbdigit_0xa9() {
%1 = call i64 @isbdigit(i32 169)
%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 850, 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 0xa9\00"
define void @t_isbdigit_0xa9() {
%1 = tail call i64 @isbdigit(i32 169)
%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 850, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ _chdir(char *);
int /*<<< orphan*/ _response(char *);
int do_cdup(void) {
  if (_chdir("..") < 0) {
    return -1;
  } else {
    _response("250 CDUP Command ok.\r\n");
    return 0;
  }
}


x86 assembly (clang, -O0):
<do_cdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <_chdir@plt>
cmp    $0x0,%rax
jge    114a <do_cdup+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <do_cdup+0x3d>
lea    0xeb2(%rip),%rdi
call   1030 <_response@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cdup>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <_chdir@plt>
test   %rax,%rax
js     1142 <do_cdup+0x22>
lea    0xeca(%rip),%rdi
call   1030 <_response@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"..\00"
@.str.1 = [23 x i8] c"250 CDUP Command ok.\0D\0A\00"
define i32 @do_cdup() {
%1 = alloca i32
%2 = call i64 @_chdir(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %7
5: ; preds = %0
%6 = call i32 @_response(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %7
7: ; preds = %5, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"..\00"
@.str.1 = [23 x i8] c"250 CDUP Command ok.\0D\0A\00"
define i32 @do_cdup() {
%1 = tail call i64 @_chdir(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = icmp slt i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @_response(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 0, %3 ], [ -1, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Error(char *);
int /*<<< orphan*/ perror(char *);
int semctl(int, int, int, int);
int Semctl(int semid, int semnum, int cmd, int pom) {
  int x = semctl(semid, semnum, cmd, pom);
  if (x < 0) {
    perror("");
    Error("Error on semctl");
  }
  return x;
}


x86 assembly (clang, -O0):
<Semctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1050 <semctl@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    117a <Semctl+0x4a>
lea    0xea6(%rip),%rdi
call   1040 <perror@plt>
lea    0xe8b(%rip),%rdi
call   1030 <Error@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Semctl>:
push   %rbx
call   1050 <semctl@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1140 <Semctl+0x10>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec8(%rip),%rdi
call   1040 <perror@plt>
lea    0xead(%rip),%rdi
call   1030 <Error@plt>
jmp    113c <Semctl+0xc>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [16 x i8] c"Error on semctl\00"
define i32 @Semctl(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @semctl(i32 %10, i32 %11, i32 %12, i32 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %4
%18 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @Error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %17, %4
%21 = load i32, i32* %9
ret i32 %21
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [16 x i8] c"Error on semctl\00"
define i32 @Semctl(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @semctl(i32 %0, i32 %1, i32 %2, i32 %3)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @Error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %7, %4
ret i32 %5
}