xunge/DecIR huggingface dataset:
int test_imm_D1int8_mem(signed char *val) {
  return ((*val) & (0xD1 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D1int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -47
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void startClamd() { system("/usr/local/clamav/sbin/clamd"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"/usr/local/clamav/sbin/clamd\00"
define void @startClamd() {
%1 = call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"/usr/local/clamav/sbin/clamd\00"
define void @startClamd() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
int skip_nl(char *s) {
  if (s[0] == '\n')
    return 1;
  if (s[0] == '\r' && s[1] == '\n')
    return 2;
  if (s[0] == '\0')
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<skip_nl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1124 <skip_nl+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1174 <skip_nl+0x74>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    1151 <skip_nl+0x51>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0xa,%eax
jne    1151 <skip_nl+0x51>
movl   $0x2,-0x4(%rbp)
jmp    1174 <skip_nl+0x74>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    116d <skip_nl+0x6d>
movl   $0x0,-0x4(%rbp)
jmp    1174 <skip_nl+0x74>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_nl>:
mov    (%rdi),%cl
cmp    $0xa,%cl
je     111c <skip_nl+0x1c>
cmp    $0xd,%cl
jne    1117 <skip_nl+0x17>
mov    $0x2,%eax
cmpb   $0xa,0x1(%rdi)
je     111b <skip_nl+0x1b>
neg    %cl
sbb    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @skip_nl(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
%8 = icmp eq i32 %7, 10
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %31
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 13
br i1 %15, label %16, label %23
16: ; preds = %10
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 10
br i1 %21, label %22, label %23
22: ; preds = %16
store i32 2, i32* %2
br label %31
23: ; preds = %16, %10
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 0
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %23
store i32 0, i32* %2
br label %31
30: ; preds = %23
store i32 -1, i32* %2
br label %31
31: ; preds = %30, %29, %22, %9
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @skip_nl(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %7 [
i8 10, label %10
i8 13, label %3
]
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 10
br i1 %6, label %10, label %7
7: ; preds = %1, %3
%8 = icmp ne i8 %2, 0
%9 = sext i1 %8 to i32
br label %10
10: ; preds = %7, %3, %1
%11 = phi i32 [ 1, %1 ], [ 2, %3 ], [ %9, %7 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ activate_runtime_suspend_path(char *);
void activate_runtime_suspend(void) {
  activate_runtime_suspend_path("/sys/bus/pci/devices");
  activate_runtime_suspend_path("/sys/bus/spi/devices");
  activate_runtime_suspend_path("/sys/bus/i2c/devices");
}


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

x86 assembly (clang, -O2):
<activate_runtime_suspend>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <activate_runtime_suspend_path@plt>
lea    0xef1(%rip),%rdi
call   1030 <activate_runtime_suspend_path@plt>
lea    0xefa(%rip),%rdi
pop    %rax
jmp    1030 <activate_runtime_suspend_path@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"/sys/bus/pci/devices\00"
@.str.1 = [21 x i8] c"/sys/bus/spi/devices\00"
@.str.2 = [21 x i8] c"/sys/bus/i2c/devices\00"
define void @activate_runtime_suspend() {
%1 = call i32 @activate_runtime_suspend_path(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @activate_runtime_suspend_path(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @activate_runtime_suspend_path(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"/sys/bus/pci/devices\00"
@.str.1 = [21 x i8] c"/sys/bus/spi/devices\00"
@.str.2 = [21 x i8] c"/sys/bus/i2c/devices\00"
define void @activate_runtime_suspend() {
%1 = tail call i32 @activate_runtime_suspend_path(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @activate_runtime_suspend_path(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @activate_runtime_suspend_path(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int add_2d_table(name, file)
char *name, *file;
{
  plintf(" TWO D NOT HERE YET \n");
  return (1);
}


x86 assembly (clang, -O0):
<add_2d_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <plintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_2d_table>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <plintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c" TWO D NOT HERE YET \0A\00"
define i32 @add_2d_table(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @plintf to i32 (i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [22 x i8] c" TWO D NOT HERE YET \0A\00"
define i32 @add_2d_table(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @plintf to i32 (i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Type definitions */
struct passwd {
  int pw_uid;
};

/* Variables and functions */
struct passwd *getpwnam(char *);
unsigned get_radio_uid() {
  struct passwd *ppwd = getpwnam("radio");
  if (NULL == ppwd)
    return 1001;
  return ppwd->pw_uid;
}


x86 assembly (clang, -O0):
<get_radio_uid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getpwnam@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1140 <get_radio_uid+0x30>
movl   $0x3e9,-0x4(%rbp)
jmp    1149 <get_radio_uid+0x39>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_radio_uid>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getpwnam@plt>
test   %rax,%rax
je     1126 <get_radio_uid+0x16>
mov    (%rax),%eax
pop    %rcx
ret
mov    $0x3e9,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
@.str = [6 x i8] c"radio\00"
define i32 @get_radio_uid() {
%1 = alloca i32
%2 = alloca %struct.passwd*
%3 = call %struct.passwd* @getpwnam(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store %struct.passwd* %3, %struct.passwd** %2
%4 = load %struct.passwd*, %struct.passwd** %2
%5 = icmp eq %struct.passwd* null, %4
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1001, i32* %1
br label %11
7: ; preds = %0
%8 = load %struct.passwd*, %struct.passwd** %2
%9 = getelementptr inbounds %struct.passwd, %struct.passwd* %8, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %1
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
@.str = [6 x i8] c"radio\00"
define i32 @get_radio_uid() {
%1 = tail call %struct.passwd* @getpwnam(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq %struct.passwd* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = getelementptr inbounds %struct.passwd, %struct.passwd* %1, i64 0, i32 0
%5 = load i32, i32* %4
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ %5, %3 ], [ 1001, %0 ]
ret i32 %7
}
char *p2cstr(s)
char *s;
{
  long len = s[0];
  register char *p, *q;
  p = &s[0];
  q = &s[1];
  while (len--) {
    *p++ = *q++;
  }
  *p = 0;
  return s;
}


x86 assembly (clang, -O0):
<p2cstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbq (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     1168 <p2cstr+0x68>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1128 <p2cstr+0x28>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<p2cstr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbq (%rdi),%r14
mov    %rdi,%rax
test   %r14,%r14
je     1138 <p2cstr+0x28>
lea    0x1(%rbx),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <memmove@plt>
add    %rbx,%r14
mov    %r14,%rax
movb   $0x0,(%rax)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @p2cstr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i64
%4 = icmp eq i8 %2, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = getelementptr i8, i8* %0, i64 1
%7 = getelementptr i8, i8* %0, i64 %3
br label %8
8: ; preds = %5, %1
%9 = phi i8* [ %0, %1 ], [ %7, %5 ]
store i8 0, i8* %9
ret i8* %0
}
int le() {
  const union {
    int x;
    char e;
  } l = {1};
  return l.e;
}


x86 assembly (clang, -O0):
<le>:
push   %rbp
mov    %rsp,%rbp
mov    0xef6(%rip),%eax
mov    %eax,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
@__const.le.l = %union.anon { i32 1 }
define i32 @le() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i8*
%3 = bitcast %union.anon* %1 to i8*
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @le() {
ret i32 1
}
unsigned int scan_ulong(register const char *s, register unsigned long *u) {
  register unsigned long c = 0;
  register unsigned int pos = 0;
  register unsigned long result = 0;
  while ((c = (unsigned long)(unsigned char)(s[pos] - '0')) < 10) {
    result = result * 10 + c;
    pos++;
  }
  *u = result;
  return pos;
}


x86 assembly (clang, -O0):
<scan_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
sub    $0x30,%eax
movzbl %al,%eax
mov    %rax,-0x18(%rbp)
cmp    $0xa,%rax
jae    115d <scan_ulong+0x5d>
imul   $0xa,-0x28(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1123 <scan_ulong+0x23>
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_ulong>:
mov    (%rdi),%dl
add    $0xd0,%dl
cmp    $0x9,%dl
ja     112e <scan_ulong+0x2e>
xor    %ecx,%ecx
xor    %eax,%eax
xchg   %ax,%ax
movzbl %dl,%edx
lea    (%rcx,%rcx,4),%rcx
lea    (%rdx,%rcx,2),%rcx
add    $0x1,%eax
movzbl (%rdi,%rax,1),%edx
add    $0xd0,%dl
cmp    $0xa,%dl
jb     1110 <scan_ulong+0x10>
mov    %rcx,(%rsi)
ret
xor    %eax,%eax
xor    %ecx,%ecx
mov    %rcx,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @scan_ulong(i8* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %19
6: ; preds = %2, %6
%7 = phi i8 [ %17, %6 ], [ %4, %2 ]
%8 = phi i64 [ %12, %6 ], [ 0, %2 ]
%9 = phi i32 [ %13, %6 ], [ 0, %2 ]
%10 = zext i8 %7 to i64
%11 = mul i64 %8, 10
%12 = add i64 %11, %10
%13 = add i32 %9, 1
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = add i8 %16, -48
%18 = icmp ult i8 %17, 10
br i1 %18, label %6, label %19
19: ; preds = %6, %2
%20 = phi i32 [ 0, %2 ], [ %13, %6 ]
%21 = phi i64 [ 0, %2 ], [ %12, %6 ]
store i64 %21, i64* %1
ret i32 %20
}
/* Type definitions */
struct lm {
  int dummy;
};

/* Variables and functions */
char *lm_find_n(struct lm *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *lm_find(struct lm *map, const char *key) {
  return lm_find_n(map, key, strlen(key));
}


x86 assembly (clang, -O0):
<lm_find>:
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   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <lm_find_n@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.lm = type { i32 }
define i8* @lm_find(%struct.lm* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i8* @lm_find_n(%struct.lm* %0, i8* %1, i32 %3)
ret i8* %4
}
int get_range_eol(cpp, ip, jp)
char **cpp;
int *ip, *jp;
{
  if (!get_range(cpp, ip, jp)) {
    return 0;
  }
  if (extra_characters(*cpp)) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<get_range_eol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1030 <get_range@plt>
cmp    $0x0,%eax
jne    115c <get_range_eol+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1186 <get_range_eol+0x66>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1040 <extra_characters@plt>
cmp    $0x0,%eax
je     117f <get_range_eol+0x5f>
movl   $0x0,-0x4(%rbp)
jmp    1186 <get_range_eol+0x66>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_range_eol>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <get_range@plt>
test   %eax,%eax
je     1145 <get_range_eol+0x25>
mov    (%r14),%rdi
xor    %eax,%eax
call   1040 <extra_characters@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @get_range_eol(i8** %0, i32* %1, i32* %2) {
%4 = tail call i32 (i8**, i32*, i32*, ...) bitcast (i32 (...)* @get_range to i32 (i8**, i32*, i32*, ...)*)(i8** %0, i32* %1, i32* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = load i8*, i8** %0
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @extra_characters to i32 (i8*, ...)*)(i8* %7)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %6, %3
%12 = phi i32 [ 0, %3 ], [ %10, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_warnIfReached();
void avoidInfeasibleConstraintforGT(int a, int b) {
  int c = b - a;
  if (c <= 0)
    return;
  if (a != b) {
    clang_analyzer_warnIfReached();
    return;
  }
  clang_analyzer_warnIfReached();
  if (c < 0)
    ;
}


x86 assembly (clang, -O0):
<avoidInfeasibleConstraintforGT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1136 <avoidInfeasibleConstraintforGT+0x26>
jmp    1164 <avoidInfeasibleConstraintforGT+0x54>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     114e <avoidInfeasibleConstraintforGT+0x3e>
mov    $0x0,%al
call   1030 <clang_analyzer_warnIfReached@plt>
jmp    1164 <avoidInfeasibleConstraintforGT+0x54>
mov    $0x0,%al
call   1030 <clang_analyzer_warnIfReached@plt>
cmpl   $0x0,-0xc(%rbp)
jge    1164 <avoidInfeasibleConstraintforGT+0x54>
jmp    1164 <avoidInfeasibleConstraintforGT+0x54>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avoidInfeasibleConstraintforGT>:
cmp    %edi,%esi
jle    111b <avoidInfeasibleConstraintforGT+0xb>
xor    %eax,%eax
jmp    1030 <clang_analyzer_warnIfReached@plt>
ret

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

LLVM IR (-O2):
define void @avoidInfeasibleConstraintforGT(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @clang_analyzer_warnIfReached()
br label %6
6: ; preds = %2, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int, double, char, int, double);
int main() {
  foo(3, 1, 2.0, 'a', 4, 5.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
mov    $0x1,%esi
movsd  0xecf(%rip),%xmm0
mov    $0x61,%edx
mov    $0x4,%ecx
movsd  0xec5(%rip),%xmm1
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
movsd  0xee7(%rip),%xmm1
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x61,%edx
mov    $0x4,%ecx
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 3, i32 1, double 2.000000e+00, i8 signext 97, i32 4, double 5.000000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 3, i32 1, double 2.000000e+00, i8 signext 97, i32 4, double 5.000000e+00)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void DieWithError(char *errorMessage) { printf(errorMessage); }


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

x86 assembly (clang, -O2):
<DieWithError>:
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
define void @DieWithError(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret void
}
/* Variables and functions */
char *strncpy(char *, char const *, size_t);
char *CString_strncpy(char *restrict dest, const char *restrict src, size_t n) {
  return strncpy(dest, src, n);
}


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

x86 assembly (clang, -O2):
<CString_strncpy>:
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
define i8* @CString_strncpy(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i8* @strncpy(i8* %7, i8* %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @CString_strncpy(i8* noalias returned %0, i8* noalias nocapture %1, i64 %2) {
%4 = tail call i8* @strncpy(i8* dereferenceable(1) %0, i8* %1, i64 %2)
ret i8* %0
}
/* Type definitions */
struct hash {
  int dummy;
};

/* Variables and functions */
void *hash_find_bin(struct hash const *, char const *, size_t);
size_t strlen(char const *);
void *hash_find(const struct hash *hash, const char *key) {
  size_t keylen = strlen(key);
  return hash_find_bin(hash, key, keylen);
}


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

x86 assembly (clang, -O2):
<hash_find>:
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    %rax,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <hash_find_bin@plt>

LLVM IR (-O0):
%struct.hash = type { i32 }
define i8* @hash_find(%struct.hash* %0, i8* %1) {
%3 = alloca %struct.hash*
%4 = alloca i8*
%5 = alloca i64
store %struct.hash* %0, %struct.hash** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i64 @strlen(i8* %6)
store i64 %7, i64* %5
%8 = load %struct.hash*, %struct.hash** %3
%9 = load i8*, i8** %4
%10 = load i64, i64* %5
%11 = call i8* @hash_find_bin(%struct.hash* %8, i8* %9, i64 %10)
ret i8* %11
}

LLVM IR (-O2):
%struct.hash = type { i32 }
define i8* @hash_find(%struct.hash* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i8* @hash_find_bin(%struct.hash* %0, i8* %1, i64 %3)
ret i8* %4
}
unsigned short foo(unsigned short x) {
  x ^= 0x4002;
  x >>= 1;
  x |= 0x8000;
  return x;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
xor    $0x4002,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x1,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
or     $0x8000,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
shr    %eax
xor    $0xa001,%eax
ret

LLVM IR (-O0):
define zeroext i16 @foo(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = xor i32 %4, 16386
%6 = trunc i32 %5 to i16
store i16 %6, i16* %2
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 1
%10 = trunc i32 %9 to i16
store i16 %10, i16* %2
%11 = load i16, i16* %2
%12 = zext i16 %11 to i32
%13 = or i32 %12, 32768
%14 = trunc i32 %13 to i16
store i16 %14, i16* %2
%15 = load i16, i16* %2
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @foo(i16 zeroext %0) {
%2 = lshr i16 %0, 1
%3 = xor i16 %2, -24575
ret i16 %3
}
/* Type definitions */
struct perf_event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ msr_event_update(struct perf_event *);
void msr_event_stop(struct perf_event *event, int flags) {
  msr_event_update(event);
}


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

x86 assembly (clang, -O2):
<msr_event_stop>:
jmp    1030 <msr_event_update@plt>

LLVM IR (-O0):
%struct.perf_event = type { i32 }
define void @msr_event_stop(%struct.perf_event* %0, i32 %1) {
%3 = alloca %struct.perf_event*
%4 = alloca i32
store %struct.perf_event* %0, %struct.perf_event** %3
store i32 %1, i32* %4
%5 = load %struct.perf_event*, %struct.perf_event** %3
%6 = call i32 @msr_event_update(%struct.perf_event* %5)
ret void
}

LLVM IR (-O2):
%struct.perf_event = type { i32 }
define void @msr_event_stop(%struct.perf_event* %0, i32 %1) {
%3 = tail call i32 @msr_event_update(%struct.perf_event* %0)
ret void
}
/* Variables and functions */
char getchar();
int clear_stdin() {
  while (getchar() != '\n')
    ;
  return 0;
}


x86 assembly (clang, -O0):
<clear_stdin>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <clear_stdin+0x9>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1131 <clear_stdin+0x21>
jmp    1119 <clear_stdin+0x9>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_stdin>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <clear_stdin+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @clear_stdin() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret i32 0
}

LLVM IR (-O2):
define i32 @clear_stdin() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret i32 0
}
float f(float x) { return x + 1 / x; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
divss  -0x4(%rbp),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movss  0xef8(%rip),%xmm1
divss  %xmm0,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fdiv float 1.000000e+00, %4
%6 = fadd float %3, %5
ret float %6
}

LLVM IR (-O2):
define float @f(float %0) {
%2 = fdiv float 1.000000e+00, %0
%3 = fadd float %2, %0
ret float %3
}
/* Variables and functions */
int floor(double x) { return (int)x; }


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

x86 assembly (clang, -O2):
<floor>:
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @floor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @floor(double %0) {
%2 = fptosi double %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xdb() {
  Assert_real((islower(219) == 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",
              1100, ("islower should be 0 for 0xdb"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xdb>:
push   %rax
mov    $0xdb,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x44c,%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 0xdb\00"
define void @t_islower_0xdb() {
%1 = call i64 @islower(i32 219)
%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 1100, 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 0xdb\00"
define void @t_islower_0xdb() {
%1 = tail call i64 @islower(i32 219)
%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 1100, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void world_generate() {}


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

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

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

LLVM IR (-O2):
define void @world_generate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ append_char(char **, size_t *, size_t *, int /*<<< orphan*/);
int /*<<< orphan*/ memmove(char *, char *, size_t);
void prepend_char(char **buf, size_t *l, size_t *i, char c) {
  append_char(buf, l, i, 0);
  memmove((*buf) + 1, *buf, *i);
  (*buf)[0] = c;
}


x86 assembly (clang, -O0):
<prepend_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <append_char@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
add    $0x1,%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
call   1040 <memmove@plt>
mov    -0x19(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prepend_char>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rdi,%rbp
xor    %ecx,%ecx
call   1030 <append_char@plt>
mov    0x0(%rbp),%rsi
lea    0x1(%rsi),%rdi
mov    (%rbx),%rdx
call   1040 <memmove@plt>
mov    0x0(%rbp),%rax
mov    %r14b,(%rax)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @prepend_char(i8** %0, i64* %1, i64* %2, i8 signext %3) {
%5 = alloca i8**
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i8
store i8** %0, i8*** %5
store i64* %1, i64** %6
store i64* %2, i64** %7
store i8 %3, i8* %8
%9 = load i8**, i8*** %5
%10 = load i64*, i64** %6
%11 = load i64*, i64** %7
%12 = call i32 @append_char(i8** %9, i64* %10, i64* %11, i32 0)
%13 = load i8**, i8*** %5
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8**, i8*** %5
%17 = load i8*, i8** %16
%18 = load i64*, i64** %7
%19 = load i64, i64* %18
%20 = call i32 @memmove(i8* %15, i8* %17, i64 %19)
%21 = load i8, i8* %8
%22 = load i8**, i8*** %5
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8, i8* %23, i64 0
store i8 %21, i8* %24
ret void
}

LLVM IR (-O2):
define void @prepend_char(i8** %0, i64* %1, i64* %2, i8 signext %3) {
%5 = tail call i32 @append_char(i8** %0, i64* %1, i64* %2, i32 0)
%6 = load i8*, i8** %0
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i64, i64* %2
%9 = tail call i32 @memmove(i8* %7, i8* %6, i64 %8)
%10 = load i8*, i8** %0
store i8 %3, i8* %10
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rotl32(uint32_t a, uint32_t n) { return ((a << n) | (a >> (32 - n))); }


x86 assembly (clang, -O0):
<rotl32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rotl32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotl32(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usg() {
  fprintf(stderr, "ply2off FILE.ply\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usg>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usg>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"ply2off FILE.ply\0A\00"
define void @usg() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"ply2off FILE.ply\0A\00"
define void @usg() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int32_t hush_help(int8_t **args) {
  printf(" _               _     \n| |             | |    \n| |__  _   _ ___| "
         "|__  \n| '_ \\| | | / __| '_ \\ \n| | | | |_| \\__ \\ | | |\n|_| "
         "|_|\\__,_|___/_| |_|, v.0.01\n\nCommands:\n===BUILTINS===\nhelp\ncd "
         "[path]\nexit\n===OTHER===\ncommand &\ncommand < inputfile [> "
         "outputfile]\ncmd1 [| cmd2 [|cmd3 ... ]]\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<hush_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [284 x i8] c" _ _ \0A| | | | \0A| |__ _ _ ___| |__ \0A| '_ \\| | | / __| '_ \\ \0A| | | | |_| \\__ \\ | | |\0A|_| |_|\\__,_|___/_| |_|, v.0.01\0A\0ACommands:\0A===BUILTINS===\0Ahelp\0Acd [path]\0Aexit\0A===OTHER===\0Acommand &\0Acommand < inputfile [> outputfile]\0Acmd1 [| cmd2 [|cmd3 ... ]]\0A\0A\00"
define i32 @hush_help(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([284 x i8], [284 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [283 x i8] c" _ _ \0A| | | | \0A| |__ _ _ ___| |__ \0A| '_ \\| | | / __| '_ \\ \0A| | | | |_| \\__ \\ | | |\0A|_| |_|\\__,_|___/_| |_|, v.0.01\0A\0ACommands:\0A===BUILTINS===\0Ahelp\0Acd [path]\0Aexit\0A===OTHER===\0Acommand &\0Acommand < inputfile [> outputfile]\0Acmd1 [| cmd2 [|cmd3 ... ]]\0A\00"
define i32 @hush_help(i32** nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([283 x i8], [283 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void prompt_print() { printf("peabot > "); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"peabot > \00"
define void @prompt_print() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"peabot > \00"
define void @prompt_print() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef char const int32_t;

/* Variables and functions */
int32_t get_sint32(const char *buf) {
  return (buf[3] & 0xff) << 24 | (buf[2] & 0xff) << 16 | (buf[1] & 0xff) << 8 |
         (buf[0] & 0xff);
}


x86 assembly (clang, -O0):
<get_sint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
and    $0xff,%ecx
or     %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @get_sint32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = and i32 %6, 255
%8 = shl i32 %7, 24
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = and i32 %12, 255
%14 = shl i32 %13, 16
%15 = or i32 %8, %14
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = and i32 %19, 255
%21 = shl i32 %20, 8
%22 = or i32 %15, %21
%23 = load i8*, i8** %2
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = and i32 %26, 255
%28 = or i32 %22, %27
%29 = trunc i32 %28 to i8
ret i8 %29
}

LLVM IR (-O2):
define signext i8 @get_sint32(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Variables and functions */
scalar_t__ chdir(char const *);
int serverChangeDir(const char *dir) { return chdir(dir) == 0 ? 1 : 0; }


x86 assembly (clang, -O0):
<serverChangeDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <chdir@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @serverChangeDir(i8* %0) {
%2 = tail call i64 @chdir(i8* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Strue();
int /*<<< orphan*/ nest();
void Ftrue(void) {
  nest();
  Strue();
}


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

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

LLVM IR (-O0):
define void @Ftrue() {
%1 = call i32 (...) @nest()
%2 = call i32 (...) @Strue()
ret void
}

LLVM IR (-O2):
define void @Ftrue() {
%1 = tail call i32 (...) @nest()
%2 = tail call i32 (...) @Strue()
ret void
}
/* Variables and functions */
scalar_t__ regmatchInsensitive(char *, char *);
int issyslog(char *string) {
  if (regmatchInsensitive(string, "^syslog=")) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<issyslog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <regmatchInsensitive@plt>
cmp    $0x0,%rax
je     1142 <issyslog+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <issyslog+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<issyslog>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <regmatchInsensitive@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"^syslog=\00"
define i32 @issyslog(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @regmatchInsensitive(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [9 x i8] c"^syslog=\00"
define i32 @issyslog(i8* %0) {
%2 = tail call i64 @regmatchInsensitive(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int reverse(int n) {
  int rem = 0, sum = 0;
  while (n) {
    rem = n % 10;
    sum = sum * 10 + rem;
    n = n / 10;
  }
  return sum;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114a <reverse+0x4a>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
imul   $0xa,-0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1115 <reverse+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
xor    %eax,%eax
test   %edi,%edi
je     113f <reverse+0x3f>
cs nopw 0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
lea    (%rsi,%rax,2),%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 10
%7 = mul nsw i32 %4, 10
%8 = add nsw i32 %7, %6
%9 = sdiv i32 %5, 10
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
double mult(double *args) { return args[1] * args[0]; }


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

x86 assembly (clang, -O2):
<mult>:
movsd  0x8(%rdi),%xmm0
mulsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
define double @mult(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 1
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = fmul double %5, %8
ret double %9
}

LLVM IR (-O2):
define double @mult(double* nocapture %0) {
%2 = getelementptr inbounds double, double* %0, i64 1
%3 = load double, double* %2
%4 = load double, double* %0
%5 = fmul double %3, %4
ret double %5
}