xunge/DecIR huggingface dataset:
/* Variables and functions */
bool target_card(char c) {
  switch (c) {
  case '1':
  case '3':
  case '5':
  case '6':
    return true;
  default:
    return false;
  }
}


x86 assembly (clang, -O0):
<target_card>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x31,%eax
je     1144 <target_card+0x44>
jmp    111f <target_card+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x33,%eax
je     1144 <target_card+0x44>
jmp    1130 <target_card+0x30>
mov    -0xc(%rbp),%eax
add    $0xffffffcb,%eax
sub    $0x1,%eax
ja     1150 <target_card+0x50>
jmp    1144 <target_card+0x44>
movl   $0x1,-0x4(%rbp)
jmp    1157 <target_card+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<target_card>:
add    $0xffffffcf,%edi
xor    %eax,%eax
cmp    $0x5,%edi
ja     1117 <target_card+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @target_card(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 49, label %6
i32 51, label %6
i32 53, label %6
i32 54, label %6
]
6: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@switch.table.target_card = [6 x i32] [i32 1, i32 0, i32 1, i32 0, i32 1, i32 1]
define i32 @target_card(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -49
%4 = icmp ult i32 %3, 6
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.target_card, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ 0, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ Wreg(int);
int /*<<< orphan*/ Ws(char *);
int /*<<< orphan*/ Wx(int, int);
int Winst6(int i, int code) {
  Ws("ori   ");
  Wreg(((code >> 4) & 0xF) + 16);
  Ws(", $");
  Wx(((code >> 4) & 0xF0) | (code & 0x0F), 1);
  return 0;
}


x86 assembly (clang, -O0):
<Winst6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xebb(%rip),%rdi
call   1030 <Ws@plt>
mov    -0x8(%rbp),%edi
sar    $0x4,%edi
and    $0xf,%edi
add    $0x10,%edi
call   1050 <Wreg@plt>
lea    0xea5(%rip),%rdi
call   1030 <Ws@plt>
mov    -0x8(%rbp),%edi
sar    $0x4,%edi
and    $0xf0,%edi
mov    -0x8(%rbp),%eax
and    $0xf,%eax
or     %eax,%edi
mov    $0x1,%esi
call   1040 <Wx@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Winst6>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
lea    0xec4(%rip),%rdi
call   1030 <Ws@plt>
mov    %ebx,%ebp
sar    $0x4,%ebp
mov    %ebp,%edi
and    $0xf,%edi
or     $0x10,%edi
call   1050 <Wreg@plt>
lea    0xead(%rip),%rdi
call   1030 <Ws@plt>
and    $0xf0,%ebp
and    $0xf,%ebx
or     %ebp,%ebx
mov    %ebx,%edi
mov    $0x1,%esi
call   1040 <Wx@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"ori \00"
@.str.1 = [4 x i8] c", $\00"
define i32 @Winst6(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @Ws(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %4
%7 = ashr i32 %6, 4
%8 = and i32 %7, 15
%9 = add nsw i32 %8, 16
%10 = call i32 @Wreg(i32 %9)
%11 = call i32 @Ws(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* %4
%13 = ashr i32 %12, 4
%14 = and i32 %13, 240
%15 = load i32, i32* %4
%16 = and i32 %15, 15
%17 = or i32 %14, %16
%18 = call i32 @Wx(i32 %17, i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"ori \00"
@.str.1 = [4 x i8] c", $\00"
define i32 @Winst6(i32 %0, i32 %1) {
%3 = tail call i32 @Ws(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = ashr i32 %1, 4
%5 = and i32 %4, 15
%6 = or i32 %5, 16
%7 = tail call i32 @Wreg(i32 %6)
%8 = tail call i32 @Ws(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = and i32 %4, 240
%10 = and i32 %1, 15
%11 = or i32 %9, %10
%12 = tail call i32 @Wx(i32 %11, i32 1)
ret i32 0
}
unsigned int rtcSetPeriodicEvent(const unsigned int mask) {
  (*((volatile unsigned int *const)(0x40010a00 + 0x10))) = mask;
  enableInterrupt(1, 65);
  return 0;
}


x86 assembly (clang, -O0):
<rtcSetPeriodicEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x40010a10,%eax
mov    %ecx,(%rax)
mov    $0x1,%edi
mov    $0x41,%esi
mov    $0x0,%al
call   1030 <enableInterrupt@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtcSetPeriodicEvent>:
push   %rax
mov    %edi,0x40010a10
mov    $0x1,%edi
mov    $0x41,%esi
xor    %eax,%eax
call   1030 <enableInterrupt@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rtcSetPeriodicEvent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 1073809936 to i32*)
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @enableInterrupt to i32 (i32, i32, ...)*)(i32 1, i32 65)
ret i32 0
}

LLVM IR (-O2):
define i32 @rtcSetPeriodicEvent(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 1073809936 to i32*)
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @enableInterrupt to i32 (i32, i32, ...)*)(i32 1, i32 65)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, float *);
int inf() {
  union {
    char c[4];
    float f;
  } z;
  scanf("%f", &z.f);
  return z.f;
}


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

x86 assembly (clang, -O2):
<inf>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rsp,%rsi
call   1030 <scanf@plt>
cvttss2si (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%union.anon = type { float }
@.str = [3 x i8] c"%f\00"
define i32 @inf() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to float*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%4 = bitcast %union.anon* %1 to float*
%5 = load float, float* %4
%6 = fptosi float %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%union.anon = type { float }
@.str = [3 x i8] c"%f\00"
define i32 @inf() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i8*
%3 = getelementptr inbounds %union.anon, %union.anon* %1, i64 0, i32 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%5 = load float, float* %3
%6 = fptosi float %5 to i32
ret i32 %6
}
int duplicate_func(void) { return 4; }


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

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

LLVM IR (-O0):
define i32 @duplicate_func() {
ret i32 4
}

LLVM IR (-O2):
define i32 @duplicate_func() {
ret i32 4
}
int test_imm_BBint64_lowword_mem(long long *val) {
  return ((*val) & (0xBB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BBint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 187
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_BBint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 187
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int block4x4_etc1_get_mode(const unsigned char *bitstring) {
  if ((bitstring[3] & 2) == 0)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<block4x4_etc1_get_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
jne    1128 <block4x4_etc1_get_mode+0x28>
movl   $0x0,-0x4(%rbp)
jmp    112f <block4x4_etc1_get_mode+0x2f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<block4x4_etc1_get_mode>:
movzbl 0x3(%rdi),%eax
shr    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @block4x4_etc1_get_mode(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = lshr i8 %3, 1
%5 = and i8 %4, 1
%6 = zext i8 %5 to i32
ret i32 %6
}
int qlz_get_setting(int setting) {
  switch (setting) {
  case 0:
    return 0;
  case 1:
    return (1 + 1) * 4096 * sizeof(unsigned char *) + 960000 + 16;
  case 2:
    return 4096 * sizeof(unsigned char *) + 16 + 960000;
  case 3:
    return 960000;
  case 4:
    return 1;
  case 5:
    return 1;
  case 6:
    return 0;
  case 7:
    return 1;
  case 8:
    return 3;
  case 9:
    return 1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<qlz_get_setting>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x9,%rax
ja     11a4 <qlz_get_setting+0xa4>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    11ab <qlz_get_setting+0xab>
movl   $0xfa610,-0x4(%rbp)
jmp    11ab <qlz_get_setting+0xab>
movl   $0xf2610,-0x4(%rbp)
jmp    11ab <qlz_get_setting+0xab>
movl   $0xea600,-0x4(%rbp)
jmp    11ab <qlz_get_setting+0xab>
movl   $0x1,-0x4(%rbp)
jmp    11ab <qlz_get_setting+0xab>
movl   $0x1,-0x4(%rbp)
jmp    11ab <qlz_get_setting+0xab>
movl   $0x0,-0x4(%rbp)
jmp    11ab <qlz_get_setting+0xab>
movl   $0x1,-0x4(%rbp)
jmp    11ab <qlz_get_setting+0xab>
movl   $0x3,-0x4(%rbp)
jmp    11ab <qlz_get_setting+0xab>
movl   $0x1,-0x4(%rbp)
jmp    11ab <qlz_get_setting+0xab>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qlz_get_setting>:
mov    $0xffffffff,%eax
cmp    $0x9,%edi
ja     1117 <qlz_get_setting+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @qlz_get_setting(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %15 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 6, label %11
i32 7, label %12
i32 8, label %13
i32 9, label %14
]
5: ; preds = %1
store i32 0, i32* %2
br label %16
6: ; preds = %1
store i32 1025552, i32* %2
br label %16
7: ; preds = %1
store i32 992784, i32* %2
br label %16
8: ; preds = %1
store i32 960000, i32* %2
br label %16
9: ; preds = %1
store i32 1, i32* %2
br label %16
10: ; preds = %1
store i32 1, i32* %2
br label %16
11: ; preds = %1
store i32 0, i32* %2
br label %16
12: ; preds = %1
store i32 1, i32* %2
br label %16
13: ; preds = %1
store i32 3, i32* %2
br label %16
14: ; preds = %1
store i32 1, i32* %2
br label %16
15: ; preds = %1
store i32 -1, i32* %2
br label %16
16: ; preds = %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@switch.table.qlz_get_setting = [10 x i32] [i32 0, i32 1025552, i32 992784, i32 960000, i32 1, i32 1, i32 0, i32 1, i32 3, i32 1]
define i32 @qlz_get_setting(i32 %0) {
%2 = icmp ult i32 %0, 10
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [10 x i32], [10 x i32]* @switch.table.qlz_get_setting, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ -1, %1 ]
ret i32 %8
}
int weather_get_int_temp() { return -4; }


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

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

LLVM IR (-O0):
define i32 @weather_get_int_temp() {
ret i32 -4
}

LLVM IR (-O2):
define i32 @weather_get_int_temp() {
ret i32 -4
}
/* Variables and functions */
int /*<<< orphan*/ Memory_Print_Summary();
void Memory_Print() { Memory_Print_Summary(); }


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

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

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

LLVM IR (-O2):
define void @Memory_Print() {
%1 = tail call i32 (...) @Memory_Print_Summary()
ret void
}
/* Variables and functions */
double pow(unsigned int, double);
double power_fun(void *x, unsigned count, void *data) {
  return pow(count, *((double *)data));
}


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

x86 assembly (clang, -O2):
<power_fun>:
mov    %esi,%edi
movsd  (%rdx),%xmm0
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define double @power_fun(i8* nocapture readnone %0, i32 %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to double*
%5 = load double, double* %4
%6 = tail call double @pow(i32 %1, double %5)
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ _unsupported();
int pthread_join(pthread_t thread, void **return_val) {
  _unsupported();
  return -1;
}


x86 assembly (clang, -O0):
<pthread_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <_unsupported@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_join>:
push   %rax
xor    %eax,%eax
call   1030 <_unsupported@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @pthread_join(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @_unsupported()
ret i32 -1
}
int fun138() { return 138; }


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

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

LLVM IR (-O0):
define i32 @fun138() {
ret i32 138
}

LLVM IR (-O2):
define i32 @fun138() {
ret i32 138
}
/* Type definitions */
struct cec_msg {
  int len;
  int /*<<< orphan*/ *msg;
};
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
int /*<<< orphan*/ CEC_MSG_PLAY;
void cec_msg_play(struct cec_msg *msg, __u8 play_mode) {
  msg->len = 3;
  msg->msg[1] = CEC_MSG_PLAY;
  msg->msg[2] = play_mode;
}


x86 assembly (clang, -O0):
<cec_msg_play>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x3,(%rax)
mov    0x2ecc(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_msg_play>:
movl   $0x3,(%rdi)
mov    0x2edb(%rip),%rax
mov    (%rax),%eax
mov    0x8(%rdi),%rcx
mov    %eax,0x4(%rcx)
mov    %esi,0x8(%rcx)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_PLAY = global i32 0
define void @cec_msg_play(%struct.cec_msg* %0, i32 %1) {
%3 = alloca %struct.cec_msg*
%4 = alloca i32
store %struct.cec_msg* %0, %struct.cec_msg** %3
store i32 %1, i32* %4
%5 = load %struct.cec_msg*, %struct.cec_msg** %3
%6 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %5, i32 0, i32 0
store i32 3, i32* %6
%7 = load i32, i32* @CEC_MSG_PLAY
%8 = load %struct.cec_msg*, %struct.cec_msg** %3
%9 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %8, i32 0, i32 1
%10 = load i32*, i32** %9
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %7, i32* %11
%12 = load i32, i32* %4
%13 = load %struct.cec_msg*, %struct.cec_msg** %3
%14 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %13, i32 0, i32 1
%15 = load i32*, i32** %14
%16 = getelementptr inbounds i32, i32* %15, i64 2
store i32 %12, i32* %16
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_PLAY = global i32 0
define void @cec_msg_play(%struct.cec_msg* nocapture %0, i32 %1) {
%3 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
store i32 3, i32* %3
%4 = load i32, i32* @CEC_MSG_PLAY
%5 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 1
%6 = load i32*, i32** %5
%7 = getelementptr inbounds i32, i32* %6, i64 1
store i32 %4, i32* %7
%8 = getelementptr inbounds i32, i32* %6, i64 2
store i32 %1, i32* %8
ret void
}
void gtk_submenu_placement_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_submenu_placement_get_type() {
ret void
}
_Bool test2(int c, int d) { return c ? d : 1; }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111f <test2+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112c <test2+0x2c>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <test2+0x2c>
mov    -0xc(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
test   %edi,%edi
sete   %cl
test   %esi,%esi
setne  %al
or     %cl,%al
ret

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

LLVM IR (-O2):
define zeroext i1 @test2(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp ne i32 %1, 0
%5 = or i1 %3, %4
ret i1 %5
}
int ti_abs_start(double const *options) {
  (void)options;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ti_abs_start(double* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int strtol(char const *, char **, int);
int capture_int_pedantic(const char *carg, void *pvar) {
  int *pi = pvar;
  char *end;
  *pi = strtol(carg, &end, 10);
  return end != carg && !*end ? 0 : 1;
}


x86 assembly (clang, -O0):
<capture_int_pedantic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
cmp    -0x8(%rbp),%rcx
mov    %al,-0x21(%rbp)
je     1164 <capture_int_pedantic+0x54>
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%dl
mov    $0x1,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture_int_pedantic>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,(%r14)
mov    (%rsp),%rcx
cmp    %rbx,%rcx
je     113d <capture_int_pedantic+0x2d>
xor    %eax,%eax
cmpb   $0x0,(%rcx)
setne  %al
jmp    1142 <capture_int_pedantic+0x32>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @capture_int_pedantic(i8* %0, i8* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8* %1 to i32*
%5 = bitcast i8** %3 to i8*
%6 = call i32 @strtol(i8* %0, i8** %3, i32 10)
store i32 %6, i32* %4
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, %0
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load i8, i8* %7
%11 = icmp ne i8 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %2
%14 = phi i32 [ 1, %2 ], [ %12, %9 ]
ret i32 %14
}
int modulo(int x, int d) { return (x % d + d) % d; }


x86 assembly (clang, -O0):
<modulo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    -0x8(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo>:
mov    %edi,%eax
cltd
idiv   %esi
lea    (%rdx,%rsi,1),%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @modulo(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 = srem i32 %5, %6
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = srem i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @modulo(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = add nsw i32 %3, %1
%5 = srem i32 %4, %1
ret i32 %5
}
unsigned char count_minus(char *minterm) {
  unsigned char counter = 0;
  while (*minterm)
    if (*minterm++ == '-')
      counter++;
  return counter;
}


x86 assembly (clang, -O0):
<count_minus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <count_minus+0x41>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    113c <count_minus+0x3c>
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
jmp    110c <count_minus+0xc>
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_minus>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <count_minus+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
cmp    $0x2d,%cl
sete   %cl
add    %cl,%al
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <count_minus+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @count_minus(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = icmp eq i8 %5, 45
%10 = zext i1 %9 to i8
%11 = add i8 %6, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i8 [ 0, %1 ], [ %11, %4 ]
ret i8 %15
}
/* Variables and functions */
int /*<<< orphan*/ platform_inb(unsigned long);
void __insb(unsigned long port, void *dst, unsigned long count) {
  unsigned char *dp = dst;
  while (count--)
    *dp++ = platform_inb(port);
}


x86 assembly (clang, -O0):
<__insb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     1166 <__insb+0x56>
mov    -0x8(%rbp),%rdi
call   1030 <platform_inb@plt>
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    112c <__insb+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__insb>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
je     1145 <__insb+0x35>
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1030 <platform_inb@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <__insb+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @__insb(i64 %0, i8* nocapture writeonly %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %13, label %5
5: ; preds = %3, %5
%6 = phi i8* [ %11, %5 ], [ %1, %3 ]
%7 = phi i64 [ %8, %5 ], [ %2, %3 ]
%8 = add i64 %7, -1
%9 = tail call i32 @platform_inb(i64 %0)
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %10, i8* %6
%12 = icmp eq i64 %8, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, unsigned char const *, int);
void GLUE_POP_PX(void *b, int wv) {
  static const unsigned char tab[3][2] = {
      {0x58, 0x58},
      {0x5F, 0x5F},
      {0x59, 0x59},
  };
  memcpy(b, tab[wv], 2);
}


x86 assembly (clang, -O0):
<GLUE_POP_PX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
lea    0xed2(%rip),%rsi
shl    $0x1,%rax
add    %rax,%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLUE_POP_PX>:
movslq %esi,%rax
lea    0xee6(%rip),%rcx
lea    (%rcx,%rax,2),%rsi
mov    $0x2,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
@GLUE_POP_PX.tab = internal constant [3 x [2 x i8]] [[2 x i8] c"XX", [2 x i8] c"__", [2 x i8] c"YY"]
define void @GLUE_POP_PX(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 = sext i32 %6 to i64
%8 = getelementptr inbounds [3 x [2 x i8]], [3 x [2 x i8]]* @GLUE_POP_PX.tab, i64 0, i64 %7
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%10 = call i32 @memcpy(i8* %5, i8* %9, i32 2)
ret void
}

LLVM IR (-O2):
@GLUE_POP_PX.tab = internal constant [3 x [2 x i8]] [[2 x i8] c"XX", [2 x i8] c"__", [2 x i8] c"YY"]
define void @GLUE_POP_PX(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [3 x [2 x i8]], [3 x [2 x i8]]* @GLUE_POP_PX.tab, i64 0, i64 %3, i64 0
%5 = tail call i32 @memcpy(i8* %0, i8* %4, i32 2)
ret void
}
int ssds_set_field_len(int pcfd, char *class_def, int len) { return -1; }


x86 assembly (clang, -O0):
<ssds_set_field_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ssds_set_field_len(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 -1
}
int wpa_ft_is_completed(struct wpa_sm *sm) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.wpa_sm = type opaque
define i32 @wpa_ft_is_completed(%struct.wpa_sm* nocapture readnone %0) {
ret i32 0
}
char _add(char a, char b) {
  int n_a = a - ('1' - 1);
  int n_b = b - ('1' - 1);
  n_a = (n_a + n_b) % 10;
  return (n_a + ('1' - 1));
}


x86 assembly (clang, -O0):
<_add>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x30,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_add>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffa0,%eax
movswl %ax,%ecx
imul   $0x6667,%ecx,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x12,%ecx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    $0x30,%al
ret

LLVM IR (-O0):
define signext i8 @_add(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 48
store i32 %9, i32* %5
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %11, 48
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
%16 = srem i32 %15, 10
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 48
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @_add(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i16
%4 = sext i8 %1 to i16
%5 = add nsw i16 %3, -96
%6 = add nsw i16 %5, %4
%7 = srem i16 %6, 10
%8 = trunc i16 %7 to i8
%9 = add nsw i8 %8, 48
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_done(int ring_width_p) {
  printf("#### DONE ####\n");
  printf("0011_");
  for (int i = 0; i < ring_width_p; i++) {
    printf("0");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_done>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1160 <print_done+0x50>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <print_done+0x2a>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_done>:
push   %rbx
mov    %edi,%ebx
lea    0xecc(%rip),%rdi
call   1040 <puts@plt>
lea    0xeba(%rip),%rdi
call   1050 <printf@plt>
test   %ebx,%ebx
jle    115f <print_done+0x2f>
nop
mov    $0x30,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1150 <print_done+0x20>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str.1 = [6 x i8] c"0011_\00"
@str = [15 x i8] c"#### DONE ####\00"
define void @print_done(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp sgt i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %7, %1
%6 = tail call i32 @putchar(i32 10)
ret void
7: ; preds = %1, %7
%8 = phi i32 [ %10, %7 ], [ 0, %1 ]
%9 = tail call i32 @putchar(i32 48)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %5, label %7
}
/* Variables and functions */
int get_colon_index(const char *string, size_t start, size_t end) {
  size_t i;
  for (i = start; i <= end; i++) {
    if (string[i] == ':') {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<get_colon_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
ja     115d <get_colon_index+0x5d>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jne    1147 <get_colon_index+0x47>
mov    -0x28(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1164 <get_colon_index+0x64>
jmp    114c <get_colon_index+0x4c>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1118 <get_colon_index+0x18>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_colon_index>:
mov    $0xffffffff,%eax
cmp    %rdx,%rsi
ja     111f <get_colon_index+0x1f>
nopw   0x0(%rax,%rax,1)
cmpb   $0x3a,(%rdi,%rsi,1)
je     1120 <get_colon_index+0x20>
add    $0x1,%rsi
cmp    %rdx,%rsi
jbe    1110 <get_colon_index+0x10>
ret
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @get_colon_index(i8* nocapture %0, i64 %1, i64 %2) {
%4 = icmp ugt i64 %1, %2
br i1 %4, label %15, label %5
5: ; preds = %3, %12
%6 = phi i64 [ %13, %12 ], [ %1, %3 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 58
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = trunc i64 %6 to i32
br label %15
12: ; preds = %5
%13 = add i64 %6, 1
%14 = icmp ugt i64 %13, %2
br i1 %14, label %15, label %5
15: ; preds = %12, %3, %10
%16 = phi i32 [ %11, %10 ], [ -1, %3 ], [ -1, %12 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ discard(int, size_t, size_t);
int /*<<< orphan*/ writeout(int, size_t, size_t);
void swapwindow(int fd, size_t idx, size_t window) {
  writeout(fd, window * idx, window);
  if (idx) {
    discard(fd, window * (idx - 1), window);
  }
}


x86 assembly (clang, -O0):
<swapwindow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
imul   -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <writeout@plt>
cmpq   $0x0,-0x10(%rbp)
je     116f <swapwindow+0x4f>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
imul   %rax,%rsi
mov    -0x18(%rbp),%rdx
call   1040 <discard@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapwindow>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rdx,%rsi
imul   %rbx,%rsi
call   1030 <writeout@plt>
test   %rbx,%rbx
je     1156 <swapwindow+0x36>
add    $0xffffffffffffffff,%rbx
imul   %r14,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <discard@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @swapwindow(i32 %0, i64 %1, i64 %2) {
%4 = mul i64 %2, %1
%5 = tail call i32 @writeout(i32 %0, i64 %4, i64 %2)
%6 = icmp eq i64 %1, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = add i64 %1, -1
%9 = mul i64 %8, %2
%10 = tail call i32 @discard(i32 %0, i64 %9, i64 %2)
br label %11
11: ; preds = %7, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int hd_psupp(FILE *f) {
  static int count = 0;
  if (!count++)
    printf("%s %s\n", "No header has been defined for the",
           "part supplier table");
  return (0);
}


x86 assembly (clang, -O0):
<hd_psupp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2f0a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2eff(%rip)
cmp    $0x0,%eax
jne    1150 <hd_psupp+0x40>
lea    0xec3(%rip),%rdi
lea    0xec3(%rip),%rsi
lea    0xedf(%rip),%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hd_psupp>:
push   %rax
mov    0x2f15(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f0c(%rip)
test   %eax,%eax
jne    113e <hd_psupp+0x2e>
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
lea    0xef1(%rip),%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@hd_psupp.count = internal global i32 0
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [35 x i8] c"No header has been defined for the\00"
@.str.2 = [20 x i8] c"part supplier table\00"
define i32 @hd_psupp(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @hd_psupp.count
%4 = add nsw i32 %3, 1
store i32 %4, i32* @hd_psupp.count
%5 = icmp ne i32 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i32 0
}

LLVM IR (-O2):
@hd_psupp.count = internal unnamed_addr global i32 0
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [35 x i8] c"No header has been defined for the\00"
@.str.2 = [20 x i8] c"part supplier table\00"
define i32 @hd_psupp(i32* nocapture readnone %0) {
%2 = load i32, i32* @hd_psupp.count
%3 = add nsw i32 %2, 1
store i32 %3, i32* @hd_psupp.count
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i32 0
}
/* Variables and functions */
scalar_t__ random();
void random_fill(char *p, int size) {
  int i = 0;
  for (i = 0; i < size; i++)
    p[i] = (char)random();
}


x86 assembly (clang, -O0):
<random_fill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <random_fill+0x4b>
mov    $0x0,%al
call   1030 <random@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <random_fill+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_fill>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1144 <random_fill+0x34>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <random@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <random_fill+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @random_fill(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = tail call i64 (...) @random()
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %9, i8* %10
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGSTOP;
int /*<<< orphan*/ pause();
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
void test_child(void) {
  sleep(1);
  raise(SIGSTOP);
  while (1)
    pause();
}


x86 assembly (clang, -O0):
<test_child>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
mov    $0x0,%al
call   1040 <pause@plt>
jmp    114c <test_child+0x1c>

x86 assembly (clang, -O2):
<test_child>:
push   %rax
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <pause@plt>
jmp    1150 <test_child+0x20>

LLVM IR (-O0):
@SIGSTOP = global i32 0
define void @test_child() {
%1 = call i32 @sleep(i32 1)
%2 = load i32, i32* @SIGSTOP
%3 = call i32 @raise(i32 %2)
br label %4
4: ; preds = %0, %4
%5 = call i32 (...) @pause()
br label %4
}

LLVM IR (-O2):
@SIGSTOP = global i32 0
define void @test_child() {
%1 = tail call i32 @sleep(i32 1)
%2 = load i32, i32* @SIGSTOP
%3 = tail call i32 @raise(i32 %2)
br label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @pause()
br label %4
}
void g_date_get_day_of_year() {}


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

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

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

LLVM IR (-O2):
define void @g_date_get_day_of_year() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(int argc, char **argv) {
  int i = 0;
  for (i = 0; i < argc; i++) {
    printf("%c\n", **argv);
    argv++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1170 <main+0x60>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
lea    0xeb2(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1148 <main+0x38>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rax
movsbl (%rax),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 0, %2 ]
%6 = phi i8** [ %10, %4 ], [ %1, %2 ]
%7 = load i8*, i8** %6
%8 = load i8, i8* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%10 = getelementptr inbounds i8*, i8** %6, i64 1
%11 = add nuw nsw i32 %5, 1
%12 = icmp eq i32 %11, %0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret i32 0
}