xunge/DecIR huggingface dataset:
/* Variables and functions */
int anetSetTcpNoDelay(char *, int, int);
int catAnetEnableTcpNoDelay(char *err, int fd) {
  return anetSetTcpNoDelay(err, fd, 1);
}


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

x86 assembly (clang, -O2):
<catAnetEnableTcpNoDelay>:
mov    $0x1,%edx
jmp    1030 <anetSetTcpNoDelay@plt>

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

LLVM IR (-O2):
define i32 @catAnetEnableTcpNoDelay(i8* %0, i32 %1) {
%3 = tail call i32 @anetSetTcpNoDelay(i8* %0, i32 %1, i32 1)
ret i32 %3
}
void DCSMSecureZone1(void) {
  (*((volatile unsigned long *)(0x400FB400 + 0x00000080))) |= 0x00008000;
}


x86 assembly (clang, -O0):
<DCSMSecureZone1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fb480,%eax
mov    (%rax),%rcx
or     $0x8000,%rcx
mov    $0x400fb480,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DCSMSecureZone1>:
orq    $0x8000,0x400fb480
ret

LLVM IR (-O0):
define void @DCSMSecureZone1() {
%1 = load volatile i64, i64* inttoptr (i64 1074771072 to i64*)
%2 = or i64 %1, 32768
store volatile i64 %2, i64* inttoptr (i64 1074771072 to i64*)
ret void
}

LLVM IR (-O2):
define void @DCSMSecureZone1() {
%1 = load volatile i64, i64* inttoptr (i64 1074771072 to i64*)
%2 = or i64 %1, 32768
store volatile i64 %2, i64* inttoptr (i64 1074771072 to i64*)
ret void
}
/* Variables and functions */
float RAND_MAX;
scalar_t__ rand();
float RandomFloat() {
  float number;
  return ((float)rand() / RAND_MAX);
}


x86 assembly (clang, -O0):
<RandomFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ebd(%rip),%rax
divss  (%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFloat>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec4(%rip),%rax
divss  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define float @RandomFloat() {
%1 = alloca float
%2 = call i64 (...) @rand()
%3 = sitofp i64 %2 to float
%4 = load float, float* @RAND_MAX
%5 = fdiv float %3, %4
ret float %5
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define float @RandomFloat() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load float, float* @RAND_MAX
%4 = fdiv float %2, %3
ret float %4
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR65_get(void) { return U_WMRCORENONE_get("U_WMR65"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR65\00"
define i32 @U_WMR65_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR65\00"
define i32 @U_WMR65_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int setsockopt(int, int, int, void const *, int);
int /*<<< orphan*/ unix_error(char *);
void csapp_setsockopt(int s, int level, int optname, const void *optval,
                      int optlen) {
  int rc;
  if ((rc = setsockopt(s, level, optname, optval, optlen)) < 0)
    unix_error("setsockopt error");
}


x86 assembly (clang, -O0):
<csapp_setsockopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <setsockopt@plt>
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jge    1167 <csapp_setsockopt+0x47>
lea    0xe9e(%rip),%rdi
call   1040 <unix_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csapp_setsockopt>:
push   %rax
call   1030 <setsockopt@plt>
test   %eax,%eax
js     112c <csapp_setsockopt+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1040 <unix_error@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"setsockopt error\00"
define void @csapp_setsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @setsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @unix_error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}
void tm_fcs_close(void *p) {}


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

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

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

LLVM IR (-O2):
define void @tm_fcs_close(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int factorial(int);
bool isPrime(uint64_t n) {
  uint64_t large = factorial(n - 1) + 1;
  return (large % n) == 0;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial@plt>
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
call   1030 <factorial@plt>
add    $0x1,%eax
cltd
idiv   %ebx
xor    %eax,%eax
test   %edx,%edx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isPrime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = call i32 @factorial(i32 %5)
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = srem i32 %8, %9
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = tail call i32 @factorial(i32 %2)
%4 = add nsw i32 %3, 1
%5 = srem i32 %4, %0
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello World\n");
  return 1;
}


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>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 1
}
int birbul(int x) {
  int basamak, birsayisi = 0;
  while (x > 0) {
    basamak = x % 10;
    x /= 10;
    if (basamak == 1) {
      birsayisi++;
    }
  }
  return birsayisi;
}


x86 assembly (clang, -O0):
<birbul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114c <birbul+0x4c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1147 <birbul+0x47>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <birbul+0xe>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<birbul>:
xor    %eax,%eax
test   %edi,%edi
jle    1138 <birbul+0x38>
mov    $0xcccccccd,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
imul   $0xcccccccd,%edi,%esi
add    $0x33333333,%esi
ror    %esi
cmp    $0x1999999a,%esi
adc    $0x0,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <birbul+0x10>
ret

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

LLVM IR (-O2):
define i32 @birbul(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = urem i32 %5, 10
%7 = udiv i32 %5, 10
%8 = icmp eq i32 %6, 1
%9 = zext i1 %8 to i32
%10 = add nuw nsw i32 %4, %9
%11 = icmp ult i32 %5, 10
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %10, %3 ]
ret i32 %13
}
/* Type definitions */
struct miscDevice {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ freeDevice(struct device *);
void miscFreeDevice(struct miscDevice *dev) {
  freeDevice((struct device *)dev);
}


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

x86 assembly (clang, -O2):
<miscFreeDevice>:
jmp    1030 <freeDevice@plt>

LLVM IR (-O0):
%struct.miscDevice = type { i32 }
%struct.device = type { i32 }
define void @miscFreeDevice(%struct.miscDevice* %0) {
%2 = alloca %struct.miscDevice*
store %struct.miscDevice* %0, %struct.miscDevice** %2
%3 = load %struct.miscDevice*, %struct.miscDevice** %2
%4 = bitcast %struct.miscDevice* %3 to %struct.device*
%5 = call i32 @freeDevice(%struct.device* %4)
ret void
}

LLVM IR (-O2):
%struct.miscDevice = type { i32 }
%struct.device = type { i32 }
define void @miscFreeDevice(%struct.miscDevice* %0) {
%2 = bitcast %struct.miscDevice* %0 to %struct.device*
%3 = tail call i32 @freeDevice(%struct.device* %2)
ret void
}
void glAttachShader(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glAttachShader() {
ret void
}
create_struct_list() {}


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

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

LLVM IR (-O0):
define i32 @create_struct_list() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @create_struct_list() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fat(int);
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int numero;
  scanf("%d", &numero);
  printf("%d! =  %ld", numero, fat(numero));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <fat@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1050 <fat@plt>
lea    0xeab(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"%d! = %ld\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @fat(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"%d! = %ld\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @fat(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int array[20] = {1, 1};
  int i = 2;
  for (; i < 20; i++)
    array[i] = array[i - 1] + array[i - 2];
  printf("%d\n", array[19]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1040 <memset@plt>
movl   $0x1,-0x60(%rbp)
movl   $0x1,-0x5c(%rbp)
movl   $0x2,-0x64(%rbp)
cmpl   $0x14,-0x64(%rbp)
jge    118c <main+0x6c>
mov    -0x64(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x60(%rbp,%rax,4),%ecx
mov    -0x64(%rbp),%eax
sub    $0x2,%eax
cltq
add    -0x60(%rbp,%rax,4),%ecx
movslq -0x64(%rbp),%rax
mov    %ecx,-0x60(%rbp,%rax,4)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1154 <main+0x34>
mov    -0x14(%rbp),%esi
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [20 x i32]* %2 to i8*
%5 = bitcast i8* %4 to <{ i32, i32, [18 x i32] }>*
%6 = getelementptr inbounds <{ i32, i32, [18 x i32] }>, <{ i32, i32, [18 x i32] }>* %5, i32 0, i32 0
store i32 1, i32* %6
%7 = getelementptr inbounds <{ i32, i32, [18 x i32] }>, <{ i32, i32, [18 x i32] }>* %5, i32 0, i32 1
store i32 1, i32* %7
store i32 2, i32* %3
br label %8
8: ; preds = %26, %0
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 20
br i1 %10, label %11, label %29
11: ; preds = %8
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = load i32, i32* %3
%18 = sub nsw i32 %17, 2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = add nsw i32 %16, %21
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 %24
store i32 %22, i32* %25
br label %26
26: ; preds = %11
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %8
29: ; preds = %8
%30 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 19
%31 = load i32, i32* %30
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %31)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6765)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f1(int *a) {
  if (*a != 0) {
    abort();
  }
  *a = 111111;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     1130 <f1+0x20>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
movl   $0x1b207,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rax
cmpl   $0x0,(%rdi)
jne    111e <f1+0xe>
movl   $0x1b207,(%rdi)
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f1(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
%9 = load i32*, i32** %2
store i32 111111, i32* %9
ret void
}

LLVM IR (-O2):
define void @f1(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
store i32 111111, i32* %0
ret void
}
int utl_atod_isdigit(char c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<utl_atod_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <utl_atod_isdigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utl_atod_isdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @utl_atod_isdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *get_time_string() {
  static char buffer[80];
  time_t rawtime;
  struct tm *timeinfo;
  time(&rawtime);
  timeinfo = localtime(&rawtime);
  strftime(buffer, sizeof(buffer), "%b %d %H:%M:%S", timeinfo);
  return buffer;
}


x86 assembly (clang, -O0):
<get_time_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    0x2ef7(%rip),%rdi
mov    $0x50,%esi
lea    0xe9b(%rip),%rdx
call   1050 <strftime@plt>
lea    0x2edf(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_string>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
lea    0x2eff(%rip),%rbx
lea    0xea8(%rip),%rdx
mov    %rbx,%rdi
mov    $0x50,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@get_time_string.buffer = internal global [80 x i8] zeroinitializer
@.str = [15 x i8] c"%b %d %H:%M:%S\00"
define i8* @get_time_string() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = call i32 @strftime(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @get_time_string.buffer, i64 0, i64 0), i32 80, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret i8* getelementptr inbounds ([80 x i8], [80 x i8]* @get_time_string.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@get_time_string.buffer = internal global [80 x i8] zeroinitializer
@.str = [15 x i8] c"%b %d %H:%M:%S\00"
define i8* @get_time_string() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
%5 = call i32 @strftime(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @get_time_string.buffer, i64 0, i64 0), i32 80, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret i8* getelementptr inbounds ([80 x i8], [80 x i8]* @get_time_string.buffer, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ _SC_CLK_TCK;
int /*<<< orphan*/ printf(char *, long);
long sysconf(int /*<<< orphan*/);
int main(void) {
  long ticks = sysconf(_SC_CLK_TCK);
  printf("Ticks: %ld\n", ticks);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
lea    0xeca(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@_SC_CLK_TCK = global i32 0
@.str = [12 x i8] c"Ticks: %ld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = load i32, i32* @_SC_CLK_TCK
%3 = call i64 @sysconf(i32 %2)
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}

LLVM IR (-O2):
@_SC_CLK_TCK = global i32 0
@.str = [12 x i8] c"Ticks: %ld\0A\00"
define i32 @main() {
%1 = load i32, i32* @_SC_CLK_TCK
%2 = tail call i64 @sysconf(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int /*<<< orphan*/ iswpunct(int /*<<< orphan*/);
void uninitvar_iswpunct(void) {
  wint_t i;
  (void)iswpunct(i);
}


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

x86 assembly (clang, -O2):
<uninitvar_iswpunct>:
jmp    1030 <iswpunct@plt>

LLVM IR (-O0):
define void @uninitvar_iswpunct() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @iswpunct(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_iswpunct() {
%1 = tail call i32 @iswpunct(i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  char s1[] = "HELLO WORLD";
  char s2[] = {'H', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', '\0'};
  printf("%s %s", s1, s2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xed2(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xed0(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movabs $0x4f57204f4c4c4548,%rax
20 57 4f
mov    %rax,0x18(%rsp)
movl   $0x444c52,0x20(%rsp)
movabs $0x6f77206f6c6c6548,%rax
20 77 6f
mov    %rax,0x8(%rsp)
movl   $0x646c72,0x10(%rsp)
lea    0xecf(%rip),%rdi
lea    0x18(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.s1 = [12 x i8] c"HELLO WORLD\00"
@__const.main.s2 = [12 x i8] c"Hello world\00"
@.str = [6 x i8] c"%s %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca [12 x i8]
store i32 0, i32* %1
%4 = bitcast [12 x i8]* %2 to i8*
%5 = bitcast [12 x i8]* %3 to i8*
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [12 x i8] c"HELLO WORLD\00"
@__const.main.s2 = [12 x i8] c"Hello world\00"
@.str = [6 x i8] c"%s %s\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = alloca [12 x i8]
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret i32 0
}
int f1(int t) { return 1 - (int)(1U - t); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%ecx
sub    -0x4(%rbp),%ecx
mov    $0x1,%eax
sub    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 1, %3
%5 = sub nsw i32 1, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @f1(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int execlp(char const *, char const *, char const *, void *);
int /*<<< orphan*/ g_mk_temp_dir(int /*<<< orphan*/);
int /*<<< orphan*/ g_rm_temp_dir();
int g_execlp3(const char *a1, const char *a2, const char *a3) {
  int rv;
  g_rm_temp_dir();
  rv = execlp(a1, a2, a3, (void *)0);
  g_mk_temp_dir(0);
  return rv;
}


x86 assembly (clang, -O0):
<g_execlp3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <g_rm_temp_dir@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1050 <execlp@plt>
mov    %eax,-0x1c(%rbp)
xor    %edi,%edi
call   1040 <g_mk_temp_dir@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_execlp3>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <g_rm_temp_dir@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %ecx,%ecx
call   1050 <execlp@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1040 <g_mk_temp_dir@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @g_execlp3(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = call i32 (...) @g_rm_temp_dir()
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 @execlp(i8* %9, i8* %10, i8* %11, i8* null)
store i32 %12, i32* %7
%13 = call i32 @g_mk_temp_dir(i32 0)
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
define i32 @g_execlp3(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 (...) @g_rm_temp_dir()
%5 = tail call i32 @execlp(i8* %0, i8* %1, i8* %2, i8* null)
%6 = tail call i32 @g_mk_temp_dir(i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ vs_spi_clk_cmd();
int /*<<< orphan*/ vs_write_reg(int, int);
void audio_soft_reset(void) {
  vs_spi_clk_cmd();
  vs_write_reg((0x00), 0x800 | 0x04);
  vs_write_reg((0x03), 0x9800);
  vs_write_reg((0x04), 0x0000);
  vs_write_reg((0x04), 0x0000);
}


x86 assembly (clang, -O0):
<audio_soft_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <vs_spi_clk_cmd@plt>
xor    %edi,%edi
mov    $0x804,%esi
call   1040 <vs_write_reg@plt>
mov    $0x3,%edi
mov    $0x9800,%esi
call   1040 <vs_write_reg@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1040 <vs_write_reg@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1040 <vs_write_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<audio_soft_reset>:
push   %rax
xor    %eax,%eax
call   1030 <vs_spi_clk_cmd@plt>
xor    %edi,%edi
mov    $0x804,%esi
call   1040 <vs_write_reg@plt>
mov    $0x3,%edi
mov    $0x9800,%esi
call   1040 <vs_write_reg@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1040 <vs_write_reg@plt>
mov    $0x4,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <vs_write_reg@plt>

LLVM IR (-O0):
define void @audio_soft_reset() {
%1 = call i32 (...) @vs_spi_clk_cmd()
%2 = call i32 @vs_write_reg(i32 0, i32 2052)
%3 = call i32 @vs_write_reg(i32 3, i32 38912)
%4 = call i32 @vs_write_reg(i32 4, i32 0)
%5 = call i32 @vs_write_reg(i32 4, i32 0)
ret void
}

LLVM IR (-O2):
define void @audio_soft_reset() {
%1 = tail call i32 (...) @vs_spi_clk_cmd()
%2 = tail call i32 @vs_write_reg(i32 0, i32 2052)
%3 = tail call i32 @vs_write_reg(i32 3, i32 38912)
%4 = tail call i32 @vs_write_reg(i32 4, i32 0)
%5 = tail call i32 @vs_write_reg(i32 4, i32 0)
ret void
}
void abb_iwinfo_init(void) { int abb_shm_id = -1; }


x86 assembly (clang, -O0):
<abb_iwinfo_init>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @abb_iwinfo_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ im_a_benign_func();
int /*<<< orphan*/ im_a_mlaign_func();
void testFuncStatementDecision1(unsigned char decision1,
                                unsigned char decision2) {
  if (decision1 || decision2) {
    im_a_mlaign_func();
  } else {
    im_a_benign_func();
  }
}


x86 assembly (clang, -O0):
<testFuncStatementDecision1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jne    114e <testFuncStatementDecision1+0x2e>
movzbl -0x2(%rbp),%eax
cmp    $0x0,%eax
je     115a <testFuncStatementDecision1+0x3a>
mov    $0x0,%al
call   1030 <im_a_mlaign_func@plt>
jmp    1161 <testFuncStatementDecision1+0x41>
mov    $0x0,%al
call   1040 <im_a_benign_func@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFuncStatementDecision1>:
xor    %eax,%eax
or     %esi,%edi
je     112b <testFuncStatementDecision1+0xb>
jmp    1030 <im_a_mlaign_func@plt>
jmp    1040 <im_a_benign_func@plt>

LLVM IR (-O0):
define void @testFuncStatementDecision1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8, %2
%13 = call i32 (...) @im_a_mlaign_func()
br label %16
14: ; preds = %8
%15 = call i32 (...) @im_a_benign_func()
br label %16
16: ; preds = %14, %12
ret void
}

LLVM IR (-O2):
define void @testFuncStatementDecision1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @im_a_mlaign_func()
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @im_a_benign_func()
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(float);
void console_cursor(int cursor) {
  putchar(0x1b);
  if (cursor) {
    putchar('e');
  } else {
    putchar('f');
  }
}


x86 assembly (clang, -O0):
<console_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
call   1030 <putchar@plt>
cmpl   $0x0,-0x4(%rbp)
je     1144 <console_cursor+0x34>
movss  0xece(%rip),%xmm0
call   1030 <putchar@plt>
jmp    1151 <console_cursor+0x41>
movss  0xeb8(%rip),%xmm0
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_cursor>:
push   %rbx
xor    %ebx,%ebx
test   %edi,%edi
sete   %bl
movss  0xee0(%rip),%xmm0
call   1030 <putchar@plt>
lea    0xed8(%rip),%rax
movss  (%rax,%rbx,4),%xmm0
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @console_cursor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @putchar(float 2.700000e+01)
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @putchar(float 1.010000e+02)
br label %10
8: ; preds = %1
%9 = call i32 @putchar(float 1.020000e+02)
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
define void @console_cursor(i32 %0) {
%2 = tail call i32 @putchar(float 2.700000e+01)
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, float 1.020000e+02, float 1.010000e+02
%5 = tail call i32 @putchar(float %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { return !printf("Hello, world\n"); }


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>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ets_install_putc1(void (*)(char));
__attribute__((always_)) __attribute__((flatten)) void
os_install_putc1(void (*p)(char)) {
  ets_install_putc1(p);
}


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

x86 assembly (clang, -O2):
<os_install_putc1>:
jmp    1030 <ets_install_putc1@plt>

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

LLVM IR (-O2):
define void @os_install_putc1(void (i8)* %0) {
%2 = tail call i32 @ets_install_putc1(void (i8)* %0)
ret void
}
void g_type_interface_peek() {}


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

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

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

LLVM IR (-O2):
define void @g_type_interface_peek() {
ret void
}
void mdp4_dmas_done_mddi(int cndx) {}


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

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

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

LLVM IR (-O2):
define void @mdp4_dmas_done_mddi(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
gid_t getegid(void) { return (uid_t)1; }


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

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

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

LLVM IR (-O2):
define i32 @getegid() {
ret i32 1
}
int sys_link(int ofd, const char *old_path, int nfd, const char *new_path) {}


x86 assembly (clang, -O0):
<sys_link>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sys_link(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @sys_link(i32 %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3) {
ret i32 undef
}
int get_mode() {
  unsigned char c = 0x88;
  int t = c;
  return c;
}


x86 assembly (clang, -O0):
<get_mode>:
push   %rbp
mov    %rsp,%rbp
movb   $0x88,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_mode() {
%1 = alloca i8
%2 = alloca i32
store i8 -120, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
store i32 %4, i32* %2
%5 = load i8, i8* %1
%6 = zext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_mode() {
ret i32 136
}
void carry() {}


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

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

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

LLVM IR (-O2):
define void @carry() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ search_replace_string(char *, char *, char *);
char *security_replace_special_characters(char *data) {
  search_replace_string(data, "\\", "/");
  search_replace_string(data, "\"", "'");
  return data;
}


x86 assembly (clang, -O0):
<security_replace_special_characters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xed4(%rip),%rdx
call   1030 <search_replace_string@plt>
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
lea    0xec1(%rip),%rdx
call   1030 <search_replace_string@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<security_replace_special_characters>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
lea    0xee0(%rip),%rdx
call   1030 <search_replace_string@plt>
lea    0xed6(%rip),%rsi
lea    0xed1(%rip),%rdx
mov    %rbx,%rdi
call   1030 <search_replace_string@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\\\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [2 x i8] c"\22\00"
@.str.3 = [2 x i8] c"'\00"
define i8* @security_replace_special_characters(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @search_replace_string(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @search_replace_string(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
@.str = [2 x i8] c"\\\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [2 x i8] c"\22\00"
@.str.3 = [2 x i8] c"'\00"
define i8* @security_replace_special_characters(i8* returned %0) {
%2 = tail call i32 @search_replace_string(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @search_replace_string(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i8* %0
}
/* Variables and functions */
bool nrf53_errata_28(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_28() {
ret i32 0
}
void bar_int(void) { foo_int(2 - 3i); }


x86 assembly (clang, -O0):
<bar_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x8(%rbp)
movl   $0xfffffffd,-0x4(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <foo_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_int>:
movabs $0xfffffffd00000002,%rdi
ff ff ff
xor    %eax,%eax
jmp    1030 <foo_int@plt>

LLVM IR (-O0):
define void @bar_int() {
%1 = alloca { i32, i32 }
%2 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %1, i32 0, i32 0
%3 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %1, i32 0, i32 1
store i32 2, i32* %2
store i32 -3, i32* %3
%4 = bitcast { i32, i32 }* %1 to i64*
%5 = load i64, i64* %4
%6 = call i32 (i64, ...) bitcast (i32 (...)* @foo_int to i32 (i64, ...)*)(i64 %5)
ret void
}

LLVM IR (-O2):
define void @bar_int() {
%1 = tail call i32 (i64, ...) bitcast (i32 (...)* @foo_int to i32 (i64, ...)*)(i64 -12884901886)
ret void
}
void copy_line(char to[], char from[]) {
  int i;
  i = 0;
  while ((to[i] = from[i]) != '\0')
    ++i;
}


x86 assembly (clang, -O0):
<copy_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1143 <copy_line+0x43>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <copy_line+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_line>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copy_line+0x10>
ret

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

LLVM IR (-O2):
define void @copy_line(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %9, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add nuw i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int pq_check_base(int, int, void **);
int pq_check(int vects, int len, void **array) {
  return pq_check_base(vects, len, array);
}


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

x86 assembly (clang, -O2):
<pq_check>:
jmp    1030 <pq_check_base@plt>

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

LLVM IR (-O2):
define i32 @pq_check(i32 %0, i32 %1, i8** %2) {
%4 = tail call i32 @pq_check_base(i32 %0, i32 %1, i8** %2)
ret i32 %4
}
void parallel_readwrite(char *file_name, void *dump_buffer, int type_of_file,
                        int is_write, long long offset) {}


x86 assembly (clang, -O0):
<parallel_readwrite>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @parallel_readwrite(i8* nocapture %0, i8* nocapture %1, i32 %2, i32 %3, i64 %4) {
ret void
}
unsigned randq1(unsigned *pstate) {
  if (*pstate == 0)
    *pstate = 1;
  *pstate = 1664525 * (*pstate) + 1013904223;
  return *pstate;
}


x86 assembly (clang, -O0):
<randq1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jne    111f <randq1+0x1f>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
imul   $0x19660d,(%rax),%ecx
add    $0x3c6ef35f,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<randq1>:
mov    (%rdi),%eax
imul   $0x19660d,%eax,%ecx
add    $0x3c6ef35f,%ecx
test   %eax,%eax
mov    $0x3c88596c,%eax
cmovne %ecx,%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @randq1(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
%4 = mul i32 %2, 1664525
%5 = add i32 %4, 1013904223
%6 = select i1 %3, i32 1015568748, i32 %5
store i32 %6, i32* %0
ret i32 %6
}
/* Variables and functions */
int fpw_functionv(char const *, int /*<<< orphan*/, int /*<<< orphan*/);
int fpw_function(const char *name) { return fpw_functionv(name, 0, 0); }


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

x86 assembly (clang, -O2):
<fpw_function>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <fpw_functionv@plt>

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

LLVM IR (-O2):
define i32 @fpw_function(i8* %0) {
%2 = tail call i32 @fpw_functionv(i8* %0, i32 0, i32 0)
ret i32 %2
}