xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Eternal Passsion,\nEternal Pain.\nBy- Mathew Arnold.");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [51 x i8] c"Eternal Passsion,\0AEternal Pain.\0ABy- Mathew Arnold.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [51 x i8] c"Eternal Passsion,\0AEternal Pain.\0ABy- Mathew Arnold.\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void ex_swap(int v[], int i, int j) {
  int temp;
  temp = v[i];
  v[i] = v[j];
  v[j] = temp;
}


x86 assembly (clang, -O0):
<ex_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex_swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @ex_swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @ex_swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, int, char const *, int /*<<< orphan*/);
signed int vsprintf(char *pString, const char *pFormat, va_list ap) {
  return vsnprintf(pString, (64), pFormat, ap);
}


x86 assembly (clang, -O0):
<vsprintf>:
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),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x40,%esi
call   1030 <vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0x40,%esi
jmp    1030 <vsnprintf@plt>

LLVM IR (-O0):
define i32 @vsprintf(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 @vsnprintf(i8* %7, i32 64, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @vsprintf(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @vsnprintf(i8* %0, i32 64, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int StrArrLen(char **str_arr) {
  int i = 0;
  if ((str_arr == NULL) || (*str_arr == NULL))
    return 0;
  while (str_arr[i] != NULL)
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<StrArrLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1128 <StrArrLen+0x28>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1134 <StrArrLen+0x34>
movl   $0x0,-0x4(%rbp)
jmp    1160 <StrArrLen+0x60>
jmp    1139 <StrArrLen+0x39>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     115a <StrArrLen+0x5a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <StrArrLen+0x39>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrArrLen>:
xor    %eax,%eax
test   %rdi,%rdi
je     111c <StrArrLen+0x1c>
cmpq   $0x0,(%rdi)
je     111c <StrArrLen+0x1c>
xor    %eax,%eax
nop
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <StrArrLen+0x10>
ret

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

LLVM IR (-O2):
define i32 @StrArrLen(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %11, %6 ], [ 1, %3 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
%11 = add nuw i64 %7, 1
br i1 %10, label %12, label %6
12: ; preds = %6
%13 = trunc i64 %7 to i32
br label %14
14: ; preds = %12, %1, %3
%15 = phi i32 [ 0, %3 ], [ 0, %1 ], [ %13, %12 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void libaft_free(void *p) { free(p); }


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

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

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

LLVM IR (-O2):
define void @libaft_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void sensor_mgr_remove_threshold(struct threshold_info *thresh_inp) {}


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

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

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

LLVM IR (-O2):
%struct.threshold_info = type opaque
define void @sensor_mgr_remove_threshold(%struct.threshold_info* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IIC_SCLHigh();
int /*<<< orphan*/ IIC_SCLLow();
int /*<<< orphan*/ IIC_SDAHigh();
int /*<<< orphan*/ IIC_SDALow();
int /*<<< orphan*/ IIC_Wait1uSec();
void IOIIC_Stop(void) {
  IIC_SCLLow();
  IIC_Wait1uSec();
  IIC_SDALow();
  IIC_Wait1uSec();
  IIC_SCLHigh();
  IIC_Wait1uSec();
  IIC_SDAHigh();
}


x86 assembly (clang, -O0):
<IOIIC_Stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <IIC_SCLLow@plt>
mov    $0x0,%al
call   1060 <IIC_Wait1uSec@plt>
mov    $0x0,%al
call   1040 <IIC_SDALow@plt>
mov    $0x0,%al
call   1060 <IIC_Wait1uSec@plt>
mov    $0x0,%al
call   1050 <IIC_SCLHigh@plt>
mov    $0x0,%al
call   1060 <IIC_Wait1uSec@plt>
mov    $0x0,%al
call   1070 <IIC_SDAHigh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IOIIC_Stop>:
push   %rax
xor    %eax,%eax
call   1030 <IIC_SCLLow@plt>
xor    %eax,%eax
call   1060 <IIC_Wait1uSec@plt>
xor    %eax,%eax
call   1040 <IIC_SDALow@plt>
xor    %eax,%eax
call   1060 <IIC_Wait1uSec@plt>
xor    %eax,%eax
call   1050 <IIC_SCLHigh@plt>
xor    %eax,%eax
call   1060 <IIC_Wait1uSec@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <IIC_SDAHigh@plt>

LLVM IR (-O0):
define void @IOIIC_Stop() {
%1 = call i32 (...) @IIC_SCLLow()
%2 = call i32 (...) @IIC_Wait1uSec()
%3 = call i32 (...) @IIC_SDALow()
%4 = call i32 (...) @IIC_Wait1uSec()
%5 = call i32 (...) @IIC_SCLHigh()
%6 = call i32 (...) @IIC_Wait1uSec()
%7 = call i32 (...) @IIC_SDAHigh()
ret void
}

LLVM IR (-O2):
define void @IOIIC_Stop() {
%1 = tail call i32 (...) @IIC_SCLLow()
%2 = tail call i32 (...) @IIC_Wait1uSec()
%3 = tail call i32 (...) @IIC_SDALow()
%4 = tail call i32 (...) @IIC_Wait1uSec()
%5 = tail call i32 (...) @IIC_SCLHigh()
%6 = tail call i32 (...) @IIC_Wait1uSec()
%7 = tail call i32 (...) @IIC_SDAHigh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srandom(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void setRandom(void) { srandom((unsigned int)time(NULL)); }


x86 assembly (clang, -O0):
<setRandom>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @setRandom() {
%1 = call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = call i32 @srandom(i32 %2)
ret void
}

LLVM IR (-O2):
define void @setRandom() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srandom(i32 %2)
ret void
}
/* Variables and functions */
int yahoo_M1ObfuscatedTableCommon(int, int, unsigned char *);
int yahoo_f01_17(int Salt, int Parameter) {
  static unsigned char LUT[32] = {
      0x14, 0x1B, 0x18, 0x00, 0x1F, 0x15, 0x17, 0x07, 0x11, 0x1A, 0x0E,
      0x13, 0x12, 0x06, 0x01, 0x03, 0x1C, 0x0C, 0x0B, 0x1D, 0x10, 0x0F,
      0x09, 0x19, 0x0D, 0x1E, 0x04, 0x05, 0x08, 0x16, 0x0A, 0x02,
  };
  return yahoo_M1ObfuscatedTableCommon(Salt, Parameter, LUT);
}


x86 assembly (clang, -O0):
<yahoo_f01_17>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0x2f05(%rip),%rdx
call   1030 <yahoo_M1ObfuscatedTableCommon@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_17>:
lea    0x2f19(%rip),%rdx
jmp    1030 <yahoo_M1ObfuscatedTableCommon@plt>

LLVM IR (-O0):
@yahoo_f01_17.LUT = internal global [32 x i8] c"\14\1B\18\00\1F\15\17\07\11\1A\0E\13\12\06\01\03\1C\0C\0B\1D\10\0F\09\19\0D\1E\04\05\08\16\0A\02"
define i32 @yahoo_f01_17(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 = load i32, i32* %4
%7 = call i32 @yahoo_M1ObfuscatedTableCommon(i32 %5, i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @yahoo_f01_17.LUT, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@yahoo_f01_17.LUT = internal global [32 x i8] c"\14\1B\18\00\1F\15\17\07\11\1A\0E\13\12\06\01\03\1C\0C\0B\1D\10\0F\09\19\0D\1E\04\05\08\16\0A\02"
define i32 @yahoo_f01_17(i32 %0, i32 %1) {
%3 = tail call i32 @yahoo_M1ObfuscatedTableCommon(i32 %0, i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @yahoo_f01_17.LUT, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *get_item_field_value(int class_num, int field_num, int item_num) {
  static char name[32];
  sprintf(name, "%d", class_num * 100 + (field_num + 1) * 10 + item_num);
  return name;
}


x86 assembly (clang, -O0):
<get_item_field_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x64,-0x4(%rbp),%edx
mov    -0x8(%rbp),%eax
add    $0x1,%eax
imul   $0xa,%eax,%eax
add    %eax,%edx
add    -0xc(%rbp),%edx
lea    0x2f06(%rip),%rdi
lea    0xebf(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ef3(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_item_field_value>:
push   %rbx
imul   $0x64,%edi,%eax
lea    (%rsi,%rsi,4),%ecx
lea    (%rax,%rcx,2),%eax
add    %eax,%edx
add    $0xa,%edx
lea    0x2f1a(%rip),%rbx
lea    0xed3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_item_field_value.name = internal global [32 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @get_item_field_value(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 = mul nsw i32 %7, 100
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
%11 = mul nsw i32 %10, 10
%12 = add nsw i32 %8, %11
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
%15 = call i32 @sprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_item_field_value.name, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_item_field_value.name, i64 0, i64 0)
}

LLVM IR (-O2):
@get_item_field_value.name = internal global [32 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @get_item_field_value(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 100
%5 = mul i32 %1, 10
%6 = add i32 %4, 10
%7 = add i32 %6, %5
%8 = add i32 %7, %2
%9 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @get_item_field_value.name, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_item_field_value.name, i64 0, i64 0)
}
int hell1() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @hell1() {
ret i32 1
}
float get_float_value(int value) { return value / 1000.0; }


x86 assembly (clang, -O0):
<get_float_value>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_float_value>:
cvtsi2sd %edi,%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @get_float_value(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 1.000000e+03
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @get_float_value(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double %2, 1.000000e+03
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ cgincind(char *, char *, int);
void cgdec2iw(void) { cgincind("bx", "sub", 1); }


x86 assembly (clang, -O0):
<cgdec2iw>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x1,%edx
call   1030 <cgincind@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgdec2iw>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <cgincind@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"bx\00"
@.str.1 = [4 x i8] c"sub\00"
define void @cgdec2iw() {
%1 = call i32 @cgincind(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"bx\00"
@.str.1 = [4 x i8] c"sub\00"
define void @cgdec2iw() {
%1 = tail call i32 @cgincind(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int foobar0(int x) {
  printf("I have been invoked!!!! x=%d\n", x);
  return x;
}


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

x86 assembly (clang, -O2):
<foobar0>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"I have been invoked!!!! x=%d\0A\00"
define i32 @foobar0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [30 x i8] c"I have been invoked!!!! x=%d\0A\00"
define i32 @foobar0(i32 returned %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %0
}
/* Type definitions */
struct list_node {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
struct list_node *list_insert(struct list *, int /*<<< orphan*/,
                              struct list_node *);
struct list_node *list_push_front(struct list *self, struct list_node *n) {
  return list_insert(self, 0, n);
}


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

x86 assembly (clang, -O2):
<list_push_front>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <list_insert@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
%struct.list_node = type { i32 }
define %struct.list_node* @list_push_front(%struct.list* %0, %struct.list_node* %1) {
%3 = alloca %struct.list*
%4 = alloca %struct.list_node*
store %struct.list* %0, %struct.list** %3
store %struct.list_node* %1, %struct.list_node** %4
%5 = load %struct.list*, %struct.list** %3
%6 = load %struct.list_node*, %struct.list_node** %4
%7 = call %struct.list_node* @list_insert(%struct.list* %5, i32 0, %struct.list_node* %6)
ret %struct.list_node* %7
}

LLVM IR (-O2):
%struct.list = type { i32 }
%struct.list_node = type { i32 }
define %struct.list_node* @list_push_front(%struct.list* %0, %struct.list_node* %1) {
%3 = tail call %struct.list_node* @list_insert(%struct.list* %0, i32 0, %struct.list_node* %1)
ret %struct.list_node* %3
}
unsigned int *fn6(int *i) { return i; }


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

x86 assembly (clang, -O2):
<fn6>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32* @fn6(i32* readnone returned %0) {
ret i32* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ write(int, char *, int);
void _Unwind_GetGR() {
  char msg[] = "Aborting: "
               "_Unwind_GetGR"
               " called "
               "(C++ exception handling is disabled)\n";
  write(2, msg, sizeof(msg) - 1);
  abort();
}


x86 assembly (clang, -O0):
<_Unwind_GetGR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x45,%edx
call   1050 <memcpy@plt>
lea    -0x50(%rbp),%rsi
mov    $0x2,%edi
mov    $0x44,%edx
call   1040 <write@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_Unwind_GetGR>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0xa2964656c6261,%rax
mov    %rax,0x3d(%rsp)
mov    %rsp,%rsi
mov    $0x2,%edi
mov    $0x44,%edx
call   1040 <write@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@__const._Unwind_GetGR.msg = [69 x i8] c"Aborting: _Unwind_GetGR called (C++ exception handling is disabled)\0A\00"
define void @_Unwind_GetGR() {
%1 = alloca [69 x i8]
%2 = bitcast [69 x i8]* %1 to i8*
%3 = getelementptr inbounds [69 x i8], [69 x i8]* %1, i64 0, i64 0
%4 = call i32 @write(i32 2, i8* %3, i32 68)
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@__const._Unwind_GetGR.msg = [69 x i8] c"Aborting: _Unwind_GetGR called (C++ exception handling is disabled)\0A\00"
define void @_Unwind_GetGR() {
%1 = alloca [69 x i8]
%2 = getelementptr inbounds [69 x i8], [69 x i8]* %1, i64 0, i64 0
%3 = call i32 @write(i32 2, i8* %2, i32 68)
%4 = tail call i32 (...) @abort()
unreachable
}
void kasan_unpoison_slab(const void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @kasan_unpoison_slab(i8* nocapture %0) {
ret void
}
double cube(float f) { return f * f * f; }


x86 assembly (clang, -O0):
<cube>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cube>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @cube(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = load float, float* %2
%7 = fmul float %5, %6
%8 = fpext float %7 to double
ret double %8
}

LLVM IR (-O2):
define double @cube(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %2, %0
%4 = fpext float %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
foobar(int x, int y) {
  if (x * x * x > 0) {
    if (x > 0 && y == 10)
      abort();
  } else {
    if (x > 0 && y == 20)
      abort();
  }
}


x86 assembly (clang, -O0):
<foobar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    $0x0,%eax
jle    1152 <foobar+0x42>
cmpl   $0x0,-0x8(%rbp)
jle    114d <foobar+0x3d>
cmpl   $0xa,-0xc(%rbp)
jne    114d <foobar+0x3d>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1172 <foobar+0x62>
cmpl   $0x0,-0x8(%rbp)
jle    116d <foobar+0x5d>
cmpl   $0x14,-0xc(%rbp)
jne    116d <foobar+0x5d>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1172 <foobar+0x62>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foobar>:
push   %rax
mov    %edi,%eax
imul   %edi,%eax
imul   %edi,%eax
test   %eax,%eax
jle    1128 <foobar+0x18>
test   %edi,%edi
jle    1131 <foobar+0x21>
cmp    $0xa,%esi
jne    1131 <foobar+0x21>
jmp    1133 <foobar+0x23>
test   %edi,%edi
jle    1131 <foobar+0x21>
cmp    $0x14,%esi
je     1133 <foobar+0x23>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @foobar(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* %4
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, 10
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 (...) @abort()
unreachable
20: ; preds = %15, %12
br label %30
21: ; preds = %2
%22 = load i32, i32* %4
%23 = icmp sgt i32 %22, 0
br i1 %23, label %24, label %29
24: ; preds = %21
%25 = load i32, i32* %5
%26 = icmp eq i32 %25, 20
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = call i32 (...) @abort()
unreachable
29: ; preds = %24, %21
br label %30
30: ; preds = %29, %20
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @foobar(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, %0
%4 = mul nsw i32 %3, %0
%5 = icmp sgt i32 %4, 0
%6 = icmp sgt i32 %0, 0
br i1 %5, label %7, label %12
7: ; preds = %2
%8 = icmp eq i32 %1, 10
%9 = and i1 %6, %8
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %2
%13 = icmp eq i32 %1, 20
%14 = and i1 %6, %13
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = tail call i32 (...) @abort()
unreachable
17: ; preds = %12, %7
ret i32 undef
}
void iwmct_dbgfs_unregister(struct iwmct_debugfs *dbgfs) {}


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

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

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

LLVM IR (-O2):
%struct.iwmct_debugfs = type opaque
define void @iwmct_dbgfs_unregister(%struct.iwmct_debugfs* nocapture %0) {
ret void
}
/* Variables and functions */
int abs(int);
int hash(char *key) {
  int h = 5381;
  unsigned char c;
  for (c = *key; c != '\0'; c = *++key)
    h = h * 33 + c;
  return abs(h % 256);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
cmp    $0x0,%eax
je     1160 <hash+0x50>
imul   $0x21,-0xc(%rbp),%eax
movzbl -0xd(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    0x1(%rax),%al
mov    %al,-0xd(%rbp)
jmp    112c <hash+0x1c>
mov    -0xc(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1030 <abs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%al
test   %al,%al
je     113b <hash+0x3b>
add    $0x1,%rdi
mov    $0x1505,%ecx
nop
movzbl %al,%eax
mov    %ecx,%edx
shl    $0x5,%edx
add    %edx,%ecx
add    %eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash+0x10>
lea    0xff(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
and    $0xffffff00,%eax
sub    %eax,%ecx
jmp    1140 <hash+0x40>
mov    $0x5,%ecx
mov    %ecx,%eax
neg    %eax
cmovs  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8
store i8* %0, i8** %2
store i32 5381, i32* %3
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
store i8 %6, i8* %4
br label %7
7: ; preds = %17, %1
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i32, i32* %3
%13 = mul nsw i32 %12, 33
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = add nsw i32 %13, %15
store i32 %16, i32* %3
br label %17
17: ; preds = %11
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %2
%20 = load i8, i8* %19
store i8 %20, i8* %4
br label %7
21: ; preds = %7
%22 = load i32, i32* %3
%23 = srem i32 %22, 256
%24 = call i32 @abs(i32 %23)
ret i32 %24
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = zext i8 %5 to i32
%9 = mul nsw i32 %6, 33
%10 = add nsw i32 %9, %8
%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 %4
14: ; preds = %4
%15 = srem i32 %10, 256
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 5, %1 ], [ %15, %14 ]
%18 = tail call i32 @llvm.abs.i32(i32 %17, i1 true)
ret i32 %18
}
/* Variables and functions */
unsigned int sleep(unsigned int);
unsigned int ss_sleep(unsigned int seconds) {
  unsigned int result;
  result = sleep(seconds);
  while (result != 0) {
    result = sleep(result);
  }
  return 0;
}


x86 assembly (clang, -O0):
<ss_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sleep@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1140 <ss_sleep+0x30>
mov    -0x8(%rbp),%edi
call   1030 <sleep@plt>
mov    %eax,-0x8(%rbp)
jmp    1126 <ss_sleep+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ss_sleep>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1030 <sleep@plt>
test   %eax,%eax
je     112d <ss_sleep+0x1d>
mov    %eax,%edi
jmp    1120 <ss_sleep+0x10>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ss_sleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ %2, %1 ]
%6 = tail call i32 @sleep(i32 %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %4
8: ; preds = %4, %1
ret i32 0
}
/* Variables and functions */
int __api(int, unsigned long);
int rt_reg_task(unsigned long task_id) {
  return (__api(13, task_id) == 1) ? 0 : 1;
}


x86 assembly (clang, -O0):
<rt_reg_task>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0xd,%edi
call   1030 <__api@plt>
mov    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_reg_task>:
push   %rax
mov    %rdi,%rsi
mov    $0xd,%edi
call   1030 <__api@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rt_reg_task(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @__api(i32 13, i64 %3)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 0, i32 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @rt_reg_task(i64 %0) {
%2 = tail call i32 @__api(i32 13, i64 %0)
%3 = icmp ne i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
void set_vbar(unsigned int vbar) {}


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

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

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

LLVM IR (-O2):
define void @set_vbar(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ezdInitialize();
void openWindow() { ezdInitialize(); }


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

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

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

LLVM IR (-O2):
define void @openWindow() {
%1 = tail call i32 (...) @ezdInitialize()
ret void
}
void PrintFactJNCompVars1(void *theEnv, const char *logicalName,
                          void *theValue) {}


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

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

LLVM IR (-O0):
define void @PrintFactJNCompVars1(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 @PrintFactJNCompVars1(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void writelines_reverse(char *linep[], int nlines) {
  int i;
  for (i = nlines - 1; i >= 0; i--)
    printf("%s\n", linep[i]);
}


x86 assembly (clang, -O0):
<writelines_reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1158 <writelines_reverse+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <writelines_reverse+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writelines_reverse>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1149 <writelines_reverse+0x39>
mov    %rdi,%r15
mov    %esi,%ebx
add    $0x1,%rbx
lea    0xed7(%rip),%r14
nopl   0x0(%rax)
lea    -0x2(%rbx),%eax
mov    (%r15,%rax,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <writelines_reverse+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @writelines_reverse(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
char *CopynString(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *CopyString(const char *src) {
  if (!src)
    return NULL;
  return CopynString(src, strlen(src));
}


x86 assembly (clang, -O0):
<CopyString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <CopyString+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1164 <CopyString+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <CopynString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyString>:
test   %rdi,%rdi
je     1139 <CopyString+0x19>
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <CopynString@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @CopyString(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i8* @CopynString(i8* %0, i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i8* [ %5, %3 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
int test_cell_next_state();
int main() { return test_cell_next_state(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_cell_next_state()
ret i32 %1
}
void YUY2ToUVRow_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @YUY2ToUVRow_Any_SSE2() {
ret void
}
void removeUnusedLabels(char c) {
L0:
  c++;
  removeUnusedLabels(c);
L1:
  c++;
L2:
  c++;
LL:
  c++;
  c = c + 3;
L4:
  return;
}


x86 assembly (clang, -O0):
<removeUnusedLabels>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <removeUnusedLabels@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x3,%eax
mov    %al,-0x1(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeUnusedLabels>:
jmp    1100 <removeUnusedLabels>

LLVM IR (-O0):
define void @removeUnusedLabels(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %1
%4 = load i8, i8* %2
%5 = add i8 %4, 1
store i8 %5, i8* %2
%6 = load i8, i8* %2
br label %7
7: ; preds = %3
%8 = load i8, i8* %2
%9 = add i8 %8, 1
store i8 %9, i8* %2
br label %10
10: ; preds = %7
%11 = load i8, i8* %2
%12 = add i8 %11, 1
store i8 %12, i8* %2
br label %13
13: ; preds = %10
%14 = load i8, i8* %2
%15 = add i8 %14, 1
store i8 %15, i8* %2
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = add nsw i32 %17, 3
%19 = trunc i32 %18 to i8
store i8 %19, i8* %2
br label %20
20: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @removeUnusedLabels(i8 signext %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int two_to_the_power_of(int n) {
  int number = 1;
  for (int i = 0; i < n; i++)
    number *= 2;
  return number;
}


x86 assembly (clang, -O0):
<two_to_the_power_of>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <two_to_the_power_of+0x38>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <two_to_the_power_of+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<two_to_the_power_of>:
test   %edi,%edi
jle    1118 <two_to_the_power_of+0x18>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111e <two_to_the_power_of+0x1e>
mov    $0x1,%eax
jmp    1138 <two_to_the_power_of+0x38>
mov    $0x1,%eax
ret
and    $0xfffffff8,%edi
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
shl    $0x8,%eax
add    $0xfffffff8,%edi
jne    1130 <two_to_the_power_of+0x30>
test   %ecx,%ecx
je     1147 <two_to_the_power_of+0x47>
nopl   0x0(%rax)
add    %eax,%eax
add    $0xffffffff,%ecx
jne    1140 <two_to_the_power_of+0x40>
ret

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

LLVM IR (-O2):
define i32 @two_to_the_power_of(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %19
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %21
9: ; preds = %21, %3
%10 = phi i32 [ undef, %3 ], [ %24, %21 ]
%11 = phi i32 [ 1, %3 ], [ %24, %21 ]
%12 = icmp eq i32 %5, 0
br i1 %12, label %19, label %13
13: ; preds = %9, %13
%14 = phi i32 [ %16, %13 ], [ %11, %9 ]
%15 = phi i32 [ %17, %13 ], [ 0, %9 ]
%16 = shl nsw i32 %14, 1
%17 = add i32 %15, 1
%18 = icmp eq i32 %17, %5
br i1 %18, label %19, label %13
19: ; preds = %9, %13, %1
%20 = phi i32 [ 1, %1 ], [ %10, %9 ], [ %16, %13 ]
ret i32 %20
21: ; preds = %21, %7
%22 = phi i32 [ 1, %7 ], [ %24, %21 ]
%23 = phi i32 [ 0, %7 ], [ %25, %21 ]
%24 = shl i32 %22, 8
%25 = add i32 %23, 8
%26 = icmp eq i32 %25, %8
br i1 %26, label %9, label %21
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  exit(EXIT_SUCCESS);
  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)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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* @EXIT_SUCCESS
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void ble_evt_flash_ps_key(const struct ble_msg_flash_ps_key_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_flash_ps_key_evt_t = type opaque
define void @ble_evt_flash_ps_key(%struct.ble_msg_flash_ps_key_evt_t* nocapture %0) {
ret void
}
int test_imm_A8uint8_mem(unsigned char *val) {
  return ((*val) & (-0xA8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A8uint8_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, -168
%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_A8uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 88
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ wait(int *);
void parent() {
  int n;
  n = getpid();
  wait(&n);
}


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1040 <wait@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <wait@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @parent() {
%1 = alloca i32
%2 = call i32 (...) @getpid()
store i32 %2, i32* %1
%3 = call i32 @wait(i32* %1)
ret void
}

LLVM IR (-O2):
define void @parent() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @getpid()
store i32 %3, i32* %1
%4 = call i32 @wait(i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, double *, int);
uint64_t double_to_uint64(double d) {
  uint64_t n;
  memcpy(&n, &d, 8);
  return n;
}


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

x86 assembly (clang, -O2):
<double_to_uint64>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    0xc(%rsp),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @double_to_uint64(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = bitcast i32* %3 to i8*
%5 = call i32 @memcpy(i32* %3, double* %2, i32 8)
%6 = load i32, i32* %3
ret i32 %6
}
void my_swap(int *a, int *b) {
  int stock = 0;
  stock = *a;
  *a = *b;
  *b = stock;
}


x86 assembly (clang, -O0):
<my_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @my_swap(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
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @my_swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void itfailed(void) {
  printf("Ok\n");
  exit(2);
}


x86 assembly (clang, -O0):
<itfailed>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<itfailed>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"Ok\0A\00"
define void @itfailed() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@str = [3 x i8] c"Ok\00"
define void @itfailed() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 2)
unreachable
}