xunge/DecIR huggingface dataset:
/* Variables and functions */
int increment(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 1, j = 2;
  printf("I now is %d \n ", increment(i));
  increment(j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <increment@plt>
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%edi
call   1030 <increment@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"I now is %d \0A \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @increment(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @increment(i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"I now is %d \0A \00"
define i32 @main() {
%1 = tail call i32 @increment(i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @increment(i32 2)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int int32_t;

/* Variables and functions */
int encode_signed32(uint8_t *apdu, int32_t value) {
  apdu[0] = (uint8_t)((value & 0xff000000) >> 24);
  apdu[1] = (uint8_t)((value & 0x00ff0000) >> 16);
  apdu[2] = (uint8_t)((value & 0x0000ff00) >> 8);
  apdu[3] = (uint8_t)(value & 0x000000ff);
  return 4;
}


x86 assembly (clang, -O0):
<encode_signed32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
and    $0xff0000,%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0xc(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
mov    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_signed32>:
mov    %esi,%eax
mov    %esi,%ecx
movzbl %ah,%edx
movzbl %al,%esi
shr    $0x18,%eax
mov    %rax,(%rdi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %rax,0x8(%rdi)
mov    %rdx,0x10(%rdi)
mov    %rsi,0x18(%rdi)
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @encode_signed32(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, -16777216
%7 = lshr i32 %6, 24
%8 = zext i32 %7 to i64
%9 = load i64*, i64** %3
%10 = getelementptr inbounds i64, i64* %9, i64 0
store i64 %8, i64* %10
%11 = load i32, i32* %4
%12 = and i32 %11, 16711680
%13 = ashr i32 %12, 16
%14 = sext i32 %13 to i64
%15 = load i64*, i64** %3
%16 = getelementptr inbounds i64, i64* %15, i64 1
store i64 %14, i64* %16
%17 = load i32, i32* %4
%18 = and i32 %17, 65280
%19 = ashr i32 %18, 8
%20 = sext i32 %19 to i64
%21 = load i64*, i64** %3
%22 = getelementptr inbounds i64, i64* %21, i64 2
store i64 %20, i64* %22
%23 = load i32, i32* %4
%24 = and i32 %23, 255
%25 = sext i32 %24 to i64
%26 = load i64*, i64** %3
%27 = getelementptr inbounds i64, i64* %26, i64 3
store i64 %25, i64* %27
ret i32 4
}

LLVM IR (-O2):
define i32 @encode_signed32(i64* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = zext i32 %3 to i64
store i64 %4, i64* %0
%5 = lshr i32 %1, 16
%6 = and i32 %5, 255
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %7, i64* %8
%9 = lshr i32 %1, 8
%10 = and i32 %9, 255
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i64, i64* %0, i64 2
store i64 %11, i64* %12
%13 = and i32 %1, 255
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i64, i64* %0, i64 3
store i64 %14, i64* %15
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ printf(char *, size_t);
void *xmalloc(size_t size) {
  if (size > 10485760) {
    printf("Big malloc %u!\n", size);
  }
  void *m = malloc(size);
  if (m == NULL) {
    printf("Out of Memory! @ malloc size %u\n", size);
    exit(1);
  }
  return m;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0xa00000,-0x8(%rbp)
jbe    115a <xmalloc+0x2a>
mov    -0x8(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    118c <xmalloc+0x5c>
mov    -0x8(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
cmp    $0xa00001,%rdi
jb     114c <xmalloc+0x1c>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     115b <xmalloc+0x2b>
pop    %rbx
ret
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Big malloc %u!\0A\00"
@.str.1 = [33 x i8] c"Out of Memory! @ malloc size %u\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp ugt i64 %4, 10485760
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %7)
br label %9
9: ; preds = %6, %1
%10 = load i64, i64* %2
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = load i64, i64* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i64 %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %9
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
@.str = [16 x i8] c"Big malloc %u!\0A\00"
@.str.1 = [33 x i8] c"Out of Memory! @ malloc size %u\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = icmp ugt i64 %0, 10485760
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %5
5: ; preds = %3, %1
%6 = tail call i8* @malloc(i64 %0)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i64 %0)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %5
ret i8* %6
}
/* Variables and functions */
float *alloc_float(int);
int /*<<< orphan*/ dealloc_float(float *);
void test_nowarn_float(int n) {
  {
    float *p = alloc_float(n);
    dealloc_float(p);
  }
  {
    float *p = alloc_float(n);
    dealloc_float(p + 2);
  }
}


x86 assembly (clang, -O0):
<test_nowarn_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <alloc_float@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <dealloc_float@plt>
mov    -0x4(%rbp),%edi
call   1040 <alloc_float@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x8,%rdi
call   1030 <dealloc_float@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_nowarn_float>:
push   %rbx
mov    %edi,%ebx
call   1040 <alloc_float@plt>
mov    %rax,%rdi
call   1030 <dealloc_float@plt>
mov    %ebx,%edi
call   1040 <alloc_float@plt>
lea    0x8(%rax),%rdi
pop    %rbx
jmp    1030 <dealloc_float@plt>

LLVM IR (-O0):
define void @test_nowarn_float(i32 %0) {
%2 = alloca i32
%3 = alloca float*
%4 = alloca float*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call float* @alloc_float(i32 %5)
store float* %6, float** %3
%7 = load float*, float** %3
%8 = call i32 @dealloc_float(float* %7)
%9 = load i32, i32* %2
%10 = call float* @alloc_float(i32 %9)
store float* %10, float** %4
%11 = load float*, float** %4
%12 = getelementptr inbounds float, float* %11, i64 2
%13 = call i32 @dealloc_float(float* %12)
ret void
}

LLVM IR (-O2):
define void @test_nowarn_float(i32 %0) {
%2 = tail call float* @alloc_float(i32 %0)
%3 = tail call i32 @dealloc_float(float* %2)
%4 = tail call float* @alloc_float(i32 %0)
%5 = getelementptr inbounds float, float* %4, i64 2
%6 = tail call i32 @dealloc_float(float* %5)
ret void
}
/* Variables and functions */
unsigned char VIM_HIF_GetReg8(int);
int /*<<< orphan*/ VIM_HIF_SetReg8(int, unsigned char);
void VIM_DISP_EnableDecodeSpecial(unsigned char bEnable) {
  unsigned char byMode;
  byMode = VIM_HIF_GetReg8((0x2800 + 0x0e9));
  byMode &= 0x1f;
  byMode |= ((bEnable & 0x01) << 5);
  VIM_HIF_SetReg8((0x2800 + 0x0e9), byMode);
}


x86 assembly (clang, -O0):
<VIM_DISP_EnableDecodeSpecial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x28e9,%edi
call   1040 <VIM_HIF_GetReg8@plt>
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
and    $0x1f,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%ecx
and    $0x1,%ecx
shl    $0x5,%ecx
movzbl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x2(%rbp)
mov    $0x28e9,%edi
movzbl -0x2(%rbp),%esi
call   1030 <VIM_HIF_SetReg8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_DISP_EnableDecodeSpecial>:
push   %rbx
mov    %edi,%ebx
mov    $0x28e9,%edi
call   1040 <VIM_HIF_GetReg8@plt>
and    $0x1f,%al
shl    $0x5,%bl
and    $0x20,%bl
or     %al,%bl
movzbl %bl,%esi
mov    $0x28e9,%edi
pop    %rbx
jmp    1030 <VIM_HIF_SetReg8@plt>

LLVM IR (-O0):
define void @VIM_DISP_EnableDecodeSpecial(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = call zeroext i8 @VIM_HIF_GetReg8(i32 10473)
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = and i32 %6, 31
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = and i32 %10, 1
%12 = shl i32 %11, 5
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %14, %12
%16 = trunc i32 %15 to i8
store i8 %16, i8* %3
%17 = load i8, i8* %3
%18 = call i32 @VIM_HIF_SetReg8(i32 10473, i8 zeroext %17)
ret void
}

LLVM IR (-O2):
define void @VIM_DISP_EnableDecodeSpecial(i8 zeroext %0) {
%2 = tail call zeroext i8 @VIM_HIF_GetReg8(i32 10473)
%3 = and i8 %2, 31
%4 = shl i8 %0, 5
%5 = and i8 %4, 32
%6 = or i8 %3, %5
%7 = tail call i32 @VIM_HIF_SetReg8(i32 10473, i8 zeroext %6)
ret void
}
void power_supply_update_leds(struct power_supply *psy) {}


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

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

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

LLVM IR (-O2):
%struct.power_supply = type opaque
define void @power_supply_update_leds(%struct.power_supply* nocapture %0) {
ret void
}
int cmp(const void *x, const void *y) {
  long z = *(long *)x - *(long *)y;
  if (z < 0)
    return -1;
  if (z)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
sub    (%rcx),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jge    1135 <cmp+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <cmp+0x53>
cmpq   $0x0,-0x20(%rbp)
je     114c <cmp+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <cmp+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = icmp slt i64 %7, 0
%9 = icmp ne i64 %7, 0
%10 = zext i1 %9 to i32
%11 = select i1 %8, i32 -1, i32 %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void on_start(void *context, int len) { printf("start: %d\n", len); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"start: %d\0A\00"
define void @on_start(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"start: %d\0A\00"
define void @on_start(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void small_str(char *a_str) { printf("here's your lame string: %s\n", a_str); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"here's your lame string: %s\0A\00"
define void @small_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"here's your lame string: %s\0A\00"
define void @small_str(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int findLongest1s(int);
int /*<<< orphan*/ printf(char *, int);
main() {
  int x = 1775;
  int n;
  printf("x=0x%x\n", x);
  n = findLongest1s(x);
  printf("n=%d\n", n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x6ef,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <findLongest1s@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"x=0x%x\0A\00"
@.str.1 = [6 x i8] c"n=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1775)
%2 = tail call i32 @findLongest1s(i32 1775)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uid_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int setresuid(int, scalar_t__, int);
int seteuid(uid_t uid) {
  int result;
  if (uid == (uid_t)~0) {
    errno = (EINVAL);
    return -1;
  }
  return setresuid(-1, uid, -1);
}


x86 assembly (clang, -O0):
<seteuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    1145 <seteuid+0x35>
mov    0x2eaa(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea9(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <seteuid+0x48>
mov    -0x10(%rbp),%rsi
mov    $0xffffffff,%edx
mov    %edx,%edi
call   1030 <setresuid@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seteuid>:
cmp    $0xffffffffffffffff,%rdi
je     1128 <seteuid+0x18>
mov    %rdi,%rsi
mov    $0xffffffff,%edi
mov    $0xffffffff,%edx
jmp    1030 <setresuid@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    0x2ea8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @seteuid(i64 %0) {
%2 = icmp eq i64 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = load i32, i32* @EINVAL
store i32 %4, i32* @errno
br label %7
5: ; preds = %1
%6 = tail call i32 @setresuid(i32 -1, i64 %0, i32 -1)
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ -1, %3 ], [ %6, %5 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_();
void do0x30() { _I8080_(); }


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

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

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

LLVM IR (-O2):
define void @do0x30() {
%1 = tail call i32 (...) @_I8080_()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __emit_string_literal_range(char *, int, int, int);
void test_oct(void) { __emit_string_literal_range("01234\065 789", 4, 3, 7); }


x86 assembly (clang, -O0):
<test_oct>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
mov    $0x3,%edx
mov    $0x7,%ecx
call   1030 <__emit_string_literal_range@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_oct>:
lea    0xee9(%rip),%rdi
mov    $0x4,%esi
mov    $0x3,%edx
mov    $0x7,%ecx
jmp    1030 <__emit_string_literal_range@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"012345 789\00"
define void @test_oct() {
%1 = call i32 @__emit_string_literal_range(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 4, i32 3, i32 7)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"012345 789\00"
define void @test_oct() {
%1 = tail call i32 @__emit_string_literal_range(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 4, i32 3, i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int main() {
  int i = 0;
  while (i < 5) {
    usleep(3000);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    113f <main+0x2f>
mov    $0xbb8,%edi
call   1030 <usleep@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xbb8,%edi
call   1030 <usleep@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = call i32 @usleep(i32 3000)
br label %3
8: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @usleep(i32 3000)
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(void *, size_t, size_t, int /*<<< orphan*/ *);
size_t fread_double(void *ptr, size_t size, size_t nitems, FILE *stream) {
  return fread(ptr, size, nitems, stream);
}


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

x86 assembly (clang, -O2):
<fread_double>:
jmp    1030 <fread@plt>

LLVM IR (-O0):
define i64 @fread_double(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32*, i32** %8
%13 = call i64 @fread(i8* %9, i64 %10, i64 %11, i32* %12)
ret i64 %13
}

LLVM IR (-O2):
define i64 @fread_double(i8* nocapture %0, i64 %1, i64 %2, i32* nocapture %3) {
%5 = tail call i64 @fread(i8* %0, i64 %1, i64 %2, i32* %3)
ret i64 %5
}
void EncryptPasswdWithSalt(char *gcPasswd, char *cSalt) {
  char cPasswd[100] = {""};
  char *cp;
  sprintf(cPasswd, "%.99s", gcPasswd);
  cp = crypt(cPasswd, cSalt);
  sprintf(gcPasswd, "%.99s", cp);
}


x86 assembly (clang, -O0):
<EncryptPasswdWithSalt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
lea    -0x80(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe9e(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <crypt@plt>
cltq
mov    %rax,-0x88(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x88(%rbp),%rdx
lea    0xe6d(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EncryptPasswdWithSalt>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
lea    0xea0(%rip),%r15
mov    %rsp,%r12
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <crypt@plt>
movslq %eax,%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <sprintf@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.99s\00"
define void @EncryptPasswdWithSalt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [100 x i8]
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = bitcast [100 x i8]* %5 to i8*
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%9 = load i8*, i8** %3
%10 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%12 = load i8*, i8** %4
%13 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @crypt to i32 (i8*, i8*, ...)*)(i8* %11, i8* %12)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %6
%16 = load i8*, i8** %3
%17 = load i8*, i8** %6
%18 = call i32 (i8*, i8*, ...) @sprintf(i8* %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %17)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.99s\00"
define void @EncryptPasswdWithSalt(i8* %0, i8* %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @crypt to i32 (i8*, i8*, ...)*)(i8* %4, i8* %1)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xx(int, int, char **, char *, int, int, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/);
void x2(int line_no, int n, char *ps[], char *s, int from, int to) {
  xx(line_no, n, ps, s, from, to, 0, 0, 0);
}


x86 assembly (clang, -O0):
<x2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
call   1030 <xx@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x2>:
push   %rax
sub    $0x8,%rsp
push   $0x0
push   $0x0
push   $0x0
call   1030 <xx@plt>
add    $0x20,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @x2(i32 %0, i32 %1, i8** %2, i8* %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8**
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i8** %2, i8*** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i8**, i8*** %9
%16 = load i8*, i8** %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = call i32 @xx(i32 %13, i32 %14, i8** %15, i8* %16, i32 %17, i32 %18, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @x2(i32 %0, i32 %1, i8** %2, i8* %3, i32 %4, i32 %5) {
%7 = tail call i32 @xx(i32 %0, i32 %1, i8** %2, i8* %3, i32 %4, i32 %5, i32 0, i32 0, i32 0)
ret void
}
/* Type definitions */
struct type_def_cell {
  int dummy;
};
struct inter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void type_def_cell_destruct_val(struct type_def_cell *self, void *val,
                                struct inter *inter) {
  assert(0);
}


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

x86 assembly (clang, -O2):
<type_def_cell_destruct_val>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
%struct.type_def_cell = type { i32 }
%struct.inter = type { i32 }
define void @type_def_cell_destruct_val(%struct.type_def_cell* %0, i8* %1, %struct.inter* %2) {
%4 = alloca %struct.type_def_cell*
%5 = alloca i8*
%6 = alloca %struct.inter*
store %struct.type_def_cell* %0, %struct.type_def_cell** %4
store i8* %1, i8** %5
store %struct.inter* %2, %struct.inter** %6
%7 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
%struct.type_def_cell = type { i32 }
%struct.inter = type { i32 }
define void @type_def_cell_destruct_val(%struct.type_def_cell* nocapture readnone %0, i8* nocapture readnone %1, %struct.inter* nocapture readnone %2) {
%4 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
int countBinary(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Input an integer:");
  scanf("%d", &n);
  printf("The binary form of number %d has %d digits.\n", n, countBinary(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <countBinary@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1040 <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
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1030 <countBinary@plt>
lea    0xeaf(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Input an integer:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [45 x i8] c"The binary form of number %d has %d digits.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @countBinary(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Input an integer:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [45 x i8] c"The binary form of number %d has %d digits.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @countBinary(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
int generic_phy_power_off(struct phy *phy) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.phy = type opaque
define i32 @generic_phy_power_off(%struct.phy* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
unsigned char *cbor_write_type_size(unsigned char *, unsigned int, int,
                                    unsigned int);
unsigned char *cbor_write_nint(unsigned char *data, unsigned int size,
                               unsigned int value) {
  return cbor_write_type_size(data, size, 1, value);
}


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

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

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

LLVM IR (-O2):
define i8* @cbor_write_nint(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @cbor_write_type_size(i8* %0, i32 %1, i32 1, i32 %2)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ leds_init(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void LedHardware_Init() {
  int32_t ledValue;
  ledValue = leds_init(false);
  printf("%ld\n", ledValue);
}


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

x86 assembly (clang, -O2):
<LedHardware_Init>:
push   %rax
xor    %edi,%edi
call   1040 <leds_init@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define void @LedHardware_Init() {
%1 = tail call i32 @leds_init(i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void os_readData(int signum) {}


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

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

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

LLVM IR (-O2):
define void @os_readData(i32 %0) {
ret void
}
vdpixi() {}


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

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

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

LLVM IR (-O2):
define i32 @vdpixi() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int time_seed() {
  srand(time(NULL));
  return 0;
}


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

x86 assembly (clang, -O2):
<time_seed>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @time_seed() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret i32 0
}

LLVM IR (-O2):
define i32 @time_seed() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret i32 0
}
/* Variables and functions */
int add(char *);
bool add_test_bigger_than_thousand() {
  if (add("466,913,1009,0,1") == 1389)
    return true;
  return false;
}


x86 assembly (clang, -O0):
<add_test_bigger_than_thousand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <add@plt>
cmp    $0x56d,%eax
jne    113b <add_test_bigger_than_thousand+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <add_test_bigger_than_thousand+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"466,913,1009,0,1\00"
define i32 @add_test_bigger_than_thousand() {
%1 = alloca i32
%2 = call i32 @add(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 1389
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [17 x i8] c"466,913,1009,0,1\00"
define i32 @add_test_bigger_than_thousand() {
%1 = tail call i32 @add(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 1389
%3 = zext i1 %2 to i32
ret i32 %3
}
void pre_task() {}


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

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

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

LLVM IR (-O2):
define void @pre_task() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
uint32_t s32_to_u32(int32_t v) { return *((uint32_t *)&v); }


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

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

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

LLVM IR (-O2):
define i32 @s32_to_u32(i32 returned %0) {
ret i32 %0
}
int xmlUCSIsVariationSelectors(int code) {
  return (((code >= 0xFE00) && (code <= 0xFE0F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsVariationSelectors>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xfe00,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsVariationSelectors+0x26>
cmpl   $0xfe0f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsVariationSelectors>:
and    $0xfffffff0,%edi
xor    %eax,%eax
cmp    $0xfe00,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @xmlUCSIsVariationSelectors(i32 %0) {
%2 = and i32 %0, -16
%3 = icmp eq i32 %2, 65024
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct cirTreeFile {
  int dummy;
};

/* Variables and functions */
struct cirTreeFile *cirTreeFileAttach(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ cloneString(char *);
int /*<<< orphan*/ udcDefaultDir();
int /*<<< orphan*/ udcFileOpen(char *, int /*<<< orphan*/);
struct cirTreeFile *cirTreeFileOpen(char *fileName) {
  return cirTreeFileAttach(cloneString(fileName),
                           udcFileOpen(fileName, udcDefaultDir()));
}


x86 assembly (clang, -O0):
<cirTreeFileOpen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <cloneString@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <udcDefaultDir@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1050 <udcFileOpen@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1030 <cirTreeFileAttach@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cirTreeFileOpen>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <cloneString@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <udcDefaultDir@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <udcFileOpen@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <cirTreeFileAttach@plt>

LLVM IR (-O0):
%struct.cirTreeFile = type { i32 }
define %struct.cirTreeFile* @cirTreeFileOpen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @cloneString(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 (...) @udcDefaultDir()
%7 = call i32 @udcFileOpen(i8* %5, i32 %6)
%8 = call %struct.cirTreeFile* @cirTreeFileAttach(i32 %4, i32 %7)
ret %struct.cirTreeFile* %8
}

LLVM IR (-O2):
%struct.cirTreeFile = type { i32 }
define %struct.cirTreeFile* @cirTreeFileOpen(i8* %0) {
%2 = tail call i32 @cloneString(i8* %0)
%3 = tail call i32 (...) @udcDefaultDir()
%4 = tail call i32 @udcFileOpen(i8* %0, i32 %3)
%5 = tail call %struct.cirTreeFile* @cirTreeFileAttach(i32 %2, i32 %4)
ret %struct.cirTreeFile* %5
}
/* Variables and functions */
int /*<<< orphan*/ memset(float *, int /*<<< orphan*/, int);
void genZeroMatrix(float matrix[16]) { memset(matrix, 0, 16 * sizeof(float)); }


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

x86 assembly (clang, -O2):
<genZeroMatrix>:
xor    %esi,%esi
mov    $0x40,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @genZeroMatrix(float* %0) {
%2 = tail call i32 @memset(float* %0, i32 0, i32 64)
ret void
}
unsigned int f1(unsigned int a) { return (8 - (a & 7)) & 7; }


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

x86 assembly (clang, -O2):
<f1>:
mov    %edi,%eax
neg    %eax
and    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = sub i32 0, %0
%3 = and i32 %2, 7
ret i32 %3
}
int getEndian() {
  int i = 1;
  char *p = (char *)&i;
  if (p[0] == 1)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<getEndian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
jne    112f <getEndian+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1136 <getEndian+0x36>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void Mark_Frame_Number(FILE *Report, int FrameNum) {
  fprintf(Report, "\nFN: %04d\n", FrameNum);
}


x86 assembly (clang, -O0):
<Mark_Frame_Number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mark_Frame_Number>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\0AFN: %04d\0A\00"
define void @Mark_Frame_Number(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 @fprintf(i32* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\0AFN: %04d\0A\00"
define void @Mark_Frame_Number(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int checkcmp();
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ unlink(char *);
int checktime() {
  int rc;
  unlink("tools/.chk");
  system("gcc tools/chktime.c -o tools/chktime"
         " 2>tools/.chk ");
  return checkcmp();
}


x86 assembly (clang, -O0):
<checktime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <unlink@plt>
lea    0xec0(%rip),%rdi
call   1050 <system@plt>
mov    $0x0,%al
call   1040 <checkcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checktime>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <unlink@plt>
lea    0xec7(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <checkcmp@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"tools/.chk\00"
@.str.1 = [51 x i8] c"gcc tools/chktime.c -o tools/chktime 2>tools/.chk \00"
define i32 @checktime() {
%1 = alloca i32
%2 = call i32 @unlink(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @checkcmp()
ret i32 %4
}

LLVM IR (-O2):
@.str = [11 x i8] c"tools/.chk\00"
@.str.1 = [51 x i8] c"gcc tools/chktime.c -o tools/chktime 2>tools/.chk \00"
define i32 @checktime() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @checkcmp()
ret i32 %3
}
/* Variables and functions */
void ui_move_pointer(int x, int y) {}


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

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

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

LLVM IR (-O2):
define void @ui_move_pointer(i32 %0, i32 %1) {
ret void
}
float egLerp(float a, float b, float t) { return a + t * (b - a); }


x86 assembly (clang, -O0):
<egLerp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<egLerp>:
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @egLerp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = load float, float* %5
%10 = load float, float* %4
%11 = fsub float %9, %10
%12 = call float @llvm.fmuladd.f32(float %8, float %11, float %7)
ret float %12
}

LLVM IR (-O2):
define float @egLerp(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = tail call float @llvm.fmuladd.f32(float %2, float %4, float %0)
ret float %5
}