xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int removeUtmpEntry(pid_t job_pid) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @removeUtmpEntry(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
long sump(int *, int *);
int main(int argc, char const *argv[]) {
  int marbles[10] = {20, 10, 5, 39, 4, 16, 19, 26, 31, 20};
  long answer;
  answer = sump(marbles, marbles + 10);
  printf("The total number of marbles is %ld.\n", answer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
lea    -0x40(%rbp),%rsi
add    $0x28,%rsi
call   1050 <sump@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x28(%rsp),%rsi
mov    %rsp,%rdi
call   1040 <sump@plt>
lea    0xecd(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.marbles = [10 x i32] [i32 20, i32 10, i32 5, i32 39, i32 4, i32 16, i32 19, i32 26, i32 31, i32 20]
@.str = [37 x i8] c"The total number of marbles is %ld.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i32]
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [10 x i32]* %6 to i8*
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 0
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 0
%11 = getelementptr inbounds i32, i32* %10, i64 10
%12 = call i64 @sump(i32* %9, i32* %11)
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.marbles = [10 x i32] [i32 20, i32 10, i32 5, i32 39, i32 4, i32 16, i32 19, i32 26, i32 31, i32 20]
@.str = [37 x i8] c"The total number of marbles is %ld.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i32]
%4 = bitcast [10 x i32]* %3 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 10
%7 = call i64 @sump(i32* %5, i32* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %7)
ret i32 0
}
int test_imm_88uint8_mem(unsigned char *val) {
  return ((*val) & (-0x88 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_88uint8_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, -136
%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_88uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 120
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ global();
int /*<<< orphan*/ local();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  extern int tern;
  extern int stay_home;
  register int reg_var = 11;
  printf("register: %d\n", reg_var);
  printf("\nfrom main tern: %d\n", tern);
  printf("from main stay_home: %d\n", stay_home);
  local();
  global();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xb,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <local@plt>
mov    $0x0,%al
call   1030 <global@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0xb,%esi
call   1040 <printf@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%esi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <local@plt>
xor    %eax,%eax
call   1030 <global@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"register: %d\0A\00"
@.str.1 = [21 x i8] c"\0Afrom main tern: %d\0A\00"
@tern = external global i32
@.str.2 = [25 x i8] c"from main stay_home: %d\0A\00"
@stay_home = external global i32
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 11, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @tern
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @stay_home
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = call i32 (...) @local()
%10 = call i32 (...) @global()
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"register: %d\0A\00"
@.str.1 = [21 x i8] c"\0Afrom main tern: %d\0A\00"
@tern = external global i32
@.str.2 = [25 x i8] c"from main stay_home: %d\0A\00"
@stay_home = external global i32
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 11)
%2 = load i32, i32* @tern
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @stay_home
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%6 = tail call i32 (...) @local()
%7 = tail call i32 (...) @global()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void outmem(void) {
  fprintf(stderr, "Out of memory\n");
  exit(1);
}


x86 assembly (clang, -O0):
<outmem>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<outmem>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
define void @outmem() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
define void @outmem() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct mat2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat2_rotation(float *, float);
__attribute__((always_)) struct mat2 *psmat2_rotation(struct mat2 *result,
                                                      float angle) {
  mat2_rotation((float *)result, angle);
  return result;
}


x86 assembly (clang, -O0):
<psmat2_rotation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
call   1030 <mat2_rotation@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psmat2_rotation>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat2_rotation@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat2 = type { i32 }
define %struct.mat2* @psmat2_rotation(%struct.mat2* %0, float %1) {
%3 = alloca %struct.mat2*
%4 = alloca float
store %struct.mat2* %0, %struct.mat2** %3
store float %1, float* %4
%5 = load %struct.mat2*, %struct.mat2** %3
%6 = bitcast %struct.mat2* %5 to float*
%7 = load float, float* %4
%8 = call i32 @mat2_rotation(float* %6, float %7)
%9 = load %struct.mat2*, %struct.mat2** %3
ret %struct.mat2* %9
}

LLVM IR (-O2):
%struct.mat2 = type { i32 }
define %struct.mat2* @psmat2_rotation(%struct.mat2* returned %0, float %1) {
%3 = bitcast %struct.mat2* %0 to float*
%4 = tail call i32 @mat2_rotation(float* %3, float %1)
ret %struct.mat2* %0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int length;
};
typedef TYPE_1__ ASN1_STRING;

/* Variables and functions */
int ASN1_STRING_length(const ASN1_STRING *x) { return (x->length); }


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

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

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @ASN1_STRING_length(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @ASN1_STRING_length(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool HibernateGPIORetentionGet(void) {
  if (((*((volatile uint32_t *)(0x400FC010))) & (0x40000000 | 0x00000100)) ==
      (0x40000000 | 0x00000100)) {
    return (true);
  }
  return (false);
}


x86 assembly (clang, -O0):
<HibernateGPIORetentionGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc010,%eax
mov    (%rax),%eax
and    $0x40000100,%eax
cmp    $0x40000100,%eax
jne    1127 <HibernateGPIORetentionGet+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <HibernateGPIORetentionGet+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateGPIORetentionGet>:
mov    0x400fc010,%ecx
not    %ecx
xor    %eax,%eax
test   $0x40000100,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @HibernateGPIORetentionGet() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 1074774032 to i32*)
%3 = and i32 %2, 1073742080
%4 = icmp eq i32 %3, 1073742080
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 1, i32* %1
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @HibernateGPIORetentionGet() {
%1 = load volatile i32, i32* inttoptr (i64 1074774032 to i32*)
%2 = and i32 %1, 1073742080
%3 = icmp eq i32 %2, 1073742080
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char const *enum2str_def(unsigned int, char const *const *, unsigned int,
                         char *);
const char *enum2str(unsigned value, const char *const names[],
                     unsigned items) {
  return enum2str_def(value, names, items, "unknown");
}


x86 assembly (clang, -O0):
<enum2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xecd(%rip),%rcx
call   1030 <enum2str_def@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enum2str>:
lea    0xee9(%rip),%rcx
jmp    1030 <enum2str_def@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"unknown\00"
define i8* @enum2str(i32 %0, i8** %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i32, i32* %6
%10 = call i8* @enum2str_def(i32 %7, i8** %8, i32 %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %10
}

LLVM IR (-O2):
@.str = [8 x i8] c"unknown\00"
define i8* @enum2str(i32 %0, i8** %1, i32 %2) {
%4 = tail call i8* @enum2str_def(i32 %0, i8** %1, i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}
/* Variables and functions */
long fromMilli(scalar_t__);
scalar_t__ toMilli(long);
long Add_milliseconds(long tm, long msec) {
  return fromMilli(toMilli(tm) + msec);
}


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

x86 assembly (clang, -O2):
<Add_milliseconds>:
push   %rbx
mov    %rsi,%rbx
call   1030 <toMilli@plt>
add    %rax,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fromMilli@plt>

LLVM IR (-O0):
define i64 @Add_milliseconds(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 = call i64 @toMilli(i64 %5)
%7 = load i64, i64* %4
%8 = add nsw i64 %6, %7
%9 = call i64 @fromMilli(i64 %8)
ret i64 %9
}

LLVM IR (-O2):
define i64 @Add_milliseconds(i64 %0, i64 %1) {
%3 = tail call i64 @toMilli(i64 %0)
%4 = add nsw i64 %3, %1
%5 = tail call i64 @fromMilli(i64 %4)
ret i64 %5
}
void DIGI_Disable() {}


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

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

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

LLVM IR (-O2):
define void @DIGI_Disable() {
ret void
}
char *hash_plugin_summary(void) {
  return ("sha512unix \tSHA512(Unix) plugin (shadow files)");
}


x86 assembly (clang, -O0):
<hash_plugin_summary>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_summary>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [47 x i8] c"sha512unix \09SHA512(Unix) plugin (shadow files)\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [47 x i8] c"sha512unix \09SHA512(Unix) plugin (shadow files)\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *progname) {
  printf("Usage: %s [-v] [-d dir] logfile program\n", progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Usage: %s [-v] [-d dir] logfile program\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [41 x i8] c"Usage: %s [-v] [-d dir] logfile program\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc < 2) {
    fprintf(stderr, "Usage: %s [int arg]\n", argv[0]);
    exit(2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1166 <main+0x46>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x1,%edi
jle    1128 <main+0x8>
xor    %eax,%eax
ret
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Usage: %s [int arg]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 2)
unreachable
15: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Usage: %s [int arg]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = tail call i32 @exit(i32 2)
unreachable
9: ; preds = %2
ret i32 0
}
/* Variables and functions */
int logical_iterator(int, int, int *, unsigned short);
bool logical_nor(unsigned short array_size, bool *boolean_list) {
  return logical_iterator(true, true, boolean_list, array_size);
}


x86 assembly (clang, -O0):
<logical_nor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    $0x1,%esi
mov    %esi,%edi
movzwl -0x2(%rbp),%ecx
call   1030 <logical_iterator@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logical_nor>:
mov    %rsi,%rdx
mov    %edi,%ecx
mov    $0x1,%edi
mov    $0x1,%esi
jmp    1030 <logical_iterator@plt>

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

LLVM IR (-O2):
define i32 @logical_nor(i16 zeroext %0, i32* %1) {
%3 = tail call i32 @logical_iterator(i32 1, i32 1, i32* %1, i16 zeroext %0)
ret i32 %3
}
void mklower(char *s) {
  for (; s[0] != '\0'; s++)
    if ('A' <= *s && *s <= 'Z')
      *s = *s - 'A' + 'a';
}


x86 assembly (clang, -O0):
<mklower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1167 <mklower+0x67>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1151 <mklower+0x51>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     1151 <mklower+0x51>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1156 <mklower+0x56>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <mklower+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mklower>:
mov    (%rdi),%al
test   %al,%al
je     112a <mklower+0x2a>
add    $0x1,%rdi
jmp    111b <mklower+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <mklower+0x2a>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <mklower+0x10>
add    $0x20,%al
mov    %al,-0x1(%rdi)
jmp    1110 <mklower+0x10>
ret

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

LLVM IR (-O2):
define void @mklower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %4, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ usleep(int);
void *do_alloc(size_t n) {
  void *p;
  do {
    p = malloc(n);
    if (!p) {
      usleep(10000);
    }
  } while (!p);
  memset(p, 0, n);
  return p;
}


x86 assembly (clang, -O0):
<do_alloc>:
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    115e <do_alloc+0x2e>
mov    $0x2710,%edi
call   1050 <usleep@plt>
jmp    1163 <do_alloc+0x33>
cmpq   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113c <do_alloc+0xc>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_alloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    116a <do_alloc+0x3a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2710,%edi
call   1050 <usleep@plt>
mov    %r14,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1150 <do_alloc+0x20>
mov    %rax,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @do_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
br label %4
4: ; preds = %12, %1
%5 = load i64, i64* %2
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = call i32 @usleep(i32 10000)
br label %11
11: ; preds = %9, %4
br label %12
12: ; preds = %11
%13 = load i8*, i8** %3
%14 = icmp ne i8* %13, null
%15 = xor i1 %14, true
br i1 %15, label %4, label %16
16: ; preds = %12
%17 = load i8*, i8** %3
%18 = load i64, i64* %2
%19 = call i32 @memset(i8* %17, i32 0, i64 %18)
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
define i8* @do_alloc(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, %4
%5 = tail call i32 @usleep(i32 10000)
%6 = tail call i8* @malloc(i64 %0)
%7 = icmp eq i8* %6, null
br i1 %7, label %4, label %8
8: ; preds = %4, %1
%9 = phi i8* [ %2, %1 ], [ %6, %4 ]
%10 = tail call i32 @memset(i8* %9, i32 0, i64 %0)
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(int a[], int len) {
  int i;
  for (i = 0; i < len; i++) {
    printf("%d ", a[i]);
  }
  printf("\n");
}


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

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

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

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

/* Variables and functions */
int scv_replace(struct scv_vector *, size_t, size_t, int /*<<< orphan*/ *,
                int /*<<< orphan*/);
int scv_erase(struct scv_vector *v, size_t i, size_t j) {
  return scv_replace(v, i, j, NULL, 0);
}


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

x86 assembly (clang, -O2):
<scv_erase>:
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <scv_replace@plt>

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

LLVM IR (-O2):
%struct.scv_vector = type { i32 }
define i32 @scv_erase(%struct.scv_vector* %0, i64 %1, i64 %2) {
%4 = tail call i32 @scv_replace(%struct.scv_vector* %0, i64 %1, i64 %2, i32* null, i32 0)
ret i32 %4
}
int test_imm_43uint8_reg(unsigned char val) {
  return ((val) & (0x43 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_43uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x43,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_43uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 67
%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_43uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 67
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void kb_wait_2(void) {
  unsigned long timeout = 2;
  do {
    (1 ? printf("timeout=%ld\n", timeout) : ({
      for (;;)
        printf("error\n");
    }));
    timeout--;
  } while (timeout);
}


x86 assembly (clang, -O0):
<kb_wait_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1120 <kb_wait_2+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kb_wait_2>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    $0x2,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%esi
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"timeout=%ld\0A\00"
define void @kb_wait_2() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 2)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 1)
ret void
}
void add_null(void *opaque, void *parent, const char *name) {}


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

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

LLVM IR (-O0):
define void @add_null(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @add_null(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int foo(int);
int foo6(int, int **, int **);
int main() {
  int b[10][10];
  int(*c)[sizeof(int) * 10];
  if (foo6(10, b, c) != 10 * sizeof(int) * sizeof(int))
    return 1;
  return foo(10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a0(%rbp),%rsi
mov    -0x1a8(%rbp),%rdx
mov    $0xa,%edi
call   1030 <foo6@plt>
cltq
cmp    $0xa0,%rax
je     1164 <main+0x44>
movl   $0x1,-0x4(%rbp)
jmp    1171 <main+0x51>
mov    $0xa,%edi
call   1040 <foo@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x198,%rsp
mov    %rsp,%rsi
mov    $0xa,%edi
call   1030 <foo6@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0xa0,%ecx
jne    114d <main+0x2d>
mov    $0xa,%edi
call   1040 <foo@plt>
add    $0x198,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x [10 x i32]]
%3 = alloca [40 x i32]*
store i32 0, i32* %1
%4 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %2, i64 0, i64 0
%5 = bitcast [10 x i32]* %4 to i32**
%6 = load [40 x i32]*, [40 x i32]** %3
%7 = bitcast [40 x i32]* %6 to i32**
%8 = call i32 @foo6(i32 10, i32** %5, i32** %7)
%9 = sext i32 %8 to i64
%10 = icmp ne i64 %9, 160
br i1 %10, label %11, label %12
11: ; preds = %0
store i32 1, i32* %1
br label %14
12: ; preds = %0
%13 = call i32 @foo(i32 10)
store i32 %13, i32* %1
br label %14
14: ; preds = %12, %11
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x [10 x i32]]
%2 = bitcast [10 x [10 x i32]]* %1 to i8*
%3 = bitcast [10 x [10 x i32]]* %1 to i32**
%4 = call i32 @foo6(i32 10, i32** %3, i32** undef)
%5 = icmp eq i32 %4, 160
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @foo(i32 10)
br label %8
8: ; preds = %0, %6
%9 = phi i32 [ %7, %6 ], [ 1, %0 ]
ret i32 %9
}
/* Type definitions */
struct Point {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Point *);
void destroyPoint(struct Point **point) {
  if ((*point) != NULL) {
    free((*point));
  }
}


x86 assembly (clang, -O0):
<destroyPoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <destroyPoint+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroyPoint>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <destroyPoint+0xd>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.Point = type { i32 }
define void @destroyPoint(%struct.Point** %0) {
%2 = alloca %struct.Point**
store %struct.Point** %0, %struct.Point*** %2
%3 = load %struct.Point**, %struct.Point*** %2
%4 = load %struct.Point*, %struct.Point** %3
%5 = icmp ne %struct.Point* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.Point**, %struct.Point*** %2
%8 = load %struct.Point*, %struct.Point** %7
%9 = call i32 @free(%struct.Point* %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.Point = type { i32 }
define void @destroyPoint(%struct.Point** nocapture %0) {
%2 = load %struct.Point*, %struct.Point** %0
%3 = icmp eq %struct.Point* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(%struct.Point* %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_label_terminator();
int /*<<< orphan*/ output_string(char *);
void declare_entry_point(char *symbol_name) {
  output_string(symbol_name);
  output_label_terminator();
}


x86 assembly (clang, -O0):
<declare_entry_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <output_string@plt>
mov    $0x0,%al
call   1040 <output_label_terminator@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<declare_entry_point>:
push   %rax
call   1030 <output_string@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <output_label_terminator@plt>

LLVM IR (-O0):
define void @declare_entry_point(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @output_string(i8* %3)
%5 = call i32 (...) @output_label_terminator()
ret void
}

LLVM IR (-O2):
define void @declare_entry_point(i8* %0) {
%2 = tail call i32 @output_string(i8* %0)
%3 = tail call i32 (...) @output_label_terminator()
ret void
}
/* Variables and functions */
scalar_t__ check_prime(int);
int my_find_prime_sup(int nb) {
  int i = nb;
  while (check_prime(i) == 0)
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<my_find_prime_sup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <check_prime@plt>
cmp    $0x0,%rax
jne    1141 <my_find_prime_sup+0x31>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1121 <my_find_prime_sup+0x11>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_find_prime_sup>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <check_prime@plt>
add    $0x1,%ebx
test   %rax,%rax
je     1120 <my_find_prime_sup+0x10>
add    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @my_find_prime_sup(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = tail call i64 @check_prime(i32 %3)
%5 = icmp eq i64 %4, 0
%6 = add nsw i32 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ RDP(char *);
int /*<<< orphan*/ RDP_E(char *);
void uc6_select_dl() {
  RDP("uc6:select_dl\n");
  RDP_E("uc6:select_dl\n");
}


x86 assembly (clang, -O0):
<uc6_select_dl>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <RDP@plt>
lea    0xec9(%rip),%rdi
call   1030 <RDP_E@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uc6_select_dl>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <RDP@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <RDP_E@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"uc6:select_dl\0A\00"
define void @uc6_select_dl() {
%1 = call i32 @RDP(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @RDP_E(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"uc6:select_dl\0A\00"
define void @uc6_select_dl() {
%1 = tail call i32 @RDP(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @RDP_E(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cursoff();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basCursOff() { pushNumber(cursoff()); }


x86 assembly (clang, -O0):
<basCursOff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <cursoff@plt>
mov    %eax,%edi
call   1030 <pushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<basCursOff>:
push   %rax
xor    %eax,%eax
call   1040 <cursoff@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <pushNumber@plt>

LLVM IR (-O0):
define void @basCursOff() {
%1 = call i32 (...) @cursoff()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basCursOff() {
%1 = tail call i32 (...) @cursoff()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}
int strange_order(int a, int b) { return (a == 0 || b == 0) ? 0 : a % b; }


x86 assembly (clang, -O0):
<strange_order>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111e <strange_order+0x1e>
cmpl   $0x0,-0x8(%rbp)
jne    1128 <strange_order+0x28>
xor    %edx,%edx
mov    %edx,-0xc(%rbp)
jmp    1132 <strange_order+0x32>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

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 %8, label %6
6: ; preds = %2
%7 = srem i32 %0, %1
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
long utilIpIsSameSubnetAddr(unsigned char *, unsigned char *, unsigned char *,
                            unsigned char *);
long utilIpInSameSubnet(unsigned char *byIp1, unsigned char *byIp2,
                        unsigned char *bySubmask) {
  return utilIpIsSameSubnetAddr(byIp1, bySubmask, byIp2, bySubmask);
}


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

x86 assembly (clang, -O2):
<utilIpInSameSubnet>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rcx,%rsi
jmp    1030 <utilIpIsSameSubnetAddr@plt>

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

LLVM IR (-O2):
define i64 @utilIpInSameSubnet(i8* %0, i8* %1, i8* %2) {
%4 = tail call i64 @utilIpIsSameSubnetAddr(i8* %0, i8* %2, i8* %1, i8* %2)
ret i64 %4
}
void ar9003_mci_check_gpm_offset(struct ath_hw *ah) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.ath_hw = type opaque
define void @ar9003_mci_check_gpm_offset(%struct.ath_hw* nocapture %0) {
ret void
}
void foo(int *x, int y, int z) {}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo(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
ret void
}

LLVM IR (-O2):
define void @foo(i32* nocapture %0, i32 %1, i32 %2) {
ret void
}
double cos(f)
double f;
{ return sin(f + 1.570796326795); }


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

x86 assembly (clang, -O2):
<cos>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @cos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 0x3FF921FB54442EEA
%5 = call double @sin(double %4)
ret double %5
}

LLVM IR (-O2):
define double @cos(double %0) {
%2 = fadd double %0, 0x3FF921FB54442EEA
%3 = tail call double @sin(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int within_interval(int n, int a, int b) {
  if (a > b) {
    int tmp;
    tmp = b;
    b = a;
    a = tmp;
  }
  assert(a <= b);
  return (a <= n && n <= b);
}


x86 assembly (clang, -O0):
<within_interval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113f <within_interval+0x2f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0x11(%rbp)
jg     116f <within_interval+0x5f>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<within_interval>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%r14d
cmp    %edx,%esi
mov    %edx,%ebp
cmovg  %esi,%ebp
cmovg  %edx,%ebx
mov    $0x1,%edi
call   1030 <assert@plt>
cmp    %r14d,%ebx
setle  %al
cmp    %r14d,%ebp
setge  %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @within_interval(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i32, i32* %6
store i32 %12, i32* %7
%13 = load i32, i32* %5
store i32 %13, i32* %6
%14 = load i32, i32* %7
store i32 %14, i32* %5
br label %15
15: ; preds = %11, %3
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = icmp sle i32 %16, %17
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = icmp sle i32 %21, %22
br i1 %23, label %24, label %28
24: ; preds = %15
%25 = load i32, i32* %4
%26 = load i32, i32* %6
%27 = icmp sle i32 %25, %26
br label %28
28: ; preds = %24, %15
%29 = phi i1 [ false, %15 ], [ %27, %24 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @within_interval(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %2
%5 = select i1 %4, i32 %1, i32 %2
%6 = select i1 %4, i32 %2, i32 %1
%7 = tail call i32 @assert(i32 1)
%8 = icmp sle i32 %6, %0
%9 = icmp sge i32 %5, %0
%10 = and i1 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr, "usage: %s [-V] [-n] [-d] [-s subdb] dbpath\n", prog);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"usage: %s [-V] [-n] [-d] [-s subdb] dbpath\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"usage: %s [-V] [-n] [-d] [-s subdb] dbpath\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}