xunge/DecIR huggingface dataset:
/* Type definitions */
struct sd_buf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sd_bufput(struct sd_buf *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void sd_bufputs(struct sd_buf *sd_buf, const char *str) {
  sd_bufput(sd_buf, str, strlen(str));
}


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

x86 assembly (clang, -O2):
<sd_bufputs>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sd_bufput@plt>

LLVM IR (-O0):
%struct.sd_buf = type { i32 }
define void @sd_bufputs(%struct.sd_buf* %0, i8* %1) {
%3 = alloca %struct.sd_buf*
%4 = alloca i8*
store %struct.sd_buf* %0, %struct.sd_buf** %3
store i8* %1, i8** %4
%5 = load %struct.sd_buf*, %struct.sd_buf** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @sd_bufput(%struct.sd_buf* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.sd_buf = type { i32 }
define void @sd_bufputs(%struct.sd_buf* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @sd_bufput(%struct.sd_buf* %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ genByte(int);
void genInstruction(int a, int b) {
  if (b < 16) {
    genByte(a * 16 + b);
  } else {
    genInstruction(0, a);
    genByte(b);
  }
}


x86 assembly (clang, -O0):
<genInstruction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    114b <genInstruction+0x2b>
mov    -0x4(%rbp),%edi
shl    $0x4,%edi
add    -0x8(%rbp),%edi
call   1040 <genByte@plt>
jmp    115d <genInstruction+0x3d>
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1030 <genInstruction@plt>
mov    -0x8(%rbp),%edi
call   1040 <genByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genInstruction>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
cmp    $0xf,%ebx
jg     1131 <genInstruction+0x11>
shl    $0x4,%esi
add    %esi,%ebx
jmp    1138 <genInstruction+0x18>
xor    %edi,%edi
call   1030 <genInstruction@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <genByte@plt>

LLVM IR (-O0):
define void @genInstruction(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 16
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %3
%9 = mul nsw i32 %8, 16
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
%12 = call i32 @genByte(i32 %11)
br label %17
13: ; preds = %2
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @genByte(i32 %15)
br label %17
17: ; preds = %13, %7
ret void
}

LLVM IR (-O2):
define void @genInstruction(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 16
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = shl nsw i32 %0, 4
%6 = add nsw i32 %5, %1
br label %7
7: ; preds = %4, %10
%8 = phi i32 [ %6, %4 ], [ %1, %10 ]
%9 = tail call i32 @genByte(i32 %8)
ret void
10: ; preds = %2
tail call void @genInstruction(i32 0, i32 %0)
br label %7
}
/* Variables and functions */
int /*<<< orphan*/ box_unsigned_cell(int /*<<< orphan*/);
int /*<<< orphan*/ dpop();
int /*<<< orphan*/ object_size(int /*<<< orphan*/);
void primitive_size(void) { box_unsigned_cell(object_size(dpop())); }


x86 assembly (clang, -O0):
<primitive_size>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <dpop@plt>
mov    %eax,%edi
call   1040 <object_size@plt>
mov    %eax,%edi
call   1030 <box_unsigned_cell@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_size>:
push   %rax
xor    %eax,%eax
call   1050 <dpop@plt>
mov    %eax,%edi
call   1040 <object_size@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <box_unsigned_cell@plt>

LLVM IR (-O0):
define void @primitive_size() {
%1 = call i32 (...) @dpop()
%2 = call i32 @object_size(i32 %1)
%3 = call i32 @box_unsigned_cell(i32 %2)
ret void
}

LLVM IR (-O2):
define void @primitive_size() {
%1 = tail call i32 (...) @dpop()
%2 = tail call i32 @object_size(i32 %1)
%3 = tail call i32 @box_unsigned_cell(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void die(const char *error) {
  fputs(error, stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void ohci_hlwd_control_quirk(struct ohci_hcd *ohci) { return; }


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

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

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

LLVM IR (-O2):
%struct.ohci_hcd = type opaque
define void @ohci_hlwd_control_quirk(%struct.ohci_hcd* nocapture %0) {
ret void
}
struct regulator *regulator_get(struct device *dev, const char *id) {
  return (struct regulator *)id;
}


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

x86 assembly (clang, -O2):
<regulator_get>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
%struct.regulator = type opaque
%struct.device = type opaque
define %struct.regulator* @regulator_get(%struct.device* %0, i8* %1) {
%3 = alloca %struct.device*
%4 = alloca i8*
store %struct.device* %0, %struct.device** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to %struct.regulator*
ret %struct.regulator* %6
}

LLVM IR (-O2):
%struct.regulator = type opaque
%struct.device = type opaque
define %struct.regulator* @regulator_get(%struct.device* nocapture readnone %0, i8* readnone %1) {
%3 = bitcast i8* %1 to %struct.regulator*
ret %struct.regulator* %3
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
int isnumeric(char *str) {
  char *p = str;
  while (*p) {
    if (!isdigit(*p))
      return 0;
    p++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isnumeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <isnumeric+0x53>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1152 <isnumeric+0x42>
movl   $0x0,-0x4(%rbp)
jmp    116a <isnumeric+0x5a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1124 <isnumeric+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnumeric>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <isnumeric+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1149 <isnumeric+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <isnumeric+0x20>
jmp    114b <isnumeric+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isnumeric(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isdigit(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
void nop6502() {}


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

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

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

LLVM IR (-O2):
define void @nop6502() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int SIGINT;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sig_handler(int signo) {
  if (signo == SIGINT) {
    exit(EXIT_SUCCESS);
  }
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    113b <sig_handler+0x2b>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler>:
push   %rax
mov    0x2ed0(%rip),%rax
cmp    %edi,(%rax)
je     111e <sig_handler+0xe>
pop    %rax
ret
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@EXIT_SUCCESS = global i32 0
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@EXIT_SUCCESS = global i32 0
define void @sig_handler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xc1() {
  Assert_real((islower(193) == 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_islower.c",
              970, ("islower should be 0 for 0xc1"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xc1>:
push   %rax
mov    $0xc1,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3ca,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xc1\00"
define void @t_islower_0xc1() {
%1 = call i64 @islower(i32 193)
%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 970, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xc1\00"
define void @t_islower_0xc1() {
%1 = tail call i64 @islower(i32 193)
%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 970, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ foo();
int main(void) {
  int x;
  x = 0;
  x ? foo() : bar();
  x = 1;
  x ? foo() : bar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114c <main+0x2c>
mov    $0x0,%al
call   1040 <foo@plt>
jmp    1153 <main+0x33>
mov    $0x0,%al
call   1030 <bar@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1170 <main+0x50>
mov    $0x0,%al
call   1040 <foo@plt>
jmp    1177 <main+0x57>
mov    $0x0,%al
call   1030 <bar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 (...) @foo()
ret i32 0
}
int XScreenNumberOfScreen() {}


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

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

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

LLVM IR (-O2):
define i32 @XScreenNumberOfScreen() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x2d() {
  Assert_real((isprint(45)),
              "/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_isprint.c",
              230, ("isprint should be 1 for -"));
}


x86 assembly (clang, -O0):
<t_isprint_0x2d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2d,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xe6,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x2d>:
push   %rax
mov    $0x2d,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xe6,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for -\00"
define void @t_isprint_0x2d() {
%1 = call i32 @isprint(i32 45)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 230, i8* getelementptr inbounds ([26 x i8], [26 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for -\00"
define void @t_isprint_0x2d() {
%1 = tail call i32 @isprint(i32 45)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 230, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void fdmi_usleep(int usec) {
  usleep(usec);
  return;
}


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

x86 assembly (clang, -O2):
<fdmi_usleep>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @fdmi_usleep(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
void opj_default_callback(const char *msg, void *client_data) {
  (void)(msg);
  (void)(client_data);
}


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

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

LLVM IR (-O0):
define void @opj_default_callback(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
ret void
}

LLVM IR (-O2):
define void @opj_default_callback(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int alu_tne(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ op_pop();
int op_tne() { return alu_tne(op_pop(), op_pop()); }


x86 assembly (clang, -O0):
<op_tne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <op_pop@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <op_pop@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1030 <alu_tne@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_tne>:
push   %rbx
xor    %eax,%eax
call   1040 <op_pop@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <op_pop@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <alu_tne@plt>

LLVM IR (-O0):
define i32 @op_tne() {
%1 = call i32 (...) @op_pop()
%2 = call i32 (...) @op_pop()
%3 = call i32 @alu_tne(i32 %1, i32 %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @op_tne() {
%1 = tail call i32 (...) @op_pop()
%2 = tail call i32 (...) @op_pop()
%3 = tail call i32 @alu_tne(i32 %1, i32 %2)
ret i32 %3
}
/* Variables and functions */
char *malloc(unsigned long);
int /*<<< orphan*/ memcpy(char *, char const *, unsigned long);
int strlen(char const *);
char *strdup(register const char *s1) {
  register char *s;
  register unsigned long l = (strlen(s1) + 1) * sizeof(char);
  if ((s = malloc(l)) != NULL) {
    memcpy(s, s1, l);
  }
  return s;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     117a <strdup+0x4a>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <strdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
void *dlsym(handle, symbol) void *handle;
char *symbol;
{ return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @dlsym(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
int isupper(int ch) {
  if ((ch >= 'A') && (ch <= 'Z'))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1127 <isupper+0x27>
cmpl   $0x5a,-0x8(%rbp)
jg     1127 <isupper+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <isupper+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void imprime(int array[], int size) {
  for (int j = 0; j < size; j++)
    printf("%d, ", array[j]);
  printf("\n");
}


x86 assembly (clang, -O0):
<imprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <imprime+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <imprime+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprime>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <imprime+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <imprime+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d, \00"
define void @imprime(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_string(char s[]) {
  while (*s != '\0') {
    printf("%c", *(s++));
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <print_string+0x41>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    111c <print_string+0xc>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <print_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <print_string+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_string(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 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %3
14: ; preds = %3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ memset(char *, unsigned int, int);
int /*<<< orphan*/ printf(char *, char const *, unsigned int);
void _ssp_child_sub(char const *progname, unsigned int pattern) {
  char buf[32];
  printf("%s: Testing SSP (%#08x)\n", progname, pattern);
  memset(buf, pattern, sizeof(buf) + sizeof(void *) * 2);
}


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

x86 assembly (clang, -O2):
<_ssp_child_sub>:
push   %rbx
sub    $0x20,%rsp
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xecf(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %rsp,%rdi
mov    %ebx,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"%s: Testing SSP (%x)\0A\00"
define void @_ssp_child_sub(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [32 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%10 = load i32, i32* %4
%11 = call i32 @memset(i8* %9, i32 %10, i32 48)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"%s: Testing SSP (%x)\0A\00"
define void @_ssp_child_sub(i8* %0, i32 %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%6 = call i32 @memset(i8* %4, i32 %1, i32 48)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lgen2(char *, int, int);
void cgincps(int a, int v) { lgen2("addl\t$%d,%c%d", v, a); }


x86 assembly (clang, -O0):
<cgincps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <lgen2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgincps>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
jmp    1030 <lgen2@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"addl\09$%d,%c%d\00"
define void @cgincps(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @lgen2(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"addl\09$%d,%c%d\00"
define void @cgincps(i32 %0, i32 %1) {
%3 = tail call i32 @lgen2(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ str_new(size_t);
char *strncpy(int /*<<< orphan*/, char const *, size_t);
char *str_sub(const char *s, unsigned int start, size_t len) {
  if (s != NULL) {
    return strncpy(str_new(len), s + start, len);
  } else {
    return (NULL);
  }
}


x86 assembly (clang, -O0):
<str_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1165 <str_sub+0x45>
mov    -0x20(%rbp),%rdi
call   1040 <str_new@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
add    %rax,%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncpy@plt>
mov    %rax,-0x8(%rbp)
jmp    116d <str_sub+0x4d>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_sub>:
test   %rdi,%rdi
je     114f <str_sub+0x2f>
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1040 <str_new@plt>
mov    %ebp,%ecx
add    %rcx,%rbx
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <strncpy@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @str_sub(i8* %0, i32 %1, i64 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call i32 @str_new(i64 %2)
%7 = zext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = tail call i8* @strncpy(i32 %6, i8* %8, i64 %2)
br label %10
10: ; preds = %3, %5
%11 = phi i8* [ %9, %5 ], [ null, %3 ]
ret i8* %11
}
unsigned _citrus_NONE_ctype_get_mb_cur_max(void *cl) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @_citrus_NONE_ctype_get_mb_cur_max(i8* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ puts(char *);
scalar_t__ stat(char const *, struct stat *);
int is_on_filesystem(const char *path) {
  struct stat info;
  if (stat(path, &info) == 0) {
    return 1;
  } else {
    puts("Error: could not gather information about this file:");
    printf("%s\n", path);
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_on_filesystem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <stat@plt>
cmp    $0x0,%rax
jne    115f <is_on_filesystem+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1182 <is_on_filesystem+0x52>
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
mov    -0x10(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_on_filesystem>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1050 <stat@plt>
test   %rax,%rax
je     1166 <is_on_filesystem+0x36>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
lea    0xedb(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
jmp    116b <is_on_filesystem+0x3b>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [53 x i8] c"Error: could not gather information about this file:\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @is_on_filesystem(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %13
9: ; preds = %1
%10 = call i32 @puts(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %3
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
store i32 0, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [53 x i8] c"Error: could not gather information about this file:\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @is_on_filesystem(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %1, %6
%10 = phi i32 [ 0, %6 ], [ 1, %1 ]
ret i32 %10
}
void g_param_spec_int() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_int() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello,world ...\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 = [17 x i8] c"hello,world ...\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"hello,world ...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int dobldobl_Newton_step(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(198, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<dobldobl_Newton_step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xc6,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dobldobl_Newton_step>:
mov    $0xc6,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @dobldobl_Newton_step() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 198, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @dobldobl_Newton_step() {
%1 = tail call i32 @_ada_use_c2phc(i32 198, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int _get_u8(int /*<<< orphan*/ const *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
int _decode_dstring(const uint8_t *p, int field_length, uint8_t *str) {
  int length = _get_u8(p + field_length - 1);
  if (length > field_length - 1) {
    length = field_length - 1;
  }
  memcpy(str, p, length);
  return length;
}


x86 assembly (clang, -O0):
<_decode_dstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <_get_u8@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jle    1168 <_decode_dstring+0x48>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_decode_dstring>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%r15
movslq %esi,%rbx
lea    (%rdi,%rbx,4),%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <_get_u8@plt>
mov    %eax,%ebp
lea    -0x1(%rbx),%eax
cmp    %ebx,%ebp
cmovge %eax,%ebp
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @_decode_dstring(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = getelementptr inbounds i32, i32* %11, i64 -1
%13 = call i32 @_get_u8(i32* %12)
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = load i32, i32* %5
%16 = sub nsw i32 %15, 1
%17 = icmp sgt i32 %14, %16
br i1 %17, label %18, label %21
18: ; preds = %3
%19 = load i32, i32* %5
%20 = sub nsw i32 %19, 1
store i32 %20, i32* %7
br label %21
21: ; preds = %18, %3
%22 = load i32*, i32** %6
%23 = load i32*, i32** %4
%24 = load i32, i32* %7
%25 = call i32 @memcpy(i32* %22, i32* %23, i32 %24)
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @_decode_dstring(i32* %0, i32 %1, i32* %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = getelementptr inbounds i32, i32* %5, i64 -1
%7 = tail call i32 @_get_u8(i32* %6)
%8 = icmp slt i32 %7, %1
%9 = add nsw i32 %1, -1
%10 = select i1 %8, i32 %7, i32 %9
%11 = tail call i32 @memcpy(i32* %2, i32* %0, i32 %10)
ret i32 %10
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ deepth(struct TreeNode *, int *);
int diameterOfBinaryTree(struct TreeNode *root) {
  int maxPath = 0;
  if (root == NULL)
    return 0;
  deepth(root, &maxPath);
  return maxPath - 1;
}


x86 assembly (clang, -O0):
<diameterOfBinaryTree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113a <diameterOfBinaryTree+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1150 <diameterOfBinaryTree+0x40>
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <deepth@plt>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diameterOfBinaryTree>:
push   %rax
movl   $0x0,0x4(%rsp)
test   %rdi,%rdi
je     1131 <diameterOfBinaryTree+0x21>
lea    0x4(%rsp),%rsi
call   1030 <deepth@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32 @diameterOfBinaryTree(%struct.TreeNode* %0) {
%2 = alloca i32
%3 = alloca %struct.TreeNode*
%4 = alloca i32
store %struct.TreeNode* %0, %struct.TreeNode** %3
store i32 0, i32* %4
%5 = load %struct.TreeNode*, %struct.TreeNode** %3
%6 = icmp eq %struct.TreeNode* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %13
8: ; preds = %1
%9 = load %struct.TreeNode*, %struct.TreeNode** %3
%10 = call i32 @deepth(%struct.TreeNode* %9, i32* %4)
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
store i32 %12, i32* %2
br label %13
13: ; preds = %8, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32 @diameterOfBinaryTree(%struct.TreeNode* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = icmp eq %struct.TreeNode* %0, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = call i32 @deepth(%struct.TreeNode* %0, i32* %2)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -1
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ 0, %1 ]
ret i32 %10
}
int test_imm_63int64_lowword_mem(long long *val) {
  return ((*val) & (0x63 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_63int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 99
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int __VERIFIER_nondet_int();
int isOdd(int);
int main() {
  int n = __VERIFIER_nondet_int();
  if (n < 0) {
    return 0;
  }
  int result = isOdd(n);
  if (result >= 0) {
    return 0;
  } else {
  ERROR:
    __VERIFIER_error();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    115f <main+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    118c <main+0x5c>
mov    -0x8(%rbp),%edi
call   1030 <isOdd@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1180 <main+0x50>
movl   $0x0,-0x4(%rbp)
jmp    118c <main+0x5c>
jmp    1185 <main+0x55>
mov    $0x0,%al
call   1050 <__VERIFIER_error@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
js     114e <main+0x1e>
mov    %eax,%edi
call   1030 <isOdd@plt>
test   %eax,%eax
jns    114e <main+0x1e>
xor    %eax,%eax
call   1050 <__VERIFIER_error@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp slt i32 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 @isOdd(i32 %1)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 (...) @__VERIFIER_error()
br label %8
8: ; preds = %6, %3, %0
ret i32 0
}
/* Variables and functions */
char *m_strdup_(char *, char *, int);
char *m_strdup_compat(char *source) {
  return m_strdup_(source,
                   "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/"
                   "heads/master/dg/z88dk/src/z80asm/lib/alloc.c",
                   273);
}


x86 assembly (clang, -O0):
<m_strdup_compat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x111,%edx
call   1030 <m_strdup_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_strdup_compat>:
lea    0xee9(%rip),%rsi
mov    $0x111,%edx
jmp    1030 <m_strdup_@plt>

LLVM IR (-O0):
@.str = [158 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/src/z80asm/lib/alloc.c\00"
define i8* @m_strdup_compat(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @m_strdup_(i8* %3, i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 273)
ret i8* %4
}

LLVM IR (-O2):
@.str = [158 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/src/z80asm/lib/alloc.c\00"
define i8* @m_strdup_compat(i8* %0) {
%2 = tail call i8* @m_strdup_(i8* %0, i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 273)
ret i8* %2
}