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

/* Variables and functions */
int /*<<< orphan*/ buf_pushchar(struct buffer *, int);
unsigned buf_pushchars(struct buffer *buf, const char *str) {
  unsigned i = 0;
  int ch;
  while ((ch = str[i])) {
    buf_pushchar(buf, ch);
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<buf_pushchars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
je     1158 <buf_pushchars+0x48>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <buf_pushchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <buf_pushchars+0x17>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_pushchars>:
push   %r15
push   %r14
push   %rbx
mov    (%rsi),%al
test   %al,%al
je     1149 <buf_pushchars+0x39>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <buf_pushchar@plt>
add    $0x1,%ebx
movzbl (%r15,%rbx,1),%eax
test   %al,%al
jne    1130 <buf_pushchars+0x20>
jmp    114b <buf_pushchars+0x3b>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
%struct.buffer = type { i32 }
define i32 @buf_pushchars(%struct.buffer* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %10, %5 ], [ 0, %2 ]
%8 = sext i8 %6 to i32
%9 = tail call i32 @buf_pushchar(%struct.buffer* %0, i32 %8)
%10 = add i32 %7, 1
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %1, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %10, %5 ]
ret i32 %16
}
_exit(s) { ; }


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
unreachable
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *srealloc(void *old, size_t size) {
  void *ptr = realloc(old, size);
  if (!ptr) {
    fprintf(stderr, "Out of memory!");
    exit(-1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<srealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117b <srealloc+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srealloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <srealloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory!\00"
define i8* @srealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 -1)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory!\00"
define noalias i8* @srealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %2
ret i8* %3
}
__attribute__((no)) int foo() {
  int a = -1;
  volatile unsigned b = 1U;
  int c = 1;
  c = (a + 972195718) / (b ? 2 : 0);
  if (c == 486097858)
    ;
  else
    __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x39f28786,%eax
mov    -0x8(%rbp),%esi
xor    %ecx,%ecx
mov    $0x2,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
cmpl   $0x1cf943c2,-0xc(%rbp)
jne    115d <foo+0x4d>
jmp    1162 <foo+0x52>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x1,-0x4(%rsp)
mov    -0x4(%rsp),%eax
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 -1, i32* %1
store volatile i32 1, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 972195718
%6 = load volatile i32, i32* %2
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 2, i32 0
%10 = sdiv i32 %5, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 486097858
br i1 %12, label %13, label %14
13: ; preds = %0
br label %15
14: ; preds = %0
unreachable
15: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
define i32 @foo() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 1, i32* %1
%3 = load volatile i32, i32* %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  printf("%d\n", (n * m) / 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%eax
imul   0x4(%rsp),%eax
mov    %eax,%esi
shr    $0x1f,%esi
add    %eax,%esi
sar    %esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = mul nsw i32 %5, %6
%8 = sdiv i32 %7, 2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, %6
%9 = sdiv i32 %8, 2
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
int last_two(int n) { return n % 10; }


x86 assembly (clang, -O0):
<last_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_two>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @last_two(i32 %0) {
%2 = srem i32 %0, 10
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uid_t;

/* Variables and functions */
int setuid(scalar_t__);
void test(void) {
  uid_t uid;
  int result;
  uid = 0;
  result = setuid(uid);
}


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

x86 assembly (clang, -O2):
<test>:
xor    %edi,%edi
jmp    1030 <setuid@plt>

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

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @setuid(i64 0)
ret void
}
/* Variables and functions */
char generate_random_char();
char *generate_random_string(char *buf, size_t len) {
  int i;
  for (i = 0; i < len; i++) {
    buf[i] = generate_random_char();
  }
  buf[len] = '\0';
  return buf;
}


x86 assembly (clang, -O0):
<generate_random_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1157 <generate_random_string+0x47>
mov    $0x0,%al
call   1030 <generate_random_char@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <generate_random_string+0x17>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_random_string>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
test   %rsi,%rsi
je     1144 <generate_random_string+0x34>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <generate_random_char@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <generate_random_string+0x20>
movb   $0x0,(%r15,%r14,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @generate_random_string(i8* returned writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %8, %4 ], [ 0, %2 ]
%6 = tail call signext i8 (...) @generate_random_char()
%7 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %6, i8* %7
%8 = add nuw i64 %5, 1
%9 = icmp eq i64 %8, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %2
%11 = getelementptr inbounds i8, i8* %0, i64 %1
store i8 0, i8* %11
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int y, *p, x;
  y = 0;
  p = &y;
  x = *p;
  x = 4;
  (*p)++;
  x--;
  (*p) += x;
  printf("y = %d\n", y);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
movl   $0x4,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"y = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ S_IFCHR;
int _stat(uint8_t *file, struct stat *st) {
  st->st_mode = S_IFCHR;
  return 0;
}


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

x86 assembly (clang, -O2):
<_stat>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IFCHR = global i32 0
define i32 @_stat(i32* %0, %struct.stat* %1) {
%3 = alloca i32*
%4 = alloca %struct.stat*
store i32* %0, i32** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* @S_IFCHR
%6 = load %struct.stat*, %struct.stat** %4
%7 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
store i32 %5, i32* %7
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFCHR = global i32 0
define i32 @_stat(i32* nocapture readnone %0, %struct.stat* nocapture writeonly %1) {
%3 = load i32, i32* @S_IFCHR
%4 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
store i32 %3, i32* %4
ret i32 0
}
/* Variables and functions */
char *stbi_zlib_decode_malloc_guesssize(char const *, int, int, int *);
extern char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen) {
  return stbi_zlib_decode_malloc_guesssize(buffer, len, 16384, outlen);
}


x86 assembly (clang, -O0):
<stbi_zlib_decode_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0x4000,%edx
call   1030 <stbi_zlib_decode_malloc_guesssize@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbi_zlib_decode_malloc>:
mov    %rdx,%rcx
mov    $0x4000,%edx
jmp    1030 <stbi_zlib_decode_malloc_guesssize@plt>

LLVM IR (-O0):
define i8* @stbi_zlib_decode_malloc(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i8* @stbi_zlib_decode_malloc_guesssize(i8* %7, i32 %8, i32 16384, i32* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @stbi_zlib_decode_malloc(i8* %0, i32 %1, i32* %2) {
%4 = tail call i8* @stbi_zlib_decode_malloc_guesssize(i8* %0, i32 %1, i32 16384, i32* %2)
ret i8* %4
}
unsigned int u_get_first_byte_mask(unsigned int len) {
  do {
#pragma GCC diagnostic push

#pragma GCC diagnostic ignored "-Wpragmas"

#pragma GCC diagnostic ignored "-Wtautological-compare"
    if ((len < 2)) {
      __builtin_unreachable();
    }
#pragma GCC diagnostic pop
  } while (0);
  do {
#pragma GCC diagnostic push

#pragma GCC diagnostic ignored "-Wpragmas"

#pragma GCC diagnostic ignored "-Wtautological-compare"
    if ((len > 4)) {
      __builtin_unreachable();
    }
#pragma GCC diagnostic pop
  } while (0);
  return (0x80 >> len) - 1;
}


x86 assembly (clang, -O0):
<u_get_first_byte_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jae    1111 <u_get_first_byte_mask+0x11>
jmp    1116 <u_get_first_byte_mask+0x16>
jmp    111b <u_get_first_byte_mask+0x1b>
cmpl   $0x4,-0x4(%rbp)
jbe    1125 <u_get_first_byte_mask+0x25>
jmp    112a <u_get_first_byte_mask+0x2a>
mov    -0x4(%rbp),%ecx
mov    $0x80,%eax
sar    %cl,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_get_first_byte_mask>:
mov    %edi,%ecx
mov    $0x80,%eax
shr    %cl,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @u_get_first_byte_mask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1
%4 = load i32, i32* %2
%5 = icmp ult i32 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %3
unreachable
7: ; preds = %3
br label %8
8: ; preds = %7
br label %9
9: ; preds = %8
%10 = load i32, i32* %2
%11 = icmp ugt i32 %10, 4
br i1 %11, label %12, label %13
12: ; preds = %9
unreachable
13: ; preds = %9
br label %14
14: ; preds = %13
%15 = load i32, i32* %2
%16 = ashr i32 128, %15
%17 = sub nsw i32 %16, 1
ret i32 %17
}

LLVM IR (-O2):
define i32 @u_get_first_byte_mask(i32 %0) {
%2 = icmp ugt i32 %0, 1
tail call void @llvm.assume(i1 %2)
%3 = icmp ult i32 %0, 5
tail call void @llvm.assume(i1 %3)
%4 = lshr i32 128, %0
%5 = add nsw i32 %4, -1
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int sortcmp(const void *e1, const void *e2) {
  uint64_t c1, c2;
  c1 = **((uint64_t **)e1);
  c2 = **((uint64_t **)e2);
  if (c1 > c2) {
    return (-1);
  } else if (c1 < c2) {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<sortcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    1142 <sortcmp+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <sortcmp+0x63>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    115c <sortcmp+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <sortcmp+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sortcmp>:
mov    (%rdi),%rax
mov    (%rax),%rax
mov    (%rsi),%rcx
xor    %edx,%edx
cmp    (%rcx),%rax
setl   %dl
mov    $0xffffffff,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @sortcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64**
%4 = load i64*, i64** %3
%5 = load i64, i64* %4
%6 = bitcast i8* %1 to i64**
%7 = load i64*, i64** %6
%8 = load i64, i64* %7
%9 = icmp sgt i64 %5, %8
%10 = icmp slt i64 %5, %8
%11 = zext i1 %10 to i32
%12 = select i1 %9, i32 -1, i32 %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
nosect() { fatal("no sections"); }


x86 assembly (clang, -O0):
<nosect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <fatal@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"no sections\00"
define i32 @nosect() {
%1 = alloca i32
%2 = call i32 @fatal(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [12 x i8] c"no sections\00"
define i32 @nosect() {
%1 = tail call i32 @fatal(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int test_imm_06uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x06 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_06uint64_highword_reg>:
movabs $0x600000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_06uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 6
%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_06uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 25769803776
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SYS_execve;
int syscall_3(int /*<<< orphan*/, long, long, long);
int execve(const char *filename, char *const argv[], char *const envp[]) {
  int ret;
  ret =
      syscall_3(SYS_execve, ((long)(filename)), ((long)(argv)), ((long)(envp)));
  return ret;
}


x86 assembly (clang, -O0):
<execve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <syscall_3@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execve>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall_3@plt>

LLVM IR (-O0):
@SYS_execve = global i32 0
define i32 @execve(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%8 = load i32, i32* @SYS_execve
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
%11 = load i8**, i8*** %5
%12 = ptrtoint i8** %11 to i64
%13 = load i8**, i8*** %6
%14 = ptrtoint i8** %13 to i64
%15 = call i32 @syscall_3(i32 %8, i64 %10, i64 %12, i64 %14)
store i32 %15, i32* %7
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
@SYS_execve = global i32 0
define i32 @execve(i8* %0, i8** %1, i8** %2) {
%4 = load i32, i32* @SYS_execve
%5 = ptrtoint i8* %0 to i64
%6 = ptrtoint i8** %1 to i64
%7 = ptrtoint i8** %2 to i64
%8 = tail call i32 @syscall_3(i32 %4, i64 %5, i64 %6, i64 %7)
ret i32 %8
}
int cmd_sta_reset_default(struct sigma_dut *dut, struct sigma_conn *conn,
                          struct sigma_cmd *cmd) {
  int cmd_sta_p2p_reset(struct sigma_dut * dut, struct sigma_conn * conn,
                        struct sigma_cmd * cmd);
  return cmd_sta_p2p_reset(dut, conn, cmd);
}


x86 assembly (clang, -O0):
<cmd_sta_reset_default>:
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 <cmd_sta_p2p_reset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_sta_reset_default>:
jmp    1030 <cmd_sta_p2p_reset@plt>

LLVM IR (-O0):
%struct.sigma_dut = type opaque
%struct.sigma_conn = type opaque
%struct.sigma_cmd = type opaque
define i32 @cmd_sta_reset_default(%struct.sigma_dut* %0, %struct.sigma_conn* %1, %struct.sigma_cmd* %2) {
%4 = alloca %struct.sigma_dut*
%5 = alloca %struct.sigma_conn*
%6 = alloca %struct.sigma_cmd*
store %struct.sigma_dut* %0, %struct.sigma_dut** %4
store %struct.sigma_conn* %1, %struct.sigma_conn** %5
store %struct.sigma_cmd* %2, %struct.sigma_cmd** %6
%7 = load %struct.sigma_dut*, %struct.sigma_dut** %4
%8 = load %struct.sigma_conn*, %struct.sigma_conn** %5
%9 = load %struct.sigma_cmd*, %struct.sigma_cmd** %6
%10 = call i32 @cmd_sta_p2p_reset(%struct.sigma_dut* %7, %struct.sigma_conn* %8, %struct.sigma_cmd* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.sigma_dut = type opaque
%struct.sigma_conn = type opaque
%struct.sigma_cmd = type opaque
define i32 @cmd_sta_reset_default(%struct.sigma_dut* %0, %struct.sigma_conn* %1, %struct.sigma_cmd* %2) {
%4 = tail call i32 @cmd_sta_p2p_reset(%struct.sigma_dut* %0, %struct.sigma_conn* %1, %struct.sigma_cmd* %2)
ret i32 %4
}
__attribute__((always_)) void outl_p(unsigned int value, unsigned short port) {
  asm volatile("out"
               "l"
               " %"
               "0,%"
               "w"
               "1"
               :
               : "a"(value), "Nd"(port));
  slow_down_io();
}


x86 assembly (clang, -O0):
<outl_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x6(%rbp),%dx
out    %eax,(%dx)
mov    $0x0,%al
call   1030 <slow_down_io@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outl_p>:
mov    %esi,%edx
mov    %edi,%eax
out    %eax,(%dx)
xor    %eax,%eax
jmp    1030 <slow_down_io@plt>

LLVM IR (-O0):
define void @outl_p(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = load i16, i16* %4
%7 = call i32 (...) @slow_down_io()
ret void
}

LLVM IR (-O2):
define void @outl_p(i32 %0, i16 zeroext %1) {
tail call void asm sideeffect "outl $0,${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i16 %1)
%3 = tail call i32 (...) @slow_down_io()
ret void
}
/* Variables and functions */
scalar_t__ compare(char *, char *);
char *compare_lessThan() {
  do {
    if (!(compare("hibb", "hiaa") < 0))
      return "Compare less than string";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<compare_lessThan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1030 <compare@plt>
cmp    $0x0,%rax
jl     1145 <compare_lessThan+0x35>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <compare_lessThan+0x42>
jmp    114a <compare_lessThan+0x3a>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_lessThan>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee6(%rip),%rsi
call   1030 <compare@plt>
xor    %ecx,%ecx
test   %rax,%rax
lea    0xeda(%rip),%rax
cmovns %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"hibb\00"
@.str.1 = [5 x i8] c"hiaa\00"
@.str.2 = [25 x i8] c"Compare less than string\00"
define i8* @compare_lessThan() {
%1 = alloca i8*
br label %2
2: ; preds = %0
%3 = call i64 @compare(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp slt i64 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %2
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8** %1
br label %8
6: ; preds = %2
br label %7
7: ; preds = %6
store i8* null, i8** %1
br label %8
8: ; preds = %7, %5
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"hibb\00"
@.str.1 = [5 x i8] c"hiaa\00"
@.str.2 = [25 x i8] c"Compare less than string\00"
define i8* @compare_lessThan() {
%1 = tail call i64 @compare(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp slt i64 %1, 0
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void g11_cb(void *arg) { puts("GPIO_11 triggered"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"GPIO_11 triggered\00"
define void @g11_cb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"GPIO_11 triggered\00"
define void @g11_cb(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
void lgtd_lifx_gateway_handle_light_status(
    struct lgtd_lifx_gateway *gw, const struct lgtd_lifx_packet_header *hdr,
    const struct lgtd_lifx_packet_light_status *pkt) {
  (void)gw;
  (void)hdr;
  (void)pkt;
}


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

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

LLVM IR (-O0):
%struct.lgtd_lifx_gateway = type opaque
%struct.lgtd_lifx_packet_header = type opaque
%struct.lgtd_lifx_packet_light_status = type opaque
define void @lgtd_lifx_gateway_handle_light_status(%struct.lgtd_lifx_gateway* %0, %struct.lgtd_lifx_packet_header* %1, %struct.lgtd_lifx_packet_light_status* %2) {
%4 = alloca %struct.lgtd_lifx_gateway*
%5 = alloca %struct.lgtd_lifx_packet_header*
%6 = alloca %struct.lgtd_lifx_packet_light_status*
store %struct.lgtd_lifx_gateway* %0, %struct.lgtd_lifx_gateway** %4
store %struct.lgtd_lifx_packet_header* %1, %struct.lgtd_lifx_packet_header** %5
store %struct.lgtd_lifx_packet_light_status* %2, %struct.lgtd_lifx_packet_light_status** %6
%7 = load %struct.lgtd_lifx_gateway*, %struct.lgtd_lifx_gateway** %4
%8 = load %struct.lgtd_lifx_packet_header*, %struct.lgtd_lifx_packet_header** %5
%9 = load %struct.lgtd_lifx_packet_light_status*, %struct.lgtd_lifx_packet_light_status** %6
ret void
}

LLVM IR (-O2):
%struct.lgtd_lifx_gateway = type opaque
%struct.lgtd_lifx_packet_header = type opaque
%struct.lgtd_lifx_packet_light_status = type opaque
define void @lgtd_lifx_gateway_handle_light_status(%struct.lgtd_lifx_gateway* nocapture %0, %struct.lgtd_lifx_packet_header* nocapture %1, %struct.lgtd_lifx_packet_light_status* nocapture %2) {
ret void
}
int pldummy_ljiip() { return 0; }


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

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

LLVM IR (-O0):
define i32 @pldummy_ljiip() {
ret i32 0
}

LLVM IR (-O2):
define i32 @pldummy_ljiip() {
ret i32 0
}
void kasan_slab_alloc(struct kmem_cache *s, void *object) {}


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

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

LLVM IR (-O0):
%struct.kmem_cache = type opaque
define void @kasan_slab_alloc(%struct.kmem_cache* %0, i8* %1) {
%3 = alloca %struct.kmem_cache*
%4 = alloca i8*
store %struct.kmem_cache* %0, %struct.kmem_cache** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.kmem_cache = type opaque
define void @kasan_slab_alloc(%struct.kmem_cache* nocapture %0, i8* nocapture %1) {
ret void
}
void init() {
  extern char commentstate;
  extern char quotestate;
  extern char reservestate;
  commentstate = 0;
  quotestate = 7;
  reservestate = commentstate;
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
movb   $0x0,(%rax)
mov    0x2ebb(%rip),%rax
movb   $0x7,(%rax)
mov    0x2ec9(%rip),%rax
mov    (%rax),%cl
mov    0x2eb8(%rip),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
mov    0x2ee1(%rip),%rax
movb   $0x0,(%rax)
mov    0x2ebf(%rip),%rax
movb   $0x7,(%rax)
mov    0x2ec5(%rip),%rax
movb   $0x0,(%rax)
ret

LLVM IR (-O0):
@commentstate = external global i8
@quotestate = external global i8
@reservestate = external global i8
define void @init() {
store i8 0, i8* @commentstate
store i8 7, i8* @quotestate
%1 = load i8, i8* @commentstate
store i8 %1, i8* @reservestate
ret void
}

LLVM IR (-O2):
@commentstate = external global i8
@quotestate = external global i8
@reservestate = external global i8
define void @init() {
store i8 0, i8* @commentstate
store i8 7, i8* @quotestate
store i8 0, i8* @reservestate
ret void
}
void greport_prepare(void) {}


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

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

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

LLVM IR (-O2):
define void @greport_prepare() {
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int wait(int *);
pid_t r_wait(int *stat_loc) {
  pid_t retval;
  while (((retval = wait(stat_loc)) == -1) && (errno == EINTR))
    ;
  return retval;
}


x86 assembly (clang, -O0):
<r_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <wait@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0xd(%rbp)
jne    1152 <r_wait+0x42>
mov    0x2ea1(%rip),%rax
mov    (%rax),%rax
mov    0x2e8f(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1162 <r_wait+0x52>
jmp    1167 <r_wait+0x57>
jmp    111c <r_wait+0xc>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_wait>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2ec1(%rip),%r14
mov    0x2eb2(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <wait@plt>
cmp    $0xffffffff,%eax
jne    1145 <r_wait+0x35>
mov    (%r15),%rcx
cmp    %rcx,(%r14)
je     1130 <r_wait+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @r_wait(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %14, %1
%5 = load i32*, i32** %2
%6 = call i32 @wait(i32* %5)
store i32 %6, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i64, i64* @errno
%10 = load i64, i64* @EINTR
%11 = icmp eq i64 %9, %10
br label %12
12: ; preds = %8, %4
%13 = phi i1 [ false, %4 ], [ %11, %8 ]
br i1 %13, label %14, label %15
14: ; preds = %12
br label %4
15: ; preds = %12
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @r_wait(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @wait(i32* %0)
%4 = icmp eq i32 %3, -1
%5 = load i64, i64* @errno
%6 = load i64, i64* @EINTR
%7 = icmp eq i64 %5, %6
%8 = select i1 %4, i1 %7, i1 false
br i1 %8, label %2, label %9
9: ; preds = %2
ret i32 %3
}
f() {
  int var = 7;
  if ((var / 7) == 1)
    return var / 7;
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x7,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x1,%eax
jne    1132 <f+0x32>
mov    -0x8(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1139 <f+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 1
}
/* Type definitions */
struct XorrisO {
  int dummy;
};

/* Variables and functions */
int Xorriso_read_mkisofsrc(struct XorrisO *, int /*<<< orphan*/);
int Xorriso_option_read_mkisofsrc(struct XorrisO *xorriso, int flag) {
  int ret;
  ret = Xorriso_read_mkisofsrc(xorriso, 0);
  return (ret);
}


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

x86 assembly (clang, -O2):
<Xorriso_option_read_mkisofsrc>:
xor    %esi,%esi
jmp    1030 <Xorriso_read_mkisofsrc@plt>

LLVM IR (-O0):
%struct.XorrisO = type { i32 }
define i32 @Xorriso_option_read_mkisofsrc(%struct.XorrisO* %0, i32 %1) {
%3 = alloca %struct.XorrisO*
%4 = alloca i32
%5 = alloca i32
store %struct.XorrisO* %0, %struct.XorrisO** %3
store i32 %1, i32* %4
%6 = load %struct.XorrisO*, %struct.XorrisO** %3
%7 = call i32 @Xorriso_read_mkisofsrc(%struct.XorrisO* %6, i32 0)
store i32 %7, i32* %5
%8 = load i32, i32* %5
ret i32 %8
}

LLVM IR (-O2):
%struct.XorrisO = type { i32 }
define i32 @Xorriso_option_read_mkisofsrc(%struct.XorrisO* %0, i32 %1) {
%3 = tail call i32 @Xorriso_read_mkisofsrc(%struct.XorrisO* %0, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ err_sys(char *);
scalar_t__ semctl(int, int /*<<< orphan*/, int /*<<< orphan*/,
                  int /*<<< orphan*/);
void sem_rm(int id) {
  if (semctl(id, 0, IPC_RMID, 0) < 0)
    err_sys("can't IPC_RMID");
}


x86 assembly (clang, -O0):
<sem_rm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
mov    %ecx,%esi
call   1040 <semctl@plt>
cmp    $0x0,%rax
jge    1156 <sem_rm+0x36>
lea    0xeaf(%rip),%rdi
call   1030 <err_sys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_rm>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1040 <semctl@plt>
test   %rax,%rax
js     113a <sem_rm+0x1a>
pop    %rax
ret
lea    0xebf(%rip),%rdi
pop    %rax
jmp    1030 <err_sys@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
@.str = [15 x i8] c"can't IPC_RMID\00"
define void @sem_rm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPC_RMID
%5 = call i64 @semctl(i32 %3, i32 0, i32 %4, i32 0)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @err_sys(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
@.str = [15 x i8] c"can't IPC_RMID\00"
define void @sem_rm(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i64 @semctl(i32 %0, i32 0, i32 %2, i32 0)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @err_sys(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
void winsocket_activate(int _socket_handle) {}


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

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

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

LLVM IR (-O2):
define void @winsocket_activate(i32 %0) {
ret void
}
/* Variables and functions */
int add(int, int);
char *test_add_fail() {
  do {
    if (!(add(1, 2) == 4))
      return "add(1,2) must produce 4";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_add_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <add@plt>
cmp    $0x4,%eax
je     1140 <test_add_fail+0x30>
lea    0xec9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114d <test_add_fail+0x3d>
jmp    1145 <test_add_fail+0x35>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_add_fail>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <add@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
lea    0xed4(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"add(1,2) must produce 4\00"
define i8* @test_add_fail() {
%1 = alloca i8*
br label %2
2: ; preds = %0
%3 = call i32 @add(i32 1, i32 2)
%4 = icmp eq i32 %3, 4
br i1 %4, label %6, label %5
5: ; preds = %2
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8** %1
br label %8
6: ; preds = %2
br label %7
7: ; preds = %6
store i8* null, i8** %1
br label %8
8: ; preds = %7, %5
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
@.str = [24 x i8] c"add(1,2) must produce 4\00"
define i8* @test_add_fail() {
%1 = tail call i32 @add(i32 1, i32 2)
%2 = icmp eq i32 %1, 4
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int /*<<< orphan*/ anvil_syslog(int /*<<< orphan*/, char *);
locale_t newlocale(int category_mask, const char *locale, locale_t base) {
  anvil_syslog(0, "newlocale\n");
  return 0;
}


x86 assembly (clang, -O0):
<newlocale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %edi,%edi
lea    0xed5(%rip),%rsi
call   1030 <anvil_syslog@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newlocale>:
push   %rax
lea    0xee8(%rip),%rsi
xor    %edi,%edi
call   1030 <anvil_syslog@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"newlocale\0A\00"
define i32 @newlocale(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 @anvil_syslog(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"newlocale\0A\00"
define i32 @newlocale(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @anvil_syslog(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, char **);
int main(int argc, char **argv) {
  foo(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @foo(i32 %0, i8** %1)
ret i32 0
}
int main() {
  int m;
  int A[10][10];
  int B[10][20];
  int C[10];
  int i;
  int j;
  int k;
  for (i = 0; i < 10; i = i + 1)
    for (j = 0; j < i + 2 * j + 10; j = j + 1)
      k = A[4 * i + 3 * j + 2][j - 3];
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x480,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4f4(%rbp)
cmpl   $0xa,-0x4f4(%rbp)
jge    11bd <main+0xbd>
movl   $0x0,-0x4f8(%rbp)
mov    -0x4f8(%rbp),%eax
mov    -0x4f4(%rbp),%ecx
mov    -0x4f8(%rbp),%edx
shl    $0x1,%edx
add    %edx,%ecx
add    $0xa,%ecx
cmp    %ecx,%eax
jge    11a4 <main+0xa4>
mov    -0x4f4(%rbp),%eax
shl    $0x2,%eax
imul   $0x3,-0x4f8(%rbp),%ecx
add    %ecx,%eax
add    $0x2,%eax
movslq %eax,%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
mov    -0x4f8(%rbp),%ecx
sub    $0x3,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4fc(%rbp)
mov    -0x4f8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4f8(%rbp)
jmp    1133 <main+0x33>
jmp    11a9 <main+0xa9>
mov    -0x4f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4f4(%rbp)
jmp    111c <main+0x1c>
xor    %eax,%eax
add    $0x480,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x [10 x i32]]
%4 = alloca [10 x [20 x i32]]
%5 = alloca [10 x i32]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %6
br label %9
9: ; preds = %39, %0
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %42
12: ; preds = %9
store i32 0, i32* %7
br label %13
13: ; preds = %35, %12
%14 = load i32, i32* %7
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = mul nsw i32 2, %16
%18 = add nsw i32 %15, %17
%19 = add nsw i32 %18, 10
%20 = icmp slt i32 %14, %19
br i1 %20, label %21, label %38
21: ; preds = %13
%22 = load i32, i32* %6
%23 = mul nsw i32 4, %22
%24 = load i32, i32* %7
%25 = mul nsw i32 3, %24
%26 = add nsw i32 %23, %25
%27 = add nsw i32 %26, 2
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %3, i64 0, i64 %28
%30 = load i32, i32* %7
%31 = sub nsw i32 %30, 3
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [10 x i32], [10 x i32]* %29, i64 0, i64 %32
%34 = load i32, i32* %33
store i32 %34, i32* %8
br label %35
35: ; preds = %21
%36 = load i32, i32* %7
%37 = add nsw i32 %36, 1
store i32 %37, i32* %7
br label %13
38: ; preds = %13
br label %39
39: ; preds = %38
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
br label %9
42: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}