xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isspace(unsigned char);
const char *skip_whitespace(const char *p) {
  while (isspace((unsigned char)(*p)))
    p++;
  return p;
}


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

x86 assembly (clang, -O2):
<skip_whitespace>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skip_whitespace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
uint32_t load_u32(uint8_t *buf) {
  uint32_t ret;
  memcpy(&ret, buf, sizeof(ret));
  return ret;
}


x86 assembly (clang, -O0):
<load_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_u32>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @load_u32(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @memcpy(i32* %3, i32* %4, i32 4)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @load_u32(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i32* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
void useit1(val) int val;
{
  static int usedval;
  usedval = val;
}


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

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

LLVM IR (-O0):
@useit1.usedval = internal global i32 0
define void @useit1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* @useit1.usedval
ret void
}

LLVM IR (-O2):
define void @useit1(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int cookie;
  if (cookie == 0x41414141)
    printf("PASS\n");
  else
    printf("FAIL\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x41414141,-0x14(%rbp)
jne    1144 <main+0x34>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
jmp    1150 <main+0x40>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"PASS\0A\00"
@.str.1 = [6 x i8] c"FAIL\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 1094795585
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"FAIL\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ testGetValue();
int main(void) {
  do {
  } while (0);
  testGetValue();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
jmp    1124 <main+0x14>
mov    $0x0,%al
call   1030 <testGetValue@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
br label %3
3: ; preds = %2
%4 = call i32 (...) @testGetValue()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testGetValue()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pic14n_standby();
int /*<<< orphan*/ pic14n_write_config();
int /*<<< orphan*/ pic_write_panel(int, int, int);
void pic14n_program_end(int config) {
  pic_write_panel((3), (0xFFFF), (0xFFFF));
  pic14n_standby();
  if (config)
    pic14n_write_config();
}


x86 assembly (clang, -O0):
<pic14n_program_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3,%edi
mov    $0xffff,%edx
mov    %edx,%esi
call   1040 <pic_write_panel@plt>
mov    $0x0,%al
call   1030 <pic14n_standby@plt>
cmpl   $0x0,-0x4(%rbp)
je     1164 <pic14n_program_end+0x34>
mov    $0x0,%al
call   1050 <pic14n_write_config@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic14n_program_end>:
push   %rbx
mov    %edi,%ebx
mov    $0x3,%edi
mov    $0xffff,%esi
mov    $0xffff,%edx
call   1040 <pic_write_panel@plt>
xor    %eax,%eax
call   1030 <pic14n_standby@plt>
test   %ebx,%ebx
je     115a <pic14n_program_end+0x2a>
xor    %eax,%eax
pop    %rbx
jmp    1050 <pic14n_write_config@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @pic14n_program_end(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @pic_write_panel(i32 3, i32 65535, i32 65535)
%4 = call i32 (...) @pic14n_standby()
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @pic14n_write_config()
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @pic14n_program_end(i32 %0) {
%2 = tail call i32 @pic_write_panel(i32 3, i32 65535, i32 65535)
%3 = tail call i32 (...) @pic14n_standby()
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @pic14n_write_config()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int cache_control(unsigned int command) {
  volatile unsigned int *p = (volatile unsigned int *)0x80000000;
  int i;
  for (i = 0; i < (32 * 1024); i += 32) {
    (void)*p;
    p += (32 / sizeof(int));
  }
  return 0;
}


x86 assembly (clang, -O0):
<cache_control>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x80000000,%eax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8000,-0x14(%rbp)
jge    1144 <cache_control+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <cache_control+0x17>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cache_control>:
mov    $0x80000000,%eax
mov    $0xffffffe0,%ecx
nopw   0x0(%rax,%rax,1)
mov    (%rax),%edx
mov    0x20(%rax),%edx
mov    0x40(%rax),%edx
mov    0x60(%rax),%edx
mov    0x80(%rax),%edx
mov    0xa0(%rax),%edx
mov    0xc0(%rax),%edx
mov    0xe0(%rax),%edx
add    $0x100,%ecx
add    $0x100,%rax
cmp    $0x7fe0,%ecx
jb     1110 <cache_control+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @cache_control(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32 %0, i32* %2
store i32* inttoptr (i64 2147483648 to i32*), i32** %3
store i32 0, i32* %4
br label %5
5: ; preds = %13, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 32768
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = load i32*, i32** %3
%10 = load volatile i32, i32* %9
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 8
store i32* %12, i32** %3
br label %13
13: ; preds = %8
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 32
store i32 %15, i32* %4
br label %5
16: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @cache_control(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %22, %2 ]
%4 = phi i32* [ inttoptr (i64 2147483648 to i32*), %1 ], [ %21, %2 ]
%5 = load volatile i32, i32* %4
%6 = getelementptr inbounds i32, i32* %4, i64 8
%7 = load volatile i32, i32* %6
%8 = getelementptr inbounds i32, i32* %4, i64 16
%9 = load volatile i32, i32* %8
%10 = getelementptr inbounds i32, i32* %4, i64 24
%11 = load volatile i32, i32* %10
%12 = getelementptr inbounds i32, i32* %4, i64 32
%13 = load volatile i32, i32* %12
%14 = getelementptr inbounds i32, i32* %4, i64 40
%15 = load volatile i32, i32* %14
%16 = getelementptr inbounds i32, i32* %4, i64 48
%17 = load volatile i32, i32* %16
%18 = getelementptr inbounds i32, i32* %4, i64 56
%19 = or i32 %3, 224
%20 = load volatile i32, i32* %18
%21 = getelementptr inbounds i32, i32* %4, i64 64
%22 = add nuw nsw i32 %3, 256
%23 = icmp ult i32 %19, 32736
br i1 %23, label %2, label %24
24: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RogueType_trace(void *);
void RogueVMTraceType(void *allocation) { RogueType_trace(allocation); }


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

x86 assembly (clang, -O2):
<RogueVMTraceType>:
jmp    1030 <RogueType_trace@plt>

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

LLVM IR (-O2):
define void @RogueVMTraceType(i8* %0) {
%2 = tail call i32 @RogueType_trace(i8* %0)
ret void
}
char getplayertoken(int player) {
  if (player == '0')
    return 'X';
  else
    return 'O';
}


x86 assembly (clang, -O0):
<getplayertoken>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jne    111a <getplayertoken+0x1a>
movb   $0x58,-0x1(%rbp)
jmp    111e <getplayertoken+0x1e>
movb   $0x4f,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getplayertoken>:
xor    %eax,%eax
cmp    $0x30,%edi
sete   %al
lea    (%rax,%rax,8),%eax
add    $0x4f,%eax
ret

LLVM IR (-O0):
define signext i8 @getplayertoken(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 48
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 88, i8* %2
br label %8
7: ; preds = %1
store i8 79, i8* %2
br label %8
8: ; preds = %7, %6
%9 = load i8, i8* %2
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @getplayertoken(i32 %0) {
%2 = icmp eq i32 %0, 48
%3 = select i1 %2, i8 88, i8 79
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_cpuid_leaf_0xd();
int /*<<< orphan*/ test_cpuid_leaf_not_recognized();
int /*<<< orphan*/ test_cpuid_leaf_reserved();
int main(int argc, char **argv, char **envp) {
  test_cpuid_leaf_0xd();
  test_cpuid_leaf_reserved();
  test_cpuid_leaf_not_recognized();
  printf("CPUID test passed.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1050 <test_cpuid_leaf_0xd@plt>
mov    $0x0,%al
call   1060 <test_cpuid_leaf_reserved@plt>
mov    $0x0,%al
call   1040 <test_cpuid_leaf_not_recognized@plt>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_cpuid_leaf_0xd@plt>
xor    %eax,%eax
call   1060 <test_cpuid_leaf_reserved@plt>
xor    %eax,%eax
call   1040 <test_cpuid_leaf_not_recognized@plt>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"CPUID test passed.\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 (...) @test_cpuid_leaf_0xd()
%9 = call i32 (...) @test_cpuid_leaf_reserved()
%10 = call i32 (...) @test_cpuid_leaf_not_recognized()
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"CPUID test passed.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 (...) @test_cpuid_leaf_0xd()
%5 = tail call i32 (...) @test_cpuid_leaf_reserved()
%6 = tail call i32 (...) @test_cpuid_leaf_not_recognized()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void outb(unsigned short port, unsigned char value) {
  asm volatile("outb %b0, %w1" : : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    -0x2(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @outb(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @outb(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "outb ${0:b}, ${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8 %1, i16 %0)
ret void
}
void testmain() {
  print("static assert");
  _Static_assert(1, "fail");
  struct {
    _Static_assert(1, "fail");
  } x;
}


x86 assembly (clang, -O0):
<testmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testmain>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <print@plt>

LLVM IR (-O0):
%struct.anon = type {}
@.str = [14 x i8] c"static assert\00"
define void @testmain() {
%1 = alloca %struct.anon
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.anon = type {}
@.str = [14 x i8] c"static assert\00"
define void @testmain() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *_s2_f2cstr(char *, long);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ s2textxz(float, float, float, char *);
void s2textxz_(float *x, float *y, float *z, char *text, long int textlen) {
  char *t1 = _s2_f2cstr(text, textlen);
  s2textxz(*x, *y, *z, t1);
  free(t1);
}


x86 assembly (clang, -O0):
<s2textxz_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1050 <_s2_f2cstr@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x30(%rbp),%rdi
call   1040 <s2textxz@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2textxz_>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
mov    %rcx,%rdi
mov    %r8,%rsi
call   1050 <_s2_f2cstr@plt>
mov    %rax,%rbx
movss  (%r12),%xmm0
movss  (%r15),%xmm1
movss  (%r14),%xmm2
mov    %rax,%rdi
call   1040 <s2textxz@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @s2textxz_(float* %0, float* %1, float* %2, i8* %3, i64 %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
store float* %0, float** %6
store float* %1, float** %7
store float* %2, float** %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%12 = load i8*, i8** %9
%13 = load i64, i64* %10
%14 = call i8* @_s2_f2cstr(i8* %12, i64 %13)
store i8* %14, i8** %11
%15 = load float*, float** %6
%16 = load float, float* %15
%17 = load float*, float** %7
%18 = load float, float* %17
%19 = load float*, float** %8
%20 = load float, float* %19
%21 = load i8*, i8** %11
%22 = call i32 @s2textxz(float %16, float %18, float %20, i8* %21)
%23 = load i8*, i8** %11
%24 = call i32 @free(i8* %23)
ret void
}

LLVM IR (-O2):
define void @s2textxz_(float* nocapture %0, float* nocapture %1, float* nocapture %2, i8* %3, i64 %4) {
%6 = tail call i8* @_s2_f2cstr(i8* %3, i64 %4)
%7 = load float, float* %0
%8 = load float, float* %1
%9 = load float, float* %2
%10 = tail call i32 @s2textxz(float %7, float %8, float %9, i8* %6)
%11 = tail call i32 @free(i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ banish_update();
int /*<<< orphan*/ shutdown_update();
int /*<<< orphan*/ tail_chain();
int /*<<< orphan*/ user_update();
void update_bbs(void) {
  static int pulse_point;
  if (--pulse_point <= 0) {
    pulse_point = 2400;
    user_update();
    shutdown_update();
    banish_update();
  }
  tail_chain();
  return;
}


x86 assembly (clang, -O0):
<update_bbs>:
push   %rbp
mov    %rsp,%rbp
mov    0x2efa(%rip),%eax
add    $0xffffffff,%eax
mov    %eax,0x2ef1(%rip)
cmp    $0x0,%eax
jg     117b <update_bbs+0x3b>
movl   $0x960,0x2ede(%rip)
mov    $0x0,%al
call   1050 <user_update@plt>
mov    $0x0,%al
call   1030 <shutdown_update@plt>
mov    $0x0,%al
call   1060 <banish_update@plt>
mov    $0x0,%al
call   1040 <tail_chain@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_bbs>:
push   %rax
mov    0x2efd(%rip),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x2ef4(%rip)
cmp    $0x1,%eax
jg     1174 <update_bbs+0x34>
movl   $0x960,0x2ee5(%rip)
xor    %eax,%eax
call   1050 <user_update@plt>
xor    %eax,%eax
call   1030 <shutdown_update@plt>
xor    %eax,%eax
call   1060 <banish_update@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <tail_chain@plt>

LLVM IR (-O0):
@update_bbs.pulse_point = internal global i32 0
define void @update_bbs() {
%1 = load i32, i32* @update_bbs.pulse_point
%2 = add nsw i32 %1, -1
store i32 %2, i32* @update_bbs.pulse_point
%3 = icmp sle i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
store i32 2400, i32* @update_bbs.pulse_point
%5 = call i32 (...) @user_update()
%6 = call i32 (...) @shutdown_update()
%7 = call i32 (...) @banish_update()
br label %8
8: ; preds = %4, %0
%9 = call i32 (...) @tail_chain()
ret void
}

LLVM IR (-O2):
@update_bbs.pulse_point = internal unnamed_addr global i32 0
define void @update_bbs() {
%1 = load i32, i32* @update_bbs.pulse_point
%2 = add nsw i32 %1, -1
store i32 %2, i32* @update_bbs.pulse_point
%3 = icmp slt i32 %1, 2
br i1 %3, label %4, label %8
4: ; preds = %0
store i32 2400, i32* @update_bbs.pulse_point
%5 = tail call i32 (...) @user_update()
%6 = tail call i32 (...) @shutdown_update()
%7 = tail call i32 (...) @banish_update()
br label %8
8: ; preds = %4, %0
%9 = tail call i32 (...) @tail_chain()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
double int_input(void) {
  int temp_value = 0;
  scanf(" %d", &temp_value);
  return temp_value;
}


x86 assembly (clang, -O0):
<int_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <scanf@plt>
cvtsi2sdl -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_input>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
cvtsi2sdl 0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c" %d\00"
define double @int_input() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
%4 = sitofp i32 %3 to double
ret double %4
}

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
define double @int_input() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = sitofp i32 %4 to double
ret double %5
}
/* Variables and functions */
char *mk_copy_string(char const *);
char *make_copy_string(const char *s) { return (mk_copy_string(s)); }


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

x86 assembly (clang, -O2):
<make_copy_string>:
jmp    1030 <mk_copy_string@plt>

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

LLVM IR (-O2):
define i8* @make_copy_string(i8* %0) {
%2 = tail call i8* @mk_copy_string(i8* %0)
ret i8* %2
}
void av_basename() {}


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

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

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

LLVM IR (-O2):
define void @av_basename() {
ret void
}
/* Type definitions */
typedef long long uint64_t;
typedef long long uint32_t;
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint32_t tm_ticks(void) {
  struct timespec t;
  clock_gettime(CLOCK_REALTIME, &t);
  return 1000000LL * (uint64_t)t.tv_sec + (uint64_t)(t.tv_nsec / 1000);
}


x86 assembly (clang, -O0):
<tm_ticks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,-0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tm_ticks>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,0x10(%rsp),%rcx
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@CLOCK_REALTIME = global i32 0
define i64 @tm_ticks() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 1000000, %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add nsw i64 %6, %10
ret i64 %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@CLOCK_REALTIME = global i32 0
define i64 @tm_ticks() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = mul nsw i64 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = sext i32 %10 to i64
%12 = add nsw i64 %7, %11
ret i64 %12
}
unsigned int clTime() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @clTime() {
ret i32 0
}
int test_imm_41uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x41 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_41uint64_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, 65
%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_41uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 279172874240
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int main() { return 4; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Variables and functions */
scalar_t__ pthread_self();
unsigned long id_function(void) { return (unsigned long)pthread_self(); }


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

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

LLVM IR (-O0):
define i64 @id_function() {
%1 = call i64 (...) @pthread_self()
ret i64 %1
}

LLVM IR (-O2):
define i64 @id_function() {
%1 = tail call i64 (...) @pthread_self()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int a[3] = {0, 1, 2};
  for (int i = 0; i < 3; i++) {
    a[i] = 0;
  }
  assert(a[2] == 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    115e <main+0x4e>
movslq -0x14(%rbp),%rax
movl   $0x0,-0x10(%rbp,%rax,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113a <main+0x2a>
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 0, i32 1, i32 2]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [3 x i32]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %12, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 %10
store i32 0, i32* %11
br label %12
12: ; preds = %8
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, 2
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ EVP_PKEY;

/* Variables and functions */
int /*<<< orphan*/ X509_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *X509_get_pubkey(int /*<<< orphan*/ *);
int /*<<< orphan*/ *get_certificate(char *);
EVP_PKEY *get_public_key(char *cert_content) {
  EVP_PKEY *ret = NULL;
  X509 *cert = get_certificate(cert_content);
  ret = X509_get_pubkey(cert);
  X509_free(cert);
  return ret;
}


x86 assembly (clang, -O0):
<get_public_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_certificate@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <X509_get_pubkey@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <X509_free@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_public_key>:
push   %r14
push   %rbx
push   %rax
call   1030 <get_certificate@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <X509_get_pubkey@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1050 <X509_free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @get_public_key(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32*
store i8* %0, i8** %2
store i32* null, i32** %3
%5 = load i8*, i8** %2
%6 = call i32* @get_certificate(i8* %5)
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = call i32* @X509_get_pubkey(i32* %7)
store i32* %8, i32** %3
%9 = load i32*, i32** %4
%10 = call i32 @X509_free(i32* %9)
%11 = load i32*, i32** %3
ret i32* %11
}

LLVM IR (-O2):
define i32* @get_public_key(i8* %0) {
%2 = tail call i32* @get_certificate(i8* %0)
%3 = tail call i32* @X509_get_pubkey(i32* %2)
%4 = tail call i32 @X509_free(i32* %2)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ csolve_assert(int);
scalar_t__ malloc(int);
void main() {
  int *r;
  int y;
  r = (int *)malloc(4 * sizeof(int));
  *r = 5;
  y = *r;
  csolve_assert(y >= 10);
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <csolve_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x10,%edi
call   1030 <malloc@plt>
movl   $0x5,(%rax)
xor    %edi,%edi
pop    %rax
jmp    1040 <csolve_assert@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i64 @malloc(i32 16)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %1
%5 = load i32*, i32** %1
store i32 5, i32* %5
%6 = load i32*, i32** %1
%7 = load i32, i32* %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = icmp sge i32 %8, 10
%10 = zext i1 %9 to i32
%11 = call i32 @csolve_assert(i32 %10)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i64 @malloc(i32 16)
%2 = inttoptr i64 %1 to i32*
store i32 5, i32* %2
%3 = tail call i32 @csolve_assert(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *strncpyx(char *s1, const char *s2, size_t n) {
  size_t x = strlen(s2);
  if (n < x)
    x = n;
  memcpy(s1, s2, x);
  if (x != n)
    *(s1 + x) = '\0';
  return s1;
}


x86 assembly (clang, -O0):
<strncpyx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1157 <strncpyx+0x37>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1182 <strncpyx+0x62>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpyx>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rax,%r13
cmp    %r15,%rax
mov    %rax,%rbx
cmova  %r15,%rbx
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
cmp    %r15,%r13
jae    115f <strncpyx+0x3f>
movb   $0x0,(%r14,%rbx,1)
mov    %r14,%rax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strncpyx(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp ugt i64 %4, %2
%6 = select i1 %5, i64 %2, i64 %4
%7 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %6)
%8 = icmp ult i64 %4, %2
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %10
br label %11
11: ; preds = %9, %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ getcwd(char *, int);
int /*<<< orphan*/ strcat(char *, char *);
const char *tvheadend_dataroot(void) {
  static char cwd[256] = {0};
  if (!*cwd) {
    assert(getcwd(cwd, 254));
    strcat(cwd, "/");
  }
  return cwd;
}


x86 assembly (clang, -O0):
<tvheadend_dataroot>:
push   %rbp
mov    %rsp,%rbp
cmpb   $0x0,0x2f15(%rip)
jne    116c <tvheadend_dataroot+0x3c>
lea    0x2f08(%rip),%rdi
mov    $0xfe,%esi
call   1030 <getcwd@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0x2ef0(%rip),%rdi
lea    0xe99(%rip),%rsi
call   1050 <strcat@plt>
lea    0x2edd(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tvheadend_dataroot>:
push   %rbx
cmpb   $0x0,0x2f18(%rip)
jne    1164 <tvheadend_dataroot+0x34>
lea    0x2f0f(%rip),%rbx
mov    %rbx,%rdi
mov    $0xfe,%esi
call   1030 <getcwd@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xea4(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
lea    0x2ee5(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
@tvheadend_dataroot.cwd = internal global [256 x i8] zeroinitializer
@.str = [2 x i8] c"/\00"
define i8* @tvheadend_dataroot() {
%1 = load i8, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @tvheadend_dataroot.cwd, i64 0, i64 0)
%2 = icmp ne i8 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = call i32 @getcwd(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @tvheadend_dataroot.cwd, i64 0, i64 0), i32 254)
%5 = call i32 @assert(i32 %4)
%6 = call i32 @strcat(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @tvheadend_dataroot.cwd, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %3, %0
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @tvheadend_dataroot.cwd, i64 0, i64 0)
}

LLVM IR (-O2):
@tvheadend_dataroot.cwd = internal global [256 x i8] zeroinitializer
@.str = [2 x i8] c"/\00"
define i8* @tvheadend_dataroot() {
%1 = load i8, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @tvheadend_dataroot.cwd, i64 0, i64 0)
%2 = icmp eq i8 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @getcwd(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @tvheadend_dataroot.cwd, i64 0, i64 0), i32 254)
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @strcat(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @tvheadend_dataroot.cwd, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %3, %0
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @tvheadend_dataroot.cwd, i64 0, i64 0)
}
/* Type definitions */
struct img_pixmap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ img_getpixel4i(struct img_pixmap *, int, int, int *, int *,
                                  int *, int *);
void img_getpixel1i(struct img_pixmap *img, int x, int y, int *pix) {
  int junk[3];
  img_getpixel4i(img, x, y, pix, junk, junk + 1, junk + 2);
}


x86 assembly (clang, -O0):
<img_getpixel1i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    -0x24(%rbp),%r8
lea    -0x24(%rbp),%r9
add    $0x4,%r9
lea    -0x24(%rbp),%rax
add    $0x8,%rax
mov    %rax,(%rsp)
call   1030 <img_getpixel4i@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<img_getpixel1i>:
sub    $0x18,%rsp
lea    0x10(%rsp),%r9
lea    0x14(%rsp),%rax
mov    %rax,(%rsp)
lea    0xc(%rsp),%r8
call   1030 <img_getpixel4i@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.img_pixmap = type { i32 }
define void @img_getpixel1i(%struct.img_pixmap* %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca %struct.img_pixmap*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca [3 x i32]
store %struct.img_pixmap* %0, %struct.img_pixmap** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%10 = load %struct.img_pixmap*, %struct.img_pixmap** %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32*, i32** %8
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%18 = getelementptr inbounds i32, i32* %17, i64 2
%19 = call i32 @img_getpixel4i(%struct.img_pixmap* %10, i32 %11, i32 %12, i32* %13, i32* %14, i32* %16, i32* %18)
ret void
}

LLVM IR (-O2):
%struct.img_pixmap = type { i32 }
define void @img_getpixel1i(%struct.img_pixmap* %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca [3 x i32]
%6 = bitcast [3 x i32]* %5 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
%10 = call i32 @img_getpixel4i(%struct.img_pixmap* %0, i32 %1, i32 %2, i32* %3, i32* %7, i32* %8, i32* %9)
ret void
}
int fun1213() { return 1213; }


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

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

LLVM IR (-O0):
define i32 @fun1213() {
ret i32 1213
}

LLVM IR (-O2):
define i32 @fun1213() {
ret i32 1213
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void t5() {
  extern char *ptr();
  free(ptr());
}


x86 assembly (clang, -O0):
<t5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ptr@plt>
mov    %rax,%rdi
call   1030 <free@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t5>:
push   %rax
xor    %eax,%eax
call   1040 <ptr@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @t5() {
%1 = call i8* (...) @ptr()
%2 = call i32 @free(i8* %1)
ret void
}

LLVM IR (-O2):
define void @t5() {
%1 = tail call i8* (...) @ptr()
%2 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void board_yyfree(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<board_yyfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @board_yyfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void push_reg32(int reg32) { put8(0x50 + reg32); }


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

x86 assembly (clang, -O2):
<push_reg32>:
add    $0x50,%edi
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @push_reg32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 80, %3
%5 = call i32 @put8(i32 %4)
ret void
}

LLVM IR (-O2):
define void @push_reg32(i32 %0) {
%2 = add nsw i32 %0, 80
%3 = tail call i32 @put8(i32 %2)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int item_category_compare(void *key_a, void *key_b) {
  char *a = (char *)key_a;
  char *b = (char *)key_b;
  return strcmp(a, b);
}


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

x86 assembly (clang, -O2):
<item_category_compare>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @item_category_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ bb_perror_msg_and_die(int /*<<< orphan*/);
void bb_perror_nomsg_and_die(void) { bb_perror_msg_and_die(0); }


x86 assembly (clang, -O0):
<bb_perror_nomsg_and_die>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <bb_perror_msg_and_die@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @bb_perror_nomsg_and_die() {
%1 = call i32 @bb_perror_msg_and_die(i32 0)
ret void
}

LLVM IR (-O2):
define void @bb_perror_nomsg_and_die() {
%1 = tail call i32 @bb_perror_msg_and_die(i32 0)
ret void
}
int f19b(void) {
  const int MyConstant = 0;
  int x = MyConstant;
  x = 1;
  return x;
}


x86 assembly (clang, -O0):
<f19b>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f19b() {
ret i32 1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ depth;
};
typedef TYPE_1__ XPixmapFormatValues;

/* Variables and functions */
int get_XPixmapFormatValues_depth(void *_p) {
  return (int)((XPixmapFormatValues *)_p)->depth;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XPixmapFormatValues_depth(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XPixmapFormatValues_depth(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void pr_short(short arr[], int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("%hd ", arr[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<pr_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <pr_short+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movswl (%rax,%rcx,2),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <pr_short+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%hd \00"
define void @pr_short(i16* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i16, i16* %0, i64 %7
%9 = load i16, i16* %8
%10 = sext i16 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
int base13() { return 9; }


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

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

LLVM IR (-O0):
define i32 @base13() {
ret i32 9
}

LLVM IR (-O2):
define i32 @base13() {
ret i32 9
}