xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ disable_irq(unsigned int);
__attribute__((always_)) void disable_irq_lockdep(unsigned int irq) {
  disable_irq(irq);
}


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

x86 assembly (clang, -O2):
<disable_irq_lockdep>:
jmp    1030 <disable_irq@plt>

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

LLVM IR (-O2):
define void @disable_irq_lockdep(i32 %0) {
%2 = tail call i32 @disable_irq(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ArgNum();
int /*<<< orphan*/ GetFlag(int /*<<< orphan*/);
int /*<<< orphan*/ Me();
int /*<<< orphan*/ SendItem(int /*<<< orphan*/, char *, int /*<<< orphan*/);
void Act_Print(void) { SendItem(Me(), "%d", GetFlag(ArgNum())); }


x86 assembly (clang, -O0):
<Act_Print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <Me@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <ArgNum@plt>
mov    %eax,%edi
call   1040 <GetFlag@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%edx
lea    0xe94(%rip),%rsi
call   1030 <SendItem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Act_Print>:
push   %rbx
xor    %eax,%eax
call   1060 <Me@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <ArgNum@plt>
mov    %eax,%edi
call   1040 <GetFlag@plt>
lea    0xea1(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <SendItem@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @Act_Print() {
%1 = call i32 (...) @Me()
%2 = call i32 (...) @ArgNum()
%3 = call i32 @GetFlag(i32 %2)
%4 = call i32 @SendItem(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @Act_Print() {
%1 = tail call i32 (...) @Me()
%2 = tail call i32 (...) @ArgNum()
%3 = tail call i32 @GetFlag(i32 %2)
%4 = tail call i32 @SendItem(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndLeave(const char *progname, int status) {
  FILE *stream = stderr;
  if (status == EXIT_SUCCESS) {
    stream = stdout;
  }
  fprintf(stream, "Usage: %s <file> [<file2> <file3> ...]\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <helpAndLeave+0x3d>
mov    0x2e82(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndLeave>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndLeave+0x1a>
mov    0x2ea0(%rip),%rax
jmp    1141 <helpAndLeave+0x21>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [40 x i8] c"Usage: %s <file> [<file2> <file3> ...]\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32*, i32** @stderr
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* @EXIT_SUCCESS
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** @stdout
store i32* %11, i32** %5
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [40 x i8] c"Usage: %s <file> [<file2> <file3> ...]\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** @stderr
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
void test5(void) {
  int a[5], i = 0;
  (typeof(++i, (int(*)[i])a)){ &a} += 0;
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
imul   $0x0,%rcx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test5() {
%1 = alloca [5 x i32]
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%9 = bitcast [5 x i32]* %1 to i32*
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = mul nsw i64 0, %7
%12 = getelementptr inbounds i32, i32* %10, i64 %11
store i32* %12, i32** %3
ret void
}

LLVM IR (-O2):
define void @test5() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, int);
void substr(char *substring, const char *haystack, int index) {
  strncpy(substring, haystack, index);
  substring[index] = '\0';
}


x86 assembly (clang, -O0):
<substr>:
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
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substr>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movslq %ebp,%rax
movb   $0x0,(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @substr(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @strncpy(i8* %7, i8* %8, i32 %9)
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
ret void
}

LLVM IR (-O2):
define void @substr(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %2)
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret void
}
void __attribute__((far)) foo2(void) {}


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

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

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

LLVM IR (-O2):
define void @foo2() {
ret void
}
int test_imm_8Auint16_reg(unsigned short val) {
  return ((val) & (0x8A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Auint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x8a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Auint16_reg>:
test   $0x8a,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Auint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 138
%6 = icmp ne i32 %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_8Auint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 138
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int net_send(const char *buf, int len) { return -1; }


x86 assembly (clang, -O0):
<net_send>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @net_send(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
scalar_t__ _char_in(char, char const *);
char *_strtok_init(char *str, const char *delim) {
  while (*str != '\0' && _char_in(*str, delim)) {
    str++;
  }
  return str;
}


x86 assembly (clang, -O0):
<_strtok_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1151 <_strtok_init+0x41>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <_char_in@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1161 <_strtok_init+0x51>
jmp    1172 <_strtok_init+0x62>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <_strtok_init+0x10>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strtok_init>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     113c <_strtok_init+0x2c>
mov    %rsi,%r14
movsbl %al,%edi
mov    %r14,%rsi
call   1030 <_char_in@plt>
test   %rax,%rax
je     113c <_strtok_init+0x2c>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <_strtok_init+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @_strtok_init(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %18, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = load i8*, i8** %4
%14 = call i64 @_char_in(i8 signext %12, i8* %13)
%15 = icmp ne i64 %14, 0
br label %16
16: ; preds = %10, %5
%17 = phi i1 [ false, %5 ], [ %15, %10 ]
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
br label %5
21: ; preds = %16
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @_strtok_init(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = tail call i64 @_char_in(i8 signext %6, i8* %1)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ %0, %2 ], [ %11, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ exec(char **);
void playsong(char *s) {
  char *playargs[4] = {"mmusicd", "play", NULL, NULL};
  playargs[2] = s;
  exec(playargs);
}


x86 assembly (clang, -O0):
<playsong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2cdd(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2cda(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2cd7(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cd4(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <exec@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<playsong>:
sub    $0x28,%rsp
movaps 0x2cf5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2cd9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rdi,0x10(%rsp)
mov    %rsp,%rdi
call   1030 <exec@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"mmusicd\00"
@.str.1 = [5 x i8] c"play\00"
@__const.playsong.playargs = [4 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* null, i8* null]
define void @playsong(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8*]
store i8* %0, i8** %2
%4 = bitcast [4 x i8*]* %3 to i8*
%5 = load i8*, i8** %2
%6 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 2
store i8* %5, i8** %6
%7 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 0
%8 = call i32 @exec(i8** %7)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"mmusicd\00"
@.str.1 = [5 x i8] c"play\00"
@__const.playsong.playargs = [4 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* null, i8* null]
define void @playsong(i8* %0) {
%2 = alloca [4 x i8*]
%3 = bitcast [4 x i8*]* %2 to i8*
%4 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 2
store i8* %0, i8** %4
%5 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 0
%6 = call i32 @exec(i8** %5)
ret void
}
unsigned sum_parity(unsigned a, unsigned b) {
  if (a == b)
    return 2;
  return 1;
}


x86 assembly (clang, -O0):
<sum_parity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1122 <sum_parity+0x22>
movl   $0x2,-0x4(%rbp)
jmp    1129 <sum_parity+0x29>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_parity>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @sum_parity(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 = load i32, i32* %5
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 2, i32* %3
br label %11
10: ; preds = %2
store i32 1, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @sum_parity(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = select i1 %3, i32 2, i32 1
ret i32 %4
}
int strange_order(int a, int b) {
  if (a == 0 || b == 0)
    return 0;
  else
    return a % b > 0;
}


x86 assembly (clang, -O0):
<strange_order>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111e <strange_order+0x1e>
cmpl   $0x0,-0xc(%rbp)
jne    112a <strange_order+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    113f <strange_order+0x3f>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strange_order>:
xor    %eax,%eax
test   %edi,%edi
je     1116 <strange_order+0x16>
test   %esi,%esi
je     1116 <strange_order+0x16>
mov    %edi,%eax
cltd
idiv   %esi
xor    %eax,%eax
test   %edx,%edx
setg   %al
ret

LLVM IR (-O0):
define i32 @strange_order(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 eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i32 0, i32* %3
br label %18
12: ; preds = %8
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = srem i32 %13, %14
%16 = icmp sgt i32 %15, 0
%17 = zext i1 %16 to i32
store i32 %17, i32* %3
br label %18
18: ; preds = %12, %11
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @strange_order(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = srem i32 %0, %1
%8 = icmp sgt i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
/* Type definitions */
struct rq_address {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct rq_address *);
int /*<<< orphan*/ rq_address_clear(struct rq_address *);
void rq_address_free(struct rq_address *p) {
  rq_address_clear(p);
  free(p);
}


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

x86 assembly (clang, -O2):
<rq_address_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <rq_address_clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.rq_address = type { i32 }
define void @rq_address_free(%struct.rq_address* %0) {
%2 = alloca %struct.rq_address*
store %struct.rq_address* %0, %struct.rq_address** %2
%3 = load %struct.rq_address*, %struct.rq_address** %2
%4 = call i32 @rq_address_clear(%struct.rq_address* %3)
%5 = load %struct.rq_address*, %struct.rq_address** %2
%6 = call i32 @free(%struct.rq_address* %5)
ret void
}

LLVM IR (-O2):
%struct.rq_address = type { i32 }
define void @rq_address_free(%struct.rq_address* %0) {
%2 = tail call i32 @rq_address_clear(%struct.rq_address* %0)
%3 = tail call i32 @free(%struct.rq_address* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int sys_setresuid(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int sys_setresuid32(uid_t ruid, uid_t euid, uid_t suid) {
  return sys_setresuid(ruid, euid, suid);
}


x86 assembly (clang, -O0):
<sys_setresuid32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <sys_setresuid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_setresuid32>:
jmp    1030 <sys_setresuid@plt>

LLVM IR (-O0):
define i32 @sys_setresuid32(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 = load i32, i32* %6
%10 = call i32 @sys_setresuid(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @sys_setresuid32(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @sys_setresuid(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
unsigned long long _pdep_u64(unsigned long long, unsigned long long);
unsigned long long test_pdep_u64(unsigned long long __X,
                                 unsigned long long __Y) {
  return _pdep_u64(__X, __Y);
}


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

x86 assembly (clang, -O2):
<test_pdep_u64>:
jmp    1030 <_pdep_u64@plt>

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

LLVM IR (-O2):
define i64 @test_pdep_u64(i64 %0, i64 %1) {
%3 = tail call i64 @_pdep_u64(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
double drmp3_sin(double);
__attribute__((always_)) double drmp3_cos(double x) {
  return drmp3_sin((3.14159265358979323846264 * 0.5) - x);
}


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

x86 assembly (clang, -O2):
<drmp3_cos>:
movsd  0xee8(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
jmp    1030 <drmp3_sin@plt>

LLVM IR (-O0):
define double @drmp3_cos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 0x3FF921FB54442D18, %3
%5 = call double @drmp3_sin(double %4)
ret double %5
}

LLVM IR (-O2):
define double @drmp3_cos(double %0) {
%2 = fsub double 0x3FF921FB54442D18, %0
%3 = tail call double @drmp3_sin(double %2)
ret double %3
}
/* Variables and functions */
int __mib_flash_write(unsigned char *, int, int);
int mib_update_firmware(unsigned char *ptr, int len) {
  return __mib_flash_write(ptr, 0 + 0x2000 + 0x1000 + 0x8000 + 0x10000, len);
}


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

x86 assembly (clang, -O2):
<mib_update_firmware>:
mov    %esi,%edx
mov    $0x1b000,%esi
jmp    1030 <__mib_flash_write@plt>

LLVM IR (-O0):
define i32 @mib_update_firmware(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
%6 = load i32, i32* %4
%7 = call i32 @__mib_flash_write(i8* %5, i32 110592, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mib_update_firmware(i8* %0, i32 %1) {
%3 = tail call i32 @__mib_flash_write(i8* %0, i32 110592, i32 %1)
ret i32 %3
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct datafile_list {
  int dummy;
};
struct datafile {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_append(struct genlist *, struct datafile *);
void datafile_list_append(struct datafile_list *tthis, struct datafile *pfoo) {
  genlist_append(((struct genlist *)(tthis)), pfoo);
}


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

x86 assembly (clang, -O2):
<datafile_list_append>:
jmp    1030 <genlist_append@plt>

LLVM IR (-O0):
%struct.datafile_list = type { i32 }
%struct.datafile = type { i32 }
%struct.genlist = type { i32 }
define void @datafile_list_append(%struct.datafile_list* %0, %struct.datafile* %1) {
%3 = alloca %struct.datafile_list*
%4 = alloca %struct.datafile*
store %struct.datafile_list* %0, %struct.datafile_list** %3
store %struct.datafile* %1, %struct.datafile** %4
%5 = load %struct.datafile_list*, %struct.datafile_list** %3
%6 = bitcast %struct.datafile_list* %5 to %struct.genlist*
%7 = load %struct.datafile*, %struct.datafile** %4
%8 = call i32 @genlist_append(%struct.genlist* %6, %struct.datafile* %7)
ret void
}

LLVM IR (-O2):
%struct.datafile_list = type { i32 }
%struct.datafile = type { i32 }
%struct.genlist = type { i32 }
define void @datafile_list_append(%struct.datafile_list* %0, %struct.datafile* %1) {
%3 = bitcast %struct.datafile_list* %0 to %struct.genlist*
%4 = tail call i32 @genlist_append(%struct.genlist* %3, %struct.datafile* %1)
ret void
}
void mach_tegra_idle(void) {}


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

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

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

LLVM IR (-O2):
define void @mach_tegra_idle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Quicksort(int /*<<< orphan*/, int, int *);
int /*<<< orphan*/ debug(char *, int *);
int /*<<< orphan*/ system(char *);
int main(void) {
  int v[20] = {19, 18, 17, 16, 15, 14, 13, 12, 11, 10,
               9,  8,  7,  6,  5,  4,  3,  2,  1,  0};
  Quicksort(0, 20 - 1, v);
  debug("Final: ", v);
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x50,%edx
call   1060 <memcpy@plt>
lea    -0x50(%rbp),%rdx
xor    %edi,%edi
mov    $0x13,%esi
call   1030 <Quicksort@plt>
lea    -0x50(%rbp),%rsi
lea    0xed8(%rip),%rdi
call   1040 <debug@plt>
lea    0xed4(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
movaps 0xf04(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe94(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
xor    %edi,%edi
mov    $0x13,%esi
mov    %rbx,%rdx
call   1030 <Quicksort@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
call   1040 <debug@plt>
lea    0xec0(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.v = [20 x i32] [i32 19, i32 18, i32 17, i32 16, i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0]
@.str = [8 x i8] c"Final: \00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%4 = call i32 @Quicksort(i32 0, i32 19, i32* %3)
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%6 = call i32 @debug(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.v = [20 x i32] [i32 19, i32 18, i32 17, i32 16, i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0]
@.str = [8 x i8] c"Final: \00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%4 = call i32 @Quicksort(i32 0, i32 19, i32* %3)
%5 = call i32 @debug(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void gtk_entry_completion_get_minimum_key_length() {}


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

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

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

LLVM IR (-O2):
define void @gtk_entry_completion_get_minimum_key_length() {
ret void
}
/* Type definitions */
typedef scalar_t__ u_int;
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
u_int hash(u_char *str) {
  u_int hash_ = 0;
  int c;
  while ((c = (int)(*str++)))
    hash_ += (u_int)c;
  return hash_;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     113e <hash+0x3e>
movslq -0x14(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%ecx
test   %ecx,%ecx
je     1121 <hash+0x21>
add    $0x4,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movslq %ecx,%rcx
add    %rcx,%rax
mov    (%rdi),%ecx
add    $0x4,%rdi
test   %ecx,%ecx
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @hash(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %10, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = sext i32 %5 to i64
%10 = add nsw i64 %7, %9
%11 = load i32, i32* %8
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i64 [ 0, %1 ], [ %10, %4 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_usage(char *name) {
  printf("usage: %s [start|status|help]\n", name);
}


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

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"usage: %s [start|status|help]\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"usage: %s [start|status|help]\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
dsr(pn) int pn;
{ brc(pn, 'n'); }


x86 assembly (clang, -O0):
<dsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x6e,%esi
mov    $0x0,%al
call   1030 <brc@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsr>:
mov    $0x6e,%esi
xor    %eax,%eax
jmp    1030 <brc@plt>

LLVM IR (-O0):
define i32 @dsr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @brc to i32 (i32, i32, ...)*)(i32 %4, i32 110)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @dsr(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @brc to i32 (i32, i32, ...)*)(i32 %0, i32 110)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fillpowtable(int);
void fillallpowtable() {
  int base;
  for (base = 2; base <= 36; base++)
    if (base != 10)
      fillpowtable(base);
}


x86 assembly (clang, -O0):
<fillallpowtable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
cmpl   $0x24,-0x4(%rbp)
jg     114e <fillallpowtable+0x3e>
cmpl   $0xa,-0x4(%rbp)
je     113b <fillallpowtable+0x2b>
mov    -0x4(%rbp),%edi
call   1030 <fillpowtable@plt>
jmp    1140 <fillallpowtable+0x30>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <fillallpowtable+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillallpowtable>:
push   %rbx
mov    $0x2,%ebx
jmp    1128 <fillallpowtable+0x18>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x25,%ebx
je     1136 <fillallpowtable+0x26>
cmp    $0xa,%ebx
je     1120 <fillallpowtable+0x10>
mov    %ebx,%edi
call   1030 <fillpowtable@plt>
jmp    1120 <fillallpowtable+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @fillallpowtable() {
%1 = alloca i32
store i32 2, i32* %1
br label %2
2: ; preds = %12, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 36
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %1
%10 = call i32 @fillpowtable(i32 %9)
br label %11
11: ; preds = %8, %5
br label %12
12: ; preds = %11
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %2
15: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @fillallpowtable() {
br label %1
1: ; preds = %0, %6
%2 = phi i32 [ 2, %0 ], [ %7, %6 ]
%3 = icmp eq i32 %2, 10
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fillpowtable(i32 %2)
br label %6
6: ; preds = %1, %4
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 37
br i1 %8, label %9, label %1
9: ; preds = %6
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};
struct drand48_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ srand48_r(long, struct drand48_data *);
void init_rng(long int seed, struct drand48_data *buffer) {
  struct timeval now;
  gettimeofday(&now, NULL);
  srand48_r(seed, buffer);
}


x86 assembly (clang, -O0):
<init_rng>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <srand48_r@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_rng>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <srand48_r@plt>

LLVM IR (-O0):
%struct.drand48_data = type { i32 }
%struct.timeval = type { i32 }
define void @init_rng(i64 %0, %struct.drand48_data* %1) {
%3 = alloca i64
%4 = alloca %struct.drand48_data*
%5 = alloca %struct.timeval
store i64 %0, i64* %3
store %struct.drand48_data* %1, %struct.drand48_data** %4
%6 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%7 = load i64, i64* %3
%8 = load %struct.drand48_data*, %struct.drand48_data** %4
%9 = call i32 @srand48_r(i64 %7, %struct.drand48_data* %8)
ret void
}

LLVM IR (-O2):
%struct.drand48_data = type { i32 }
%struct.timeval = type { i32 }
define void @init_rng(i64 %0, %struct.drand48_data* %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%6 = tail call i32 @srand48_r(i64 %0, %struct.drand48_data* %1)
ret void
}
/* Variables and functions */
char const *strerror(int);
const char *StrError(int errorNumber) { return strerror(errorNumber); }


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

x86 assembly (clang, -O2):
<StrError>:
jmp    1030 <strerror@plt>

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

LLVM IR (-O2):
define i8* @StrError(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
ret i8* %2
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_5c(int Salt, int Parameter) {
  unsigned b = Salt ^ 0xECE0054;
  return yahoo_M1Common(b, Parameter);
}


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

x86 assembly (clang, -O2):
<yahoo_f01_5c>:
xor    $0xece0054,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_5c(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = xor i32 %6, 248381524
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @yahoo_M1Common(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @yahoo_f01_5c(i32 %0, i32 %1) {
%3 = xor i32 %0, 248381524
%4 = tail call i32 @yahoo_M1Common(i32 %3, i32 %1)
ret i32 %4
}
int acpi_hest_firmware_first_pci(struct pci_dev *pci) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define i32 @acpi_hest_firmware_first_pci(%struct.pci_dev* nocapture readnone %0) {
ret i32 0
}
void gentlbr() {}


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

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

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

LLVM IR (-O2):
define void @gentlbr() {
ret void
}
/* Variables and functions */
scalar_t__ getuid();
int checkprivs(void) { return (0 == getuid()); }


x86 assembly (clang, -O0):
<checkprivs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @checkprivs() {
%1 = call i64 (...) @getuid()
%2 = icmp eq i64 0, %1
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @checkprivs() {
%1 = tail call i64 (...) @getuid()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void gtk_text_buffer_get_iter_at_line() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_get_iter_at_line() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mrf_write_long(int, int);
void mrf_set_channel(void) { mrf_write_long(0x200, 0x13); }


x86 assembly (clang, -O0):
<mrf_set_channel>:
push   %rbp
mov    %rsp,%rbp
mov    $0x200,%edi
mov    $0x13,%esi
call   1030 <mrf_write_long@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrf_set_channel>:
mov    $0x200,%edi
mov    $0x13,%esi
jmp    1030 <mrf_write_long@plt>

LLVM IR (-O0):
define void @mrf_set_channel() {
%1 = call i32 @mrf_write_long(i32 512, i32 19)
ret void
}

LLVM IR (-O2):
define void @mrf_set_channel() {
%1 = tail call i32 @mrf_write_long(i32 512, i32 19)
ret void
}
int test_imm_1Duint8_mem(unsigned char *val) {
  return ((*val) & (0x1D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Duint8_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, 29
%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_1Duint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 29
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, long long);
extern void mem_set(void *dest, int val, long long size) {
  memset(dest, val, size);
}


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

x86 assembly (clang, -O2):
<mem_set>:
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @mem_set(i8* %0, i32 %1, i64 %2) {
%4 = tail call i32 @memset(i8* %0, i32 %1, i64 %2)
ret void
}
char *_Locale_extract_messages_name(const char *__DUMMY_PAR1,
                                    char *__DUMMY_PAR) {
  return 0;
}


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

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

LLVM IR (-O0):
define i8* @_Locale_extract_messages_name(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @_Locale_extract_messages_name(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
short strlen(char *);
void clean_text(char text[]) {
  short int i = 0;
  short int len = 0;
  len = strlen(text);
  for (i = 0; i < len; ++i) {
    text[i] = 0;
  };
}


x86 assembly (clang, -O0):
<clean_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0xa(%rbp)
movw   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %ax,-0xc(%rbp)
movw   $0x0,-0xa(%rbp)
movswl -0xa(%rbp),%eax
movswl -0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    1169 <clean_text+0x59>
mov    -0x8(%rbp),%rax
movswq -0xa(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xa(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xa(%rbp)
jmp    113b <clean_text+0x2b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_text>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %ax,%ax
jle    113b <clean_text+0x1b>
movzwl %ax,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @clean_text(i8* %0) {
%2 = tail call signext i16 @strlen(i8* %0)
%3 = icmp sgt i16 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = zext i16 %2 to i64
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
struct test {
  int dummy;
};

/* Variables and functions */
void priv_vfs_chroot_cleanup(int asroot, int injail, struct test *test) {}


x86 assembly (clang, -O0):
<priv_vfs_chroot_cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test = type { i32 }
define void @priv_vfs_chroot_cleanup(i32 %0, i32 %1, %struct.test* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.test*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.test* %2, %struct.test** %6
ret void
}

LLVM IR (-O2):
%struct.test = type { i32 }
define void @priv_vfs_chroot_cleanup(i32 %0, i32 %1, %struct.test* nocapture %2) {
ret void
}
int test_imm_05int8_mem(signed char *val) {
  return ((*val) & (0x05 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_05int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 5
%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_05int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 5
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct list_head {
  int dummy;
};
struct in6_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ *prefix_list_get(struct list_head const *,
                                    struct in6_addr const *, int);
int prefix_list_find(const struct list_head *pl, const struct in6_addr *addr,
                     int plen) {
  return prefix_list_get(pl, addr, plen) != NULL;
}


x86 assembly (clang, -O0):
<prefix_list_find>:
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
call   1030 <prefix_list_get@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.list_head = type { i32 }
%struct.in6_addr = type { i32 }
define i32 @prefix_list_find(%struct.list_head* %0, %struct.in6_addr* %1, i32 %2) {
%4 = alloca %struct.list_head*
%5 = alloca %struct.in6_addr*
%6 = alloca i32
store %struct.list_head* %0, %struct.list_head** %4
store %struct.in6_addr* %1, %struct.in6_addr** %5
store i32 %2, i32* %6
%7 = load %struct.list_head*, %struct.list_head** %4
%8 = load %struct.in6_addr*, %struct.in6_addr** %5
%9 = load i32, i32* %6
%10 = call i32* @prefix_list_get(%struct.list_head* %7, %struct.in6_addr* %8, i32 %9)
%11 = icmp ne i32* %10, null
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
%struct.in6_addr = type { i32 }
define i32 @prefix_list_find(%struct.list_head* %0, %struct.in6_addr* %1, i32 %2) {
%4 = tail call i32* @prefix_list_get(%struct.list_head* %0, %struct.in6_addr* %1, i32 %2)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char *create_double_quote(char const *);
char *create_wifi_ssid(const char *ssid) { return create_double_quote(ssid); }


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

x86 assembly (clang, -O2):
<create_wifi_ssid>:
jmp    1030 <create_double_quote@plt>

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

LLVM IR (-O2):
define i8* @create_wifi_ssid(i8* %0) {
%2 = tail call i8* @create_double_quote(i8* %0)
ret i8* %2
}