xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ array_resize(void *, int, int *);
void array_push(void **data, void *item, int *data_length, int *data_size) {
  if (*data_length == *data_size) {
    array_resize(item, (*data_size) + 4, data_size);
  }
  data[(*data_length)++] = item;
}


x86 assembly (clang, -O0):
<array_push>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
jne    1150 <array_push+0x40>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
add    $0x4,%esi
mov    -0x20(%rbp),%rdx
call   1030 <array_resize@plt>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rsi
mov    (%rsi),%ecx
mov    %ecx,%edi
add    $0x1,%edi
mov    %edi,(%rsi)
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_push>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    (%rdx),%esi
cmp    (%rcx),%esi
jne    1134 <array_push+0x24>
add    $0x4,%esi
mov    %r15,%rdi
mov    %rcx,%rdx
call   1030 <array_resize@plt>
mov    (%rbx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rbx)
movslq %esi,%rax
mov    %r15,(%r14,%rax,8)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @array_push(i8** nocapture writeonly %0, i8* %1, i32* nocapture %2, i32* %3) {
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = add nsw i32 %5, 4
%10 = tail call i32 @array_resize(i8* %1, i32 %9, i32* %3)
%11 = load i32, i32* %2
br label %12
12: ; preds = %8, %4
%13 = phi i32 [ %11, %8 ], [ %5, %4 ]
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
%15 = sext i32 %13 to i64
%16 = getelementptr inbounds i8*, i8** %0, i64 %15
store i8* %1, i8** %16
ret void
}
int rnd(range) { return abs((rand() >> 5) + (rand() >> 5)) % range; }


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
sar    $0x5,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    -0x8(%rbp),%edi
sar    $0x5,%eax
add    %eax,%edi
call   1030 <abs@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebp
sar    $0x5,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sar    $0x5,%eax
add    %ebp,%eax
mov    %eax,%ecx
neg    %ecx
cmovns %ecx,%eax
cltd
idiv   %ebx
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rnd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = ashr i32 %3, 5
%5 = call i32 (...) @rand()
%6 = ashr i32 %5, 5
%7 = add nsw i32 %4, %6
%8 = call i32 @abs(i32 %7)
%9 = load i32, i32* %2
%10 = srem i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @rnd(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = ashr i32 %2, 5
%4 = tail call i32 (...) @rand()
%5 = ashr i32 %4, 5
%6 = add nsw i32 %5, %3
%7 = tail call i32 @llvm.abs.i32(i32 %6, i1 true)
%8 = srem i32 %7, %0
ret i32 %8
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ inl(int);
int /*<<< orphan*/ outl(int, int);
uint32_t checkDevice(uint8_t bus, uint8_t device, uint8_t function) {
  uint32_t ret;
  outl(0x80000000 | (bus << 16) | (device << 11) | (function << 8) | 0x00,
       0xCF8);
  ret = inl(0xCFC);
  return ret;
}


x86 assembly (clang, -O0):
<checkDevice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x10,%edi
or     $0x80000000,%edi
mov    -0x8(%rbp),%eax
shl    $0xb,%eax
or     %eax,%edi
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
or     %eax,%edi
or     $0x0,%edi
mov    $0xcf8,%esi
call   1030 <outl@plt>
mov    $0xcfc,%edi
call   1040 <inl@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkDevice>:
push   %rax
shl    $0x10,%edi
shl    $0xb,%esi
or     %esi,%edi
shl    $0x8,%edx
or     %edx,%edi
or     $0x80000000,%edi
mov    $0xcf8,%esi
call   1030 <outl@plt>
mov    $0xcfc,%edi
pop    %rax
jmp    1040 <inl@plt>

LLVM IR (-O0):
define i32 @checkDevice(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = shl i32 %8, 16
%10 = or i32 -2147483648, %9
%11 = load i32, i32* %5
%12 = shl i32 %11, 11
%13 = or i32 %10, %12
%14 = load i32, i32* %6
%15 = shl i32 %14, 8
%16 = or i32 %13, %15
%17 = or i32 %16, 0
%18 = call i32 @outl(i32 %17, i32 3320)
%19 = call i32 @inl(i32 3324)
store i32 %19, i32* %7
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @checkDevice(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 16
%5 = shl i32 %1, 11
%6 = shl i32 %2, 8
%7 = or i32 %4, %5
%8 = or i32 %7, %6
%9 = or i32 %8, -2147483648
%10 = tail call i32 @outl(i32 %9, i32 3320)
%11 = tail call i32 @inl(i32 3324)
ret i32 %11
}
int test_imm_D8uint8_mem(unsigned char *val) {
  return ((*val) & (0xD8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D8uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -40
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct rlimit {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_AS;
int /*<<< orphan*/ getrlimit(int /*<<< orphan*/, struct rlimit *);
struct rlimit tp_info_sysmaxmem() {
  struct rlimit limit;
  getrlimit(RLIMIT_AS, &limit);
  return limit;
}


x86 assembly (clang, -O0):
<tp_info_sysmaxmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <getrlimit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tp_info_sysmaxmem>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <getrlimit@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@RLIMIT_AS = global i32 0
define i32 @tp_info_sysmaxmem() {
%1 = alloca %struct.rlimit
%2 = load i32, i32* @RLIMIT_AS
%3 = call i32 @getrlimit(i32 %2, %struct.rlimit* %1)
%4 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@RLIMIT_AS = global i32 0
define i32 @tp_info_sysmaxmem() {
%1 = alloca %struct.rlimit
%2 = load i32, i32* @RLIMIT_AS
%3 = call i32 @getrlimit(i32 %2, %struct.rlimit* %1)
%4 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_foot() {
  printf("    </g>\n");
  printf("</svg>\n");
}


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

x86 assembly (clang, -O2):
<print_foot>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [10 x i8] c" </g>\0A\00"
@.str.1 = [8 x i8] c"</svg>\0A\00"
define void @print_foot() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c" </g>\00"
@str.2 = [7 x i8] c"</svg>\00"
define void @print_foot() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0))
ret void
}
void rop3_193_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = ~S;
  stk3 = *D & stk4;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_193_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xe(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_193_0_0>:
mov    %esi,%eax
not    %al
and    (%rdi),%al
or     %dl,%al
xor    %sil,%al
not    %al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_193_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %10
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %10
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %9
%22 = load i8, i8* %6
%23 = zext i8 %22 to i32
%24 = load i8, i8* %9
%25 = zext i8 %24 to i32
%26 = or i32 %23, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %8
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = load i8, i8* %8
%31 = zext i8 %30 to i32
%32 = xor i32 %29, %31
%33 = trunc i32 %32 to i8
store i8 %33, i8* %7
%34 = load i8, i8* %7
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = trunc i32 %36 to i8
store i8 %37, i8* %7
%38 = load i8, i8* %7
%39 = load i8*, i8** %4
store i8 %38, i8* %39
ret void
}

LLVM IR (-O2):
define void @rop3_193_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = or i8 %6, %2
%8 = xor i8 %7, %1
%9 = xor i8 %8, -1
store i8 %9, i8* %0
ret void
}
/* Variables and functions */
int fscanf(int /*<<< orphan*/, char *, int *);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  int val = -1;
  int ret = -1;
  ret = fscanf(stdin, "%dh", &val);
  printf("ret = %d val = %d\n", ret, val);
  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)
movl   $0xffffffff,-0x14(%rbp)
movl   $0xffffffff,-0x18(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <fscanf@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1040 <fscanf@plt>
mov    0x4(%rsp),%edx
lea    0xeb6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%dh\00"
@.str.1 = [19 x i8] c"ret = %d val = %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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %6
store i32 -1, i32* %7
%8 = load i32, i32* @stdin
%9 = call i32 @fscanf(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %6)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%dh\00"
@.str.1 = [19 x i8] c"ret = %d val = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 -1, i32* %3
%5 = load i32, i32* @stdin
%6 = call i32 @fscanf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
int am_isspace(int c) {
  if ((c == ' ') || (c == '\f') || (c == '\n') || (c == '\r') || (c == '\t') ||
      (c == '\v'))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<am_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     1143 <am_isspace+0x43>
cmpl   $0xc,-0x8(%rbp)
je     1143 <am_isspace+0x43>
cmpl   $0xa,-0x8(%rbp)
je     1143 <am_isspace+0x43>
cmpl   $0xd,-0x8(%rbp)
je     1143 <am_isspace+0x43>
cmpl   $0x9,-0x8(%rbp)
je     1143 <am_isspace+0x43>
cmpl   $0xb,-0x8(%rbp)
jne    114f <am_isspace+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <am_isspace+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<am_isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%ecx
jae    110e <am_isspace+0xe>
ret
cmp    $0x20,%edi
je     110d <am_isspace+0xd>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @am_isspace(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 32
br i1 %5, label %21, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 12
br i1 %8, label %21, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 10
br i1 %11, label %21, label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 13
br i1 %14, label %21, label %15
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 9
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 11
br i1 %20, label %21, label %22
21: ; preds = %18, %15, %12, %9, %6, %1
store i32 1, i32* %2
br label %23
22: ; preds = %18
store i32 0, i32* %2
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @am_isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 13, label %3
i32 12, label %3
i32 11, label %3
i32 10, label %3
i32 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ func(int, int);
void testTortureExecute(void) {
  int x = 7;
  func(!x, !7);
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
xor    %esi,%esi
call   1030 <func@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTortureExecute>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <func@plt>

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = alloca i32
store i32 7, i32* %1
%2 = load i32, i32* %1
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
%6 = call i32 @func(i32 %5, i32 0)
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 @func(i32 0, i32 0)
ret void
}
void av_opt_set_sample_fmt() {}


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

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

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

LLVM IR (-O2):
define void @av_opt_set_sample_fmt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_nums(int);
int main() { print_nums(2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <print_nums@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @print_nums(i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print_nums(i32 2)
ret i32 0
}
void bar(void) {
  int a[9];
  a[-9] = 0;
}


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

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

LLVM IR (-O0):
define void @bar() {
%1 = alloca [9 x i32]
%2 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 -9
store i32 0, i32* %2
ret void
}

LLVM IR (-O2):
define void @bar() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int titleToNumber(char *);
int main() {
  printf("%d\n", titleToNumber("AB"));
  printf("%d\n", titleToNumber("Z"));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed9(%rip),%rdi
call   1040 <titleToNumber@plt>
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
call   1040 <titleToNumber@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xedc(%rip),%rdi
call   1040 <titleToNumber@plt>
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
call   1040 <titleToNumber@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"AB\00"
@.str.2 = [2 x i8] c"Z\00"
define i32 @main() {
%1 = call i32 @titleToNumber(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @titleToNumber(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"AB\00"
@.str.2 = [2 x i8] c"Z\00"
define i32 @main() {
%1 = tail call i32 @titleToNumber(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @titleToNumber(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int bounds(int x, int y) {
  if (x >= 0 && y >= 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<bounds>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     112a <bounds+0x2a>
cmpl   $0x0,-0xc(%rbp)
jl     112a <bounds+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <bounds+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bounds>:
mov    %edi,%eax
or     %esi,%eax
not    %eax
shr    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @bounds(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = xor i32 %3, -1
%5 = lshr i32 %4, 31
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int main() {
  foo();
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
ret i32 1
}
void setPT(int *context, int *pt) { *(context + 7) = (int)pt; }


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

x86 assembly (clang, -O2):
<setPT>:
mov    %esi,0x1c(%rdi)
ret

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

LLVM IR (-O2):
define void @setPT(i32* nocapture writeonly %0, i32* %1) {
%3 = ptrtoint i32* %1 to i64
%4 = trunc i64 %3 to i32
%5 = getelementptr inbounds i32, i32* %0, i64 7
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
scalar_t__ mt_rand_int32();
double mt_rand_real3(void) {
  return (((double)mt_rand_int32()) + 0.5) * (1.0 / 4294967296.0);
}


x86 assembly (clang, -O0):
<mt_rand_real3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mt_rand_int32@plt>
cvtsi2sd %rax,%xmm0
movsd  0xee0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xecc(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_rand_real3>:
push   %rax
xor    %eax,%eax
call   1030 <mt_rand_int32@plt>
cvtsi2sd %rax,%xmm0
addsd  0xedb(%rip),%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mt_rand_real3() {
%1 = call i64 (...) @mt_rand_int32()
%2 = sitofp i64 %1 to double
%3 = fadd double %2, 5.000000e-01
%4 = fmul double %3, 0x3DF0000000000000
ret double %4
}

LLVM IR (-O2):
define double @mt_rand_real3() {
%1 = tail call i64 (...) @mt_rand_int32()
%2 = sitofp i64 %1 to double
%3 = fadd double %2, 5.000000e-01
%4 = fmul double %3, 0x3DF0000000000000
ret double %4
}
void spca506_setquality(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @spca506_setquality(%struct.usb_spca50x* nocapture %0) {
ret void
}
void free_ullong(unsigned long long *val) {}


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

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

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

LLVM IR (-O2):
define void @free_ullong(i64* nocapture %0) {
ret void
}
int test_imm_73uint8_mem(unsigned char *val) {
  return ((*val) & (0x73 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_73uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 115
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ COND_PL();
int /*<<< orphan*/ EA_AY_IX_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_spl_8_ix(void) {
  m68ki_write_8(EA_AY_IX_8(), COND_PL() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_spl_8_ix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_IX_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_PL@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_spl_8_ix>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_IX_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_PL@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_spl_8_ix() {
%1 = call i32 (...) @EA_AY_IX_8()
%2 = call i64 (...) @COND_PL()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_spl_8_ix() {
%1 = tail call i32 (...) @EA_AY_IX_8()
%2 = tail call i64 (...) @COND_PL()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
int addn(int env, int arg) { return arg + env; }


x86 assembly (clang, -O0):
<addn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addn>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @addn(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @addn(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int invalid_indices(unsigned c, unsigned r, unsigned cc, unsigned rr) {
  return ((c < 0) || (r < 0) || (c > cc) || (r > rr));
}


x86 assembly (clang, -O0):
<invalid_indices>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x11(%rbp)
jb     114b <invalid_indices+0x4b>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jb     114b <invalid_indices+0x4b>
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
ja     114b <invalid_indices+0x4b>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
seta   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalid_indices>:
cmp    %edx,%edi
seta   %al
cmp    %ecx,%esi
seta   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @invalid_indices(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp ugt i32 %0, %2
%6 = icmp ugt i32 %1, %3
%7 = or i1 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ ShowData(unsigned char);
unsigned char ejtag_read(int);
int /*<<< orphan*/ ejtag_write(int, int);
int /*<<< orphan*/ printf(char *, unsigned char);
unsigned char ATstatus_reg(void) {
  unsigned char status;
  ejtag_write(0x1fc00000, 0x57);
  status = ejtag_read(0x1fc00000 & 0x80);
  printf("id bit = 0x%08x\n", status & 0x3c);
  ShowData(status);
  return status;
}


x86 assembly (clang, -O0):
<ATstatus_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1fc00000,%edi
mov    $0x57,%esi
call   1060 <ejtag_write@plt>
xor    %edi,%edi
call   1040 <ejtag_read@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x3c,%eax
lea    0xe91(%rip),%rdi
movzbl %al,%esi
call   1030 <printf@plt>
movzbl -0x1(%rbp),%edi
call   1050 <ShowData@plt>
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ATstatus_reg>:
push   %rbx
mov    $0x1fc00000,%edi
mov    $0x57,%esi
call   1060 <ejtag_write@plt>
xor    %edi,%edi
call   1040 <ejtag_read@plt>
mov    %eax,%ebx
and    $0x3c,%al
movzbl %al,%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
movzbl %bl,%ebx
mov    %ebx,%edi
call   1050 <ShowData@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"id bit = 0x%08x\0A\00"
define zeroext i8 @ATstatus_reg() {
%1 = alloca i8
%2 = call i32 @ejtag_write(i32 532676608, i32 87)
%3 = call zeroext i8 @ejtag_read(i32 0)
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
%6 = and i32 %5, 60
%7 = trunc i32 %6 to i8
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 zeroext %7)
%9 = load i8, i8* %1
%10 = call i32 @ShowData(i8 zeroext %9)
%11 = load i8, i8* %1
ret i8 %11
}

LLVM IR (-O2):
@.str = [17 x i8] c"id bit = 0x%08x\0A\00"
define zeroext i8 @ATstatus_reg() {
%1 = tail call i32 @ejtag_write(i32 532676608, i32 87)
%2 = tail call zeroext i8 @ejtag_read(i32 0)
%3 = and i8 %2, 60
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 zeroext %3)
%5 = tail call i32 @ShowData(i8 zeroext %2)
ret i8 %2
}
long AtoI(s)
char s[];
{
  double AtoF();
  return (AtoF(s));
}


x86 assembly (clang, -O0):
<AtoI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <AtoF@plt>
cvttsd2si %xmm0,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AtoI>:
push   %rax
xor    %eax,%eax
call   1030 <AtoF@plt>
cvttsd2si %xmm0,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @AtoI(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call double (i8*, ...) bitcast (double (...)* @AtoF to double (i8*, ...)*)(i8* %3)
%5 = fptosi double %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @AtoI(i8* %0) {
%2 = tail call double (i8*, ...) bitcast (double (...)* @AtoF to double (i8*, ...)*)(i8* %0)
%3 = fptosi double %2 to i64
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ sla_dcc2s(double *, double *, double *);
void csla_dcc2s(double v[3], double *a, double *b) { sla_dcc2s(v, a, b); }


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

x86 assembly (clang, -O2):
<csla_dcc2s>:
jmp    1030 <sla_dcc2s@plt>

LLVM IR (-O0):
define void @csla_dcc2s(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load double*, double** %6
%10 = call i32 @sla_dcc2s(double* %7, double* %8, double* %9)
ret void
}

LLVM IR (-O2):
define void @csla_dcc2s(double* %0, double* %1, double* %2) {
%4 = tail call i32 @sla_dcc2s(double* %0, double* %1, double* %2)
ret void
}
/* Type definitions */
typedef int uint64_t;
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t hover_timestamp_now() {
  struct timespec val;
  clock_gettime(CLOCK_REALTIME, &val);
  return val.tv_sec * 1000 + val.tv_nsec / 1000000;
}


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

x86 assembly (clang, -O2):
<hover_timestamp_now>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_REALTIME = global i32 0
define i32 @hover_timestamp_now() {
%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 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000000
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_REALTIME = global i32 0
define i32 @hover_timestamp_now() {
%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 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000000
%11 = add nsw i32 %10, %7
ret i32 %11
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int get_constant(int /*<<< orphan*/);
int /*<<< orphan*/ next_word(char *);
int assemble_throw(char *line) {
  int constant = get_constant(next_word(line));
  if (constant != 0xffff)
    return (int8_t)constant;
  return -1;
}


x86 assembly (clang, -O0):
<assemble_throw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <next_word@plt>
mov    %eax,%edi
call   1040 <get_constant@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffff,-0x14(%rbp)
je     1157 <assemble_throw+0x37>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <assemble_throw+0x3e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assemble_throw>:
push   %rax
call   1030 <next_word@plt>
mov    %eax,%edi
call   1040 <get_constant@plt>
cmp    $0xffff,%eax
mov    $0xffffffff,%ecx
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @assemble_throw(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @next_word(i8* %5)
%7 = call i32 @get_constant(i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 65535
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @assemble_throw(i8* %0) {
%2 = tail call i32 @next_word(i8* %0)
%3 = tail call i32 @get_constant(i32 %2)
%4 = icmp eq i32 %3, 65535
%5 = select i1 %4, i32 -1, i32 %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ do_b(int);
int main(void) {
  (void)do_b(50);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @do_b(i32 50)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ log_exit(char *, int);
void signal_exit(int sig) { log_exit("exit by signal %d", sig); }


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

x86 assembly (clang, -O2):
<signal_exit>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <log_exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"exit by signal %d\00"
define void @signal_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @log_exit(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"exit by signal %d\00"
define void @signal_exit(i32 %0) {
%2 = tail call i32 @log_exit(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_cvolume_scale_mask() {
  printf("NOT IMPLEMENTED:"
         "pa_cvolume_scale_mask"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"NOT IMPLEMENTED:pa_cvolume_scale_mask\0A\00"
define i32 @pa_cvolume_scale_mask() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_cvolume_scale_mask\00"
define i32 @pa_cvolume_scale_mask() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int within(int value, int lower_bound, int upper_bound) {
  return value >= lower_bound && value <= upper_bound;
}


x86 assembly (clang, -O0):
<within>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0xd(%rbp)
jl     112a <within+0x2a>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<within>:
cmp    %esi,%edi
setge  %al
cmp    %edx,%edi
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @within(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp sge i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = icmp sle i32 %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ false, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @within(i32 %0, i32 %1, i32 %2) {
%4 = icmp sge i32 %0, %1
%5 = icmp sle i32 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i = -2;
  unsigned int j = 1;
  if ((i + j) >= 0)
    printf("i + j >= 0\n");
  else
    printf("i + j < 0\n");
  printf("i + j = %d\n", i + j);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffffe,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    $0x0,%eax
jb     114f <main+0x3f>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115d <main+0x4d>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"i + j >= 0\0A\00"
@.str.1 = [11 x i8] c"i + j < 0\0A\00"
@.str.2 = [12 x i8] c"i + j = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 -2, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add i32 %4, %5
%7 = icmp uge i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = add i32 %13, %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str.2 = [12 x i8] c"i + j = %d\0A\00"
@str = [11 x i8] c"i + j >= 0\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 -1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ arc4random_buf(int /*<<< orphan*/ *, int);
void bufferAccessOutOfBounds(void) {
  uint16_t uint16Buf[4];
  arc4random_buf(uint16Buf, 9);
  arc4random_buf(uint16Buf, 8);
}


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

x86 assembly (clang, -O2):
<bufferAccessOutOfBounds>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <arc4random_buf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <arc4random_buf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @bufferAccessOutOfBounds() {
%1 = alloca [4 x i32]
%2 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%3 = call i32 @arc4random_buf(i32* %2, i32 9)
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%5 = call i32 @arc4random_buf(i32* %4, i32 8)
ret void
}

LLVM IR (-O2):
define void @bufferAccessOutOfBounds() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @arc4random_buf(i32* %3, i32 9)
%5 = call i32 @arc4random_buf(i32* %3, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void storage_help() {
  printf("/********************* module: storage (console) "
         "******************************/\n"
         "This is a dummy storage module. Use this to test the rest of the "
         "program when\n"
         "you don't have or want a database.\n"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [196 x i8] c"/********************* module: storage (console) ******************************/\0AThis is a dummy storage module. Use this to test the rest of the program when\0Ayou don't have or want a database.\0A\0A\00"
define void @storage_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [195 x i8] c"/********************* module: storage (console) ******************************/\0AThis is a dummy storage module. Use this to test the rest of the program when\0Ayou don't have or want a database.\0A\00"
define void @storage_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([195 x i8], [195 x i8]* @str, i64 0, i64 0))
ret void
}
int FCEUD_ShowStatusIcon(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @FCEUD_ShowStatusIcon() {
ret i32 0
}
/* Variables and functions */
scalar_t__ __sh_cas(void volatile *, int, int);
void *a_cas_p(volatile void *p, void *t, void *s) {
  return (void *)__sh_cas(p, (int)t, (int)s);
}


x86 assembly (clang, -O0):
<a_cas_p>:
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),%rax
mov    %eax,%esi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
call   1030 <__sh_cas@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_cas_p>:
jmp    1030 <__sh_cas@plt>

LLVM IR (-O0):
define i8* @a_cas_p(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i32
%10 = load i8*, i8** %6
%11 = ptrtoint i8* %10 to i32
%12 = call i64 @__sh_cas(i8* %7, i32 %9, i32 %11)
%13 = inttoptr i64 %12 to i8*
ret i8* %13
}

LLVM IR (-O2):
define i8* @a_cas_p(i8* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %1 to i64
%5 = trunc i64 %4 to i32
%6 = ptrtoint i8* %2 to i64
%7 = trunc i64 %6 to i32
%8 = tail call i64 @__sh_cas(i8* %0, i32 %5, i32 %7)
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}