xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char colour[50];
  printf("What's your favourite colour?\n");
  scanf("%49s", colour);
  printf("You said: %s\n", colour);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xed7(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x40(%rbp),%rsi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"What's your favourite colour?\0A\00"
@.str.1 = [5 x i8] c"%49s\00"
@.str.2 = [14 x i8] c"You said: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%49s\00"
@.str.2 = [14 x i8] c"You said: %s\0A\00"
@str = [30 x i8] c"What's your favourite colour?\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mymodule_destroy();
int mymodule_get();
int /*<<< orphan*/ mymodule_init();
int /*<<< orphan*/ mymodule_set(int);
int main() {
  mymodule_init();
  mymodule_set(50);
  int x = mymodule_get();
  mymodule_destroy();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <mymodule_init@plt>
mov    $0x32,%edi
call   1040 <mymodule_set@plt>
mov    $0x0,%al
call   1030 <mymodule_get@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <mymodule_destroy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <mymodule_init@plt>
mov    $0x32,%edi
call   1040 <mymodule_set@plt>
xor    %eax,%eax
call   1030 <mymodule_get@plt>
xor    %eax,%eax
call   1050 <mymodule_destroy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @mymodule_init()
%4 = call i32 @mymodule_set(i32 50)
%5 = call i32 (...) @mymodule_get()
store i32 %5, i32* %2
%6 = call i32 (...) @mymodule_destroy()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mymodule_init()
%2 = tail call i32 @mymodule_set(i32 50)
%3 = tail call i32 (...) @mymodule_get()
%4 = tail call i32 (...) @mymodule_destroy()
ret i32 0
}
/* Type definitions */
struct trie_node {
  int dummy;
};

/* Variables and functions */
void *_trie_node_val(struct trie_node *, char *, int, int /*<<< orphan*/ *);
void *trie_node_val(struct trie_node *first, char *s, int len) {
  return _trie_node_val(first, s, len, NULL);
}


x86 assembly (clang, -O0):
<trie_node_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <_trie_node_val@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trie_node_val>:
xor    %ecx,%ecx
jmp    1030 <_trie_node_val@plt>

LLVM IR (-O0):
%struct.trie_node = type { i32 }
define i8* @trie_node_val(%struct.trie_node* %0, i8* %1, i32 %2) {
%4 = alloca %struct.trie_node*
%5 = alloca i8*
%6 = alloca i32
store %struct.trie_node* %0, %struct.trie_node** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.trie_node*, %struct.trie_node** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i8* @_trie_node_val(%struct.trie_node* %7, i8* %8, i32 %9, i32* null)
ret i8* %10
}

LLVM IR (-O2):
%struct.trie_node = type { i32 }
define i8* @trie_node_val(%struct.trie_node* %0, i8* %1, i32 %2) {
%4 = tail call i8* @_trie_node_val(%struct.trie_node* %0, i8* %1, i32 %2, i32* null)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ encrypt(char *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
int main() {
  char msg[80];
  while (fgets(msg, 80, stdin)) {
    encrypt(msg);
    printf("%s\n", msg);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     117e <main+0x4e>
lea    -0x60(%rbp),%rdi
call   1040 <encrypt@plt>
lea    -0x60(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    0x2ea8(%rip),%r15
mov    (%r15),%edx
mov    %rsp,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
test   %rax,%rax
je     1188 <main+0x58>
mov    %rsp,%rbx
lea    0xea1(%rip),%r14
nop
mov    %rbx,%rdi
call   1040 <encrypt@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
test   %rax,%rax
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i64 @fgets(i8* %2, i32 80, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = call i32 @encrypt(i8* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%9 = load i32, i32* @stdin
%10 = call i64 @fgets(i8* %2, i32 80, i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 0
}
/* Type definitions */
struct emmc_block_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sd_card_init(struct emmc_block_dev *, unsigned char,
                                int /*<<< orphan*/);
void unlock(struct emmc_block_dev *emmc_dev) {
  sd_card_init(emmc_dev, 'U', 0);
  return;
}


x86 assembly (clang, -O0):
<unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x55,%esi
xor    %edx,%edx
call   1030 <sd_card_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlock>:
mov    $0x55,%esi
xor    %edx,%edx
jmp    1030 <sd_card_init@plt>

LLVM IR (-O0):
%struct.emmc_block_dev = type { i32 }
define void @unlock(%struct.emmc_block_dev* %0) {
%2 = alloca %struct.emmc_block_dev*
store %struct.emmc_block_dev* %0, %struct.emmc_block_dev** %2
%3 = load %struct.emmc_block_dev*, %struct.emmc_block_dev** %2
%4 = call i32 @sd_card_init(%struct.emmc_block_dev* %3, i8 zeroext 85, i32 0)
ret void
}

LLVM IR (-O2):
%struct.emmc_block_dev = type { i32 }
define void @unlock(%struct.emmc_block_dev* %0) {
%2 = tail call i32 @sd_card_init(%struct.emmc_block_dev* %0, i8 zeroext 85, i32 0)
ret void
}
void toggle_io(volatile unsigned char *port) {
  while (1) {
    *port = 0x00;
    *port = 0xFF;
  }
}


x86 assembly (clang, -O0):
<toggle_io>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movb   $0xff,(%rax)
jmp    1108 <toggle_io+0x8>

x86 assembly (clang, -O2):
<toggle_io>:
movb   $0x0,(%rdi)
movb   $0xff,(%rdi)
jmp    1100 <toggle_io>

LLVM IR (-O0):
define void @toggle_io(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = load i8*, i8** %2
store volatile i8 0, i8* %4
%5 = load i8*, i8** %2
store volatile i8 -1, i8* %5
br label %3
}

LLVM IR (-O2):
define void @toggle_io(i8* %0) {
br label %2
2: ; preds = %1, %2
store volatile i8 0, i8* %0
store volatile i8 -1, i8* %0
br label %2
}
int test_imm_42uint8_mem(unsigned char *val) {
  return ((*val) & (0x42 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_42uint8_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, 66
%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_42uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 66
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ToLE16(int /*<<< orphan*/);
void WriteUnalignedLE16(uint16_t *p, uint16_t value) { *p = ToLE16(value); }


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

x86 assembly (clang, -O2):
<WriteUnalignedLE16>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <ToLE16@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @WriteUnalignedLE16(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 = call i32 @ToLE16(i32 %5)
%7 = load i32*, i32** %3
store i32 %6, i32* %7
ret void
}

LLVM IR (-O2):
define void @WriteUnalignedLE16(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @ToLE16(i32 %1)
store i32 %3, i32* %0
ret void
}
int MPIN_GS() { return (1 + (254 - 1) / 8); }


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

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

LLVM IR (-O0):
define i32 @MPIN_GS() {
ret i32 32
}

LLVM IR (-O2):
define i32 @MPIN_GS() {
ret i32 32
}
int getFortySomething() { return 42; }


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

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

LLVM IR (-O0):
define i32 @getFortySomething() {
ret i32 42
}

LLVM IR (-O2):
define i32 @getFortySomething() {
ret i32 42
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
unsigned int _mm_extract_epi16(int /*<<< orphan*/, int);
unsigned int foo16(__m128i x) { return _mm_extract_epi16(x, 3); }


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

x86 assembly (clang, -O2):
<foo16>:
mov    $0x3,%esi
jmp    1030 <_mm_extract_epi16@plt>

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

LLVM IR (-O2):
define i32 @foo16(i32 %0) {
%2 = tail call i32 @_mm_extract_epi16(i32 %0, i32 3)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dtor3() { printf("Destroy3!\n"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"Destroy3!\0A\00"
define void @dtor3() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"Destroy3!\00"
define void @dtor3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int f230(int *);
int f231(int *p) { return f230(p); }


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

x86 assembly (clang, -O2):
<f231>:
jmp    1030 <f230@plt>

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

LLVM IR (-O2):
define i32 @f231(i32* %0) {
%2 = tail call i32 @f230(i32* %0)
ret i32 %2
}
int log_2(int n) {
  if (n < 2)
    return 0;
  else
    return log_2(n / 2) + 1;
}


x86 assembly (clang, -O0):
<log_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1131 <log_2+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1149 <log_2+0x39>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <log_2@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_2>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     111c <log_2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <log_2+0x10>
ret

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

LLVM IR (-O2):
define i32 @log_2(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = lshr i32 %4, 1
%7 = add nuw nsw i32 %5, 1
%8 = icmp ult i32 %4, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
main() {
  int looper;
  long long int a, b, c, l, mod_progress;
  for (looper = 0; looper < 1000; looper++) {
    for (l = 0; l < 2000000000; l++) {
      c = a + b + l;
      mod_progress = l % 100000000;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    117b <main+0x7b>
movq   $0x0,-0x28(%rbp)
cmpq   $0x77359400,-0x28(%rbp)
77
jge    1168 <main+0x68>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
mov    $0x5f5e100,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1127 <main+0x27>
jmp    116d <main+0x6d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i32 0, i32* %1
store i32 0, i32* %2
br label %8
8: ; preds = %27, %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 1000
br i1 %10, label %11, label %30
11: ; preds = %8
store i64 0, i64* %6
br label %12
12: ; preds = %23, %11
%13 = load i64, i64* %6
%14 = icmp slt i64 %13, 2000000000
br i1 %14, label %15, label %26
15: ; preds = %12
%16 = load i64, i64* %3
%17 = load i64, i64* %4
%18 = add nsw i64 %16, %17
%19 = load i64, i64* %6
%20 = add nsw i64 %18, %19
store i64 %20, i64* %5
%21 = load i64, i64* %6
%22 = srem i64 %21, 100000000
store i64 %22, i64* %7
br label %23
23: ; preds = %15
%24 = load i64, i64* %6
%25 = add nsw i64 %24, 1
store i64 %25, i64* %6
br label %12
26: ; preds = %12
br label %27
27: ; preds = %26
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
br label %8
30: ; preds = %8
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __bswap_32(int /*<<< orphan*/);
uint32_t __attribute__((unused)) SwapBytes32(uint32_t x) {
  return __bswap_32(x);
}


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

x86 assembly (clang, -O2):
<SwapBytes32>:
jmp    1030 <__bswap_32@plt>

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

LLVM IR (-O2):
define i32 @SwapBytes32(i32 %0) {
%2 = tail call i32 @__bswap_32(i32 %0)
ret i32 %2
}
/* Variables and functions */
double cdfgpa_(double *, double *);
double ccdfgpa(double *x, double *para) { return cdfgpa_(x, para); }


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

x86 assembly (clang, -O2):
<ccdfgpa>:
jmp    1030 <cdfgpa_@plt>

LLVM IR (-O0):
define double @ccdfgpa(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
%7 = call double @cdfgpa_(double* %5, double* %6)
ret double %7
}

LLVM IR (-O2):
define double @ccdfgpa(double* %0, double* %1) {
%3 = tail call double @cdfgpa_(double* %0, double* %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ mpeg_submit_chunk(unsigned char const *, size_t const);
void dispatch_mpeg_audio(const char *mname, const unsigned char *data,
                         const size_t len) {
  mpeg_submit_chunk(data, len);
}


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

x86 assembly (clang, -O2):
<dispatch_mpeg_audio>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <mpeg_submit_chunk@plt>

LLVM IR (-O0):
define void @dispatch_mpeg_audio(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = call i32 @mpeg_submit_chunk(i8* %7, i64 %8)
ret void
}

LLVM IR (-O2):
define void @dispatch_mpeg_audio(i8* nocapture readnone %0, i8* %1, i64 %2) {
%4 = tail call i32 @mpeg_submit_chunk(i8* %1, i64 %2)
ret void
}
long long terms(long long x) {
  long long i, j, sum = 0;
  while (x != 1) {
    if (x % 2 == 0) {
      x /= 2;
      sum++;
    } else {
      x = x * 3 + 1;
      sum++;
    }
  }
  return sum;
}


x86 assembly (clang, -O0):
<terms>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x1,-0x8(%rbp)
je     1174 <terms+0x74>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1156 <terms+0x56>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    116f <terms+0x6f>
imul   $0x3,-0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1110 <terms+0x10>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<terms>:
xor    %eax,%eax
cmp    $0x1,%rdi
jne    112a <terms+0x2a>
jmp    1142 <terms+0x42>
nopw   0x0(%rax,%rax,1)
mov    %rdi,%rcx
shr    $0x3f,%rcx
add    %rdi,%rcx
sar    %rcx
mov    %rcx,%rdi
add    $0x1,%rax
cmp    $0x1,%rdi
je     1142 <terms+0x42>
test   $0x1,%dil
je     1110 <terms+0x10>
lea    (%rdi,%rdi,2),%rdi
add    $0x1,%rdi
add    $0x1,%rax
cmp    $0x1,%rdi
jne    112a <terms+0x2a>
ret

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

LLVM IR (-O2):
define i64 @terms(i64 %0) {
%2 = icmp eq i64 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1, %13
%4 = phi i64 [ %15, %13 ], [ 0, %1 ]
%5 = phi i64 [ %14, %13 ], [ %0, %1 ]
%6 = and i64 %5, 1
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = sdiv i64 %5, 2
br label %13
10: ; preds = %3
%11 = mul nsw i64 %5, 3
%12 = add nsw i64 %11, 1
br label %13
13: ; preds = %10, %8
%14 = phi i64 [ %9, %8 ], [ %12, %10 ]
%15 = add nuw nsw i64 %4, 1
%16 = icmp eq i64 %14, 1
br i1 %16, label %17, label %3
17: ; preds = %13, %1
%18 = phi i64 [ 0, %1 ], [ %15, %13 ]
ret i64 %18
}
void bc_1L_none(struct grid *g, struct parList *par) {}


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

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

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

LLVM IR (-O2):
%struct.grid = type opaque
%struct.parList = type opaque
define void @bc_1L_none(%struct.grid* nocapture %0, %struct.parList* nocapture %1) {
ret void
}
/* Variables and functions */
short abs(short);
short d(short x1, short y1, short x2, short y2) {
  short dd, xd, yd;
  xd = abs(x2 - x1);
  yd = abs(y2 - y1);
  if (yd >= xd)
    dd = yd;
  else
    dd = xd;
  return dd;
}


x86 assembly (clang, -O0):
<d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
movswl -0x6(%rbp),%eax
movswl -0x2(%rbp),%ecx
sub    %ecx,%eax
movswl %ax,%edi
call   1030 <abs@plt>
mov    %ax,-0xc(%rbp)
movswl -0x8(%rbp),%eax
movswl -0x4(%rbp),%ecx
sub    %ecx,%eax
movswl %ax,%edi
call   1030 <abs@plt>
mov    %ax,-0xe(%rbp)
movswl -0xe(%rbp),%eax
movswl -0xc(%rbp),%ecx
cmp    %ecx,%eax
jl     117d <d+0x6d>
mov    -0xe(%rbp),%ax
mov    %ax,-0xa(%rbp)
jmp    1185 <d+0x75>
mov    -0xc(%rbp),%ax
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d>:
sub    %edi,%edx
mov    %edx,%edi
neg    %di
cmovs  %dx,%di
sub    %esi,%ecx
mov    %ecx,%eax
neg    %ax
cmovs  %cx,%ax
cmp    %di,%ax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @d(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
%9 = alloca i16
%10 = alloca i16
%11 = alloca i16
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%12 = load i16, i16* %7
%13 = sext i16 %12 to i32
%14 = load i16, i16* %5
%15 = sext i16 %14 to i32
%16 = sub nsw i32 %13, %15
%17 = trunc i32 %16 to i16
%18 = call signext i16 @abs(i16 signext %17)
store i16 %18, i16* %10
%19 = load i16, i16* %8
%20 = sext i16 %19 to i32
%21 = load i16, i16* %6
%22 = sext i16 %21 to i32
%23 = sub nsw i32 %20, %22
%24 = trunc i32 %23 to i16
%25 = call signext i16 @abs(i16 signext %24)
store i16 %25, i16* %11
%26 = load i16, i16* %11
%27 = sext i16 %26 to i32
%28 = load i16, i16* %10
%29 = sext i16 %28 to i32
%30 = icmp sge i32 %27, %29
br i1 %30, label %31, label %33
31: ; preds = %4
%32 = load i16, i16* %11
store i16 %32, i16* %9
br label %35
33: ; preds = %4
%34 = load i16, i16* %10
store i16 %34, i16* %9
br label %35
35: ; preds = %33, %31
%36 = load i16, i16* %9
ret i16 %36
}

LLVM IR (-O2):
define signext i16 @d(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = sub i16 %2, %0
%6 = tail call i16 @llvm.abs.i16(i16 %5, i1 true)
%7 = sub i16 %3, %1
%8 = tail call i16 @llvm.abs.i16(i16 %7, i1 true)
%9 = icmp ult i16 %8, %6
%10 = select i1 %9, i16 %6, i16 %8
ret i16 %10
}
void foo524() {}


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

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

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

LLVM IR (-O2):
define void @foo524() {
ret void
}
int test_leading_extension() { __extension__(*(char *)0) = 1; }


x86 assembly (clang, -O0):
<test_leading_extension>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
movb   $0x1,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @test_leading_extension() {
%1 = alloca i32
store i8 1, i8* null
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
int saveLabelingSettings() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @saveLabelingSettings() {
ret i32 0
}
/* Variables and functions */
int maxProfit(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int a[] = {4, 3, 2, 1};
  printf("%d\n", maxProfit(a, 4));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1040 <maxProfit@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1040 <maxProfit@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [4 x i32] [i32 4, i32 3, i32 2, i32 1]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4 x i32]
%4 = bitcast [4 x i32]* %3 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%6 = call i32 @maxProfit(i32* %5, i32 4)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_variable_endvars();
void fgmvwrite_variable_endvars_() { gmvwrite_variable_endvars(); }


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

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

LLVM IR (-O0):
define void @fgmvwrite_variable_endvars_() {
%1 = call i32 (...) @gmvwrite_variable_endvars()
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_variable_endvars_() {
%1 = tail call i32 (...) @gmvwrite_variable_endvars()
ret void
}
int test_imm_5Buint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x5B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Buint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 91
%7 = icmp ne i64 %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_5Buint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 390842023936
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_B9int64_highword_reg(long long val) {
  return ((val >> 32) & (0xB9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B9int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 185
%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_B9int64_highword_reg(i64 %0) {
%2 = and i64 %0, 794568949760
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fnmatch(char const *, char const *, int /*<<< orphan*/);
int gmatch(const char *s, const char *p) { return !fnmatch(p, s, 0); }


x86 assembly (clang, -O0):
<gmatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
xor    %edx,%edx
call   1030 <fnmatch@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gmatch(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @fnmatch(i8* %5, i8* %6, i32 0)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @gmatch(i8* %0, i8* %1) {
%3 = tail call i32 @fnmatch(i8* %1, i8* %0, i32 0)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void __attribute__((no)) HEX00_hashesInit(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @HEX00_hashesInit() {
ret void
}
int tswrap() { return 1; }


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

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

LLVM IR (-O0):
define i32 @tswrap() {
ret i32 1
}

LLVM IR (-O2):
define i32 @tswrap() {
ret i32 1
}
void gtk_cell_renderer_toggle_get_active() {}


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

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

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

LLVM IR (-O2):
define void @gtk_cell_renderer_toggle_get_active() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  if (!ptr) {
    fprintf(stderr, "malloc() failed.  Exit.\n");
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <xmalloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"malloc() failed. Exit.\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
void pal_get_resource_property(const char **property_name,
                               int *property_value) {
  *property_name = 0;
  (void)property_value;
}


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

x86 assembly (clang, -O2):
<pal_get_resource_property>:
movq   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @pal_get_resource_property(i8** nocapture writeonly %0, i32* nocapture readnone %1) {
store i8* null, i8** %0
ret void
}
void nand_chip_enable(void) {
  (*(volatile unsigned int *)0x4E000004) &= ~(1 << 1);
}


x86 assembly (clang, -O0):
<nand_chip_enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4e000004,%eax
mov    (%rax),%ecx
and    $0xfffffffd,%ecx
mov    $0x4e000004,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_chip_enable>:
andl   $0xfffffffd,0x4e000004
fd
ret

LLVM IR (-O0):
define void @nand_chip_enable() {
%1 = load volatile i32, i32* inttoptr (i64 1308622852 to i32*)
%2 = and i32 %1, -3
store volatile i32 %2, i32* inttoptr (i64 1308622852 to i32*)
ret void
}

LLVM IR (-O2):
define void @nand_chip_enable() {
%1 = load volatile i32, i32* inttoptr (i64 1308622852 to i32*)
%2 = and i32 %1, -3
store volatile i32 %2, i32* inttoptr (i64 1308622852 to i32*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ chacha_crypt(int /*<<< orphan*/ *,
                                int /*<<< orphan*/ const *);
void chacha_enc_512(uint32_t *out, const uint32_t *in) {
  uint8_t *o = (uint8_t *)out;
  const uint8_t *i = (const uint8_t *)in;
  for (int j = 0; j < 64; j++) {
    chacha_crypt(o, i);
    o++;
    i++;
  }
}


x86 assembly (clang, -O0):
<chacha_enc_512>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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)
movl   $0x0,-0x24(%rbp)
cmpl   $0x40,-0x24(%rbp)
jge    1174 <chacha_enc_512+0x64>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <chacha_crypt@plt>
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1137 <chacha_enc_512+0x27>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chacha_enc_512>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   (%rax)
lea    (%r14,%rbx,1),%rsi
lea    (%r15,%rbx,1),%rdi
call   1030 <chacha_crypt@plt>
add    $0x4,%rbx
cmp    $0x100,%ebx
jne    1120 <chacha_enc_512+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @chacha_enc_512(i32* %0, i32* %1) {
br label %4
3: ; preds = %4
ret void
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %11, %4 ]
%6 = phi i32* [ %1, %2 ], [ %10, %4 ]
%7 = phi i32* [ %0, %2 ], [ %9, %4 ]
%8 = tail call i32 @chacha_crypt(i32* %7, i32* %6)
%9 = getelementptr inbounds i32, i32* %7, i64 1
%10 = getelementptr inbounds i32, i32* %6, i64 1
%11 = add nuw nsw i32 %5, 1
%12 = icmp eq i32 %11, 64
br i1 %12, label %3, label %4
}
__attribute__((no)) short int foo2(int x) { return x; }


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

x86 assembly (clang, -O2):
<foo2>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @foo2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @foo2(i32 %0) {
%2 = trunc i32 %0 to i16
ret i16 %2
}
/* Type definitions */
typedef long long time_t;
struct timeval {
  long long tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
time_t current_timestamp() {
  struct timeval te;
  gettimeofday(&te, NULL);
  return te.tv_sec * 1000LL + te.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<current_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%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):
<current_timestamp>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x8(%rsp),%rcx
movslq 0x10(%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.timeval = type { i64, i32 }
define i64 @current_timestamp() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = sext i32 %8 to i64
%10 = add nsw i64 %5, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i32 }
define i64 @current_timestamp() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%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
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ function(struct TreeNode *, int *, int *);
scalar_t__ malloc(int);
int *preorderTraversal(struct TreeNode *root, int *returnSize) {
  int *result = (int *)malloc(sizeof(int) * 1000);
  *returnSize = 0;
  function(root, result, returnSize);
  return result;
}


x86 assembly (clang, -O0):
<preorderTraversal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xfa0,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <function@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<preorderTraversal>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    $0xfa0,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
movl   $0x0,(%r15)
mov    %r14,%rdi
mov    %rax,%rsi
mov    %r15,%rdx
call   1040 <function@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32* @preorderTraversal(%struct.TreeNode* %0, i32* %1) {
%3 = alloca %struct.TreeNode*
%4 = alloca i32*
%5 = alloca i32*
store %struct.TreeNode* %0, %struct.TreeNode** %3
store i32* %1, i32** %4
%6 = call i64 @malloc(i32 4000)
%7 = inttoptr i64 %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %4
store i32 0, i32* %8
%9 = load %struct.TreeNode*, %struct.TreeNode** %3
%10 = load i32*, i32** %5
%11 = load i32*, i32** %4
%12 = call i32 @function(%struct.TreeNode* %9, i32* %10, i32* %11)
%13 = load i32*, i32** %5
ret i32* %13
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32* @preorderTraversal(%struct.TreeNode* %0, i32* %1) {
%3 = tail call i64 @malloc(i32 4000)
%4 = inttoptr i64 %3 to i32*
store i32 0, i32* %1
%5 = tail call i32 @function(%struct.TreeNode* %0, i32* %4, i32* %1)
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_RADIO_RESET_PIN() { clear_io_bit(-1, 2); }


x86 assembly (clang, -O0):
<TOSH_CLR_RADIO_RESET_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
mov    $0x2,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_RADIO_RESET_PIN>:
mov    $0xffffffff,%edi
mov    $0x2,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_RADIO_RESET_PIN() {
%1 = call i32 @clear_io_bit(i32 -1, i32 2)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_RADIO_RESET_PIN() {
%1 = tail call i32 @clear_io_bit(i32 -1, i32 2)
ret void
}
/* Variables and functions */
double floor(double);
double qFloor(double a) { return floor(a); }


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

x86 assembly (clang, -O2):
<qFloor>:
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @qFloor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.floor.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @qFloor(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *mem = malloc(size);
  if (!mem) {
    fprintf(stderr, "xMalloc: Out Of memory [req: %ld]\n", (long)size);
    exit(1);
  }
  return mem;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <xmalloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <xmalloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"xMalloc: Out Of memory [req: %ld]\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}