xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ getBits(int, int, unsigned int);
unsigned char getByteNumber(int byteNo, unsigned int source) {
  if (byteNo < 0 || byteNo > 3) {
    return 0;
  }
  int low = 8 * byteNo;
  int high = low + (8 - 1);
  char character = (char)getBits(low, high, source);
  return character;
}


x86 assembly (clang, -O0):
<getByteNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1132 <getByteNumber+0x22>
cmpl   $0x3,-0x8(%rbp)
jle    113b <getByteNumber+0x2b>
movb   $0x0,-0x1(%rbp)
jmp    1164 <getByteNumber+0x54>
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <getBits@plt>
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getByteNumber>:
cmp    $0x3,%edi
jbe    1118 <getByteNumber+0x8>
xor    %eax,%eax
ret
push   %rax
mov    %esi,%edx
mov    %edi,%eax
shl    $0x3,%eax
lea    0x7(,%rdi,8),%esi
mov    %eax,%edi
call   1030 <getBits@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define zeroext i8 @getByteNumber(i32 %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp sgt i32 %12, 3
br i1 %13, label %14, label %15
14: ; preds = %11, %2
store i8 0, i8* %3
br label %26
15: ; preds = %11
%16 = load i32, i32* %4
%17 = mul nsw i32 8, %16
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 7
store i32 %19, i32* %7
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = load i32, i32* %5
%23 = call i64 @getBits(i32 %20, i32 %21, i32 %22)
%24 = trunc i64 %23 to i8
store i8 %24, i8* %8
%25 = load i8, i8* %8
store i8 %25, i8* %3
br label %26
26: ; preds = %15, %14
%27 = load i8, i8* %3
ret i8 %27
}

LLVM IR (-O2):
define zeroext i8 @getByteNumber(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, 3
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = shl nuw nsw i32 %0, 3
%6 = or i32 %5, 7
%7 = tail call i64 @getBits(i32 %5, i32 %6, i32 %1)
%8 = trunc i64 %7 to i8
br label %9
9: ; preds = %2, %4
%10 = phi i8 [ %8, %4 ], [ 0, %2 ]
ret i8 %10
}
/* Variables and functions */
double exp(double);
double hl_math_exp(double a) { return exp(a); }


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

x86 assembly (clang, -O2):
<hl_math_exp>:
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @hl_math_exp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @exp(double %3)
ret double %4
}

LLVM IR (-O2):
define double @hl_math_exp(double %0) {
%2 = tail call double @exp(double %0)
ret double %2
}
int initialize_gesture_sensor(struct ssp_data *data) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ssp_data = type opaque
define i32 @initialize_gesture_sensor(%struct.ssp_data* nocapture readnone %0) {
ret i32 0
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=401 REPO_URL=heads/s-310-work "
         "REVISION=-28cb711 CHANGED_REVISION=28cb711 CHANGE_DATE=2014-08-12 "
         "16:32:25 -0700 BUILD_DATE=Wed Aug 13 17:04:47 PDT 2014 BUILD=debug "
         "TARGET_PLATFORM= MALI_PLATFORM= KDIR= "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= "
         "USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 "
         "USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1";
}


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

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

LLVM IR (-O0):
@.str = [400 x i8] c"malidrv: API_VERSION=401 REPO_URL=heads/s-310-work REVISION=-28cb711 CHANGED_REVISION=28cb711 CHANGE_DATE=2014-08-12 16:32:25 -0700 BUILD_DATE=Wed Aug 13 17:04:47 PDT 2014 BUILD=debug TARGET_PLATFORM= MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([400 x i8], [400 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [400 x i8] c"malidrv: API_VERSION=401 REPO_URL=heads/s-310-work REVISION=-28cb711 CHANGED_REVISION=28cb711 CHANGE_DATE=2014-08-12 16:32:25 -0700 BUILD_DATE=Wed Aug 13 17:04:47 PDT 2014 BUILD=debug TARGET_PLATFORM= MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([400 x i8], [400 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ _flush_gdt_and_refresh();
void flush_gdt() { _flush_gdt_and_refresh(); }


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

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

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

LLVM IR (-O2):
define void @flush_gdt() {
%1 = tail call i32 (...) @_flush_gdt_and_refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ln1(char);
int /*<<< orphan*/ ln2(char);
int /*<<< orphan*/ ln3(char *);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char s[16], len;
  scanf("%s", s);
  len = strlen(s) * 4 + 1;
  ln1(len);
  ln2(len);
  ln3(s);
  ln2(len);
  ln1(len);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1070 <scanf@plt>
lea    -0x20(%rbp),%rdi
call   1050 <strlen@plt>
shl    $0x2,%eax
add    $0x1,%eax
mov    %al,-0x21(%rbp)
movsbl -0x21(%rbp),%edi
call   1030 <ln1@plt>
movsbl -0x21(%rbp),%edi
call   1060 <ln2@plt>
lea    -0x20(%rbp),%rdi
call   1040 <ln3@plt>
movsbl -0x21(%rbp),%edi
call   1060 <ln2@plt>
movsbl -0x21(%rbp),%edi
call   1030 <ln1@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
lea    0xea3(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
shl    $0x2,%al
or     $0x1,%al
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <ln1@plt>
mov    %ebp,%edi
call   1060 <ln2@plt>
mov    %rbx,%rdi
call   1040 <ln3@plt>
mov    %ebp,%edi
call   1060 <ln2@plt>
mov    %ebp,%edi
call   1030 <ln1@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
%3 = alloca i8
store i32 0, i32* %1
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
%8 = mul nsw i32 %7, 4
%9 = add nsw i32 %8, 1
%10 = trunc i32 %9 to i8
store i8 %10, i8* %3
%11 = load i8, i8* %3
%12 = call i32 @ln1(i8 signext %11)
%13 = load i8, i8* %3
%14 = call i32 @ln2(i8 signext %13)
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%16 = call i32 @ln3(i8* %15)
%17 = load i8, i8* %3
%18 = call i32 @ln2(i8 signext %17)
%19 = load i8, i8* %3
%20 = call i32 @ln1(i8 signext %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = trunc i32 %4 to i8
%6 = shl i8 %5, 2
%7 = or i8 %6, 1
%8 = call i32 @ln1(i8 signext %7)
%9 = call i32 @ln2(i8 signext %7)
%10 = call i32 @ln3(i8* %2)
%11 = call i32 @ln2(i8 signext %7)
%12 = call i32 @ln1(i8 signext %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ D();
int /*<<< orphan*/ N();
int /*<<< orphan*/ printf(char *);
int NP() {
  printf("<NP>");
  D();
  N();
  printf("</NP>");
}


x86 assembly (clang, -O0):
<NP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <D@plt>
mov    $0x0,%al
call   1040 <N@plt>
lea    0xeac(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NP>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <D@plt>
xor    %eax,%eax
call   1040 <N@plt>
lea    0xeb3(%rip),%rdi
pop    %rax
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"<NP>\00"
@.str.1 = [6 x i8] c"</NP>\00"
define i32 @NP() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @D()
%4 = call i32 (...) @N()
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"<NP>\00"
@.str.1 = [6 x i8] c"</NP>\00"
define i32 @NP() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @D()
%3 = tail call i32 (...) @N()
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ ceil(size_t);
size_t EstimateBas64EncodedDataSize(size_t inDataSize) {
  size_t theEncodedDataSize = (int)ceil(inDataSize / 3.0) * 4;
  theEncodedDataSize = theEncodedDataSize / 72 * 74 + theEncodedDataSize % 72;
  return (theEncodedDataSize);
}


x86 assembly (clang, -O0):
<EstimateBas64EncodedDataSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movaps 0xedd(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xedc(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xed5(%rip),%xmm1
divsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rdi
mov    %rdi,%rcx
sar    $0x3f,%rcx
movsd  0xec2(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
and    %rcx,%rax
or     %rax,%rdi
call   1030 <ceil@plt>
shl    $0x2,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x48,%ecx
xor    %edx,%edx
div    %rcx
imul   $0x4a,%rax,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x48,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x18(%rbp),%rax
add    %rdx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EstimateBas64EncodedDataSize>:
push   %rax
movq   %rdi,%xmm0
punpckldq 0xee2(%rip),%xmm0
subpd  0xeea(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
divsd  0xee6(%rip),%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rcx
sar    $0x3f,%rcx
subsd  0xeda(%rip),%xmm1
cvttsd2si %xmm1,%rdi
and    %rcx,%rdi
or     %rax,%rdi
call   1030 <ceil@plt>
shl    $0x2,%eax
movslq %eax,%rcx
movabs $0xe38e38e38e38e38f,%rdx
38 8e e3
mov    %rcx,%rax
mul    %rdx
shr    $0x6,%rdx
imul   $0x4a,%rdx,%rax
shl    $0x3,%rdx
lea    (%rdx,%rdx,8),%rdx
sub    %rdx,%rcx
add    %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @EstimateBas64EncodedDataSize(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = uitofp i64 %4 to double
%6 = fdiv double %5, 3.000000e+00
%7 = fptoui double %6 to i64
%8 = call i64 @ceil(i64 %7)
%9 = trunc i64 %8 to i32
%10 = mul nsw i32 %9, 4
%11 = sext i32 %10 to i64
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = udiv i64 %12, 72
%14 = mul i64 %13, 74
%15 = load i64, i64* %3
%16 = urem i64 %15, 72
%17 = add i64 %14, %16
store i64 %17, i64* %3
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
define i64 @EstimateBas64EncodedDataSize(i64 %0) {
%2 = uitofp i64 %0 to double
%3 = fdiv double %2, 3.000000e+00
%4 = fptoui double %3 to i64
%5 = tail call i64 @ceil(i64 %4)
%6 = trunc i64 %5 to i32
%7 = shl nsw i32 %6, 2
%8 = sext i32 %7 to i64
%9 = udiv i64 %8, 72
%10 = mul i64 %9, 74
%11 = urem i64 %8, 72
%12 = add i64 %10, %11
ret i64 %12
}
/* Variables and functions */
int findsum(int);
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *argv[]) {
  if (argc < 2)
    return 1;
  int num, x;
  num = argv[1][0];
  x = findsum(num);
  printf("Sum of the digits of %d is: %02x\n", num, x);
  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)
cmpl   $0x2,-0x8(%rbp)
jge    114c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    117e <main+0x5e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <findsum@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     114c <main+0x2c>
push   %rbx
mov    0x8(%rsi),%rax
movsbl (%rax),%ebx
mov    %ebx,%edi
call   1030 <findsum@plt>
lea    0xec0(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [34 x i8] c"Sum of the digits of %d is: %02x\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = tail call i32 @findsum(i32 %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
br label %11
11: ; preds = %2, %4
%12 = phi i32 [ 0, %4 ], [ 1, %2 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ lsda_util_id2size(int);
int lsdaid2size(int *type) { return (int)lsda_util_id2size((int)*type); }


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

x86 assembly (clang, -O2):
<lsdaid2size>:
mov    (%rdi),%edi
jmp    1030 <lsda_util_id2size@plt>

LLVM IR (-O0):
define i32 @lsdaid2size(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i64 @lsda_util_id2size(i32 %4)
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @lsdaid2size(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i64 @lsda_util_id2size(i32 %2)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct utmp {
  int /*<<< orphan*/ ut_time;
  int /*<<< orphan*/ ut_line;
  int /*<<< orphan*/ ut_user;
};
typedef int /*<<< orphan*/ printf;

/* Variables and functions */
scalar_t__ ctime(int /*<<< orphan*/ *);
void print_entry(struct utmp *up) {
  (printf)("[%-8.8s] [%-12.12s]"
           " [%-15.15s]"
           "\n",
           up->ut_user, up->ut_line, 4 + ctime(&up->ut_time));
}


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

x86 assembly (clang, -O2):
<print_entry>:
jmp    1030 <ctime@plt>

LLVM IR (-O0):
%struct.utmp = type { i32, i32, i32 }
@.str = [32 x i8] c"[%-8.8s] [%-12.12s] [%-15.15s]\0A\00"
define void @print_entry(%struct.utmp* %0) {
%2 = alloca %struct.utmp*
store %struct.utmp* %0, %struct.utmp** %2
%3 = load %struct.utmp*, %struct.utmp** %2
%4 = getelementptr inbounds %struct.utmp, %struct.utmp* %3, i32 0, i32 2
%5 = load i32, i32* %4
%6 = load %struct.utmp*, %struct.utmp** %2
%7 = getelementptr inbounds %struct.utmp, %struct.utmp* %6, i32 0, i32 1
%8 = load i32, i32* %7
%9 = load %struct.utmp*, %struct.utmp** %2
%10 = getelementptr inbounds %struct.utmp, %struct.utmp* %9, i32 0, i32 0
%11 = call i64 @ctime(i32* %10)
%12 = add nsw i64 4, %11
%13 = trunc i64 %12 to i32
ret void
}

LLVM IR (-O2):
%struct.utmp = type { i32, i32, i32 }
define void @print_entry(%struct.utmp* %0) {
%2 = getelementptr inbounds %struct.utmp, %struct.utmp* %0, i64 0, i32 0
%3 = tail call i64 @ctime(i32* %2)
ret void
}
void f1() {
  int f1_a = 2;
  float f1_b[2];
#pragma acc data copyin(f1_a) copyout(f1_b)
  {
#pragma acc kernels
    { f1_b[0] = f1_a; }
#pragma acc parallel
    { f1_b[0] = f1_a; }
  }
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f1() {
%1 = alloca i32
%2 = alloca [2 x float]
store i32 2, i32* %1
%3 = load i32, i32* %1
%4 = sitofp i32 %3 to float
%5 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
store float %4, float* %5
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to float
%8 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
store float %7, float* %8
ret void
}

LLVM IR (-O2):
define void @f1() {
ret void
}
const char *lock_in_lock_name() { return "MUTEXEE"; }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"MUTEXEE\00"
define i8* @lock_in_lock_name() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"MUTEXEE\00"
define i8* @lock_in_lock_name() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
int sum(n) { n = 1; }


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

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

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

LLVM IR (-O2):
define i32 @sum(i32 %0) {
ret i32 undef
}
/* Type definitions */
struct plainstring {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cstr_loaddouble(char *, double);
int /*<<< orphan*/ plainstring_set(struct plainstring *, char *);
void plainstring_set_double(struct plainstring *this_string, double d) {
  char buffer[0xFF];
  cstr_loaddouble(buffer, d);
  plainstring_set(this_string, buffer);
}


x86 assembly (clang, -O0):
<plainstring_set_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
call   1040 <cstr_loaddouble@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1030 <plainstring_set@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plainstring_set_double>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <cstr_loaddouble@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <plainstring_set@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.plainstring = type { i32 }
define void @plainstring_set_double(%struct.plainstring* %0, double %1) {
%3 = alloca %struct.plainstring*
%4 = alloca double
%5 = alloca [255 x i8]
store %struct.plainstring* %0, %struct.plainstring** %3
store double %1, double* %4
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%7 = load double, double* %4
%8 = call i32 @cstr_loaddouble(i8* %6, double %7)
%9 = load %struct.plainstring*, %struct.plainstring** %3
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%11 = call i32 @plainstring_set(%struct.plainstring* %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.plainstring = type { i32 }
define void @plainstring_set_double(%struct.plainstring* %0, double %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = call i32 @cstr_loaddouble(i8* %4, double %1)
%6 = call i32 @plainstring_set(%struct.plainstring* %0, i8* %4)
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
char *complex_func(char *s) {
  printf("complex_func(%s)\n", s);
  char *buf = malloc(150);
  sprintf(buf, "%s", s);
  return buf;
}


x86 assembly (clang, -O0):
<complex_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x96,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xea9(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<complex_func>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    $0x96,%edi
call   1050 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"complex_func(%s)\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i8* @complex_func(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i8* @malloc(i32 150)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load i8*, i8** %2
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [18 x i8] c"complex_func(%s)\0A\00"
define i8* @complex_func(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call dereferenceable_or_null(150) i8* @malloc(i32 150)
%4 = tail call i8* @strcpy(i8* dereferenceable(1) %3, i8* dereferenceable(1) %0)
ret i8* %3
}
int isOdd(int var) {
  if (var % 2 == 0) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isOdd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <isOdd+0x27>
movl   $0x0,-0x4(%rbp)
jmp    112e <isOdd+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isOdd(i32 %0) {
%2 = and i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_t;

/* Variables and functions */
int /*<<< orphan*/ MPFR_RNDN;
int /*<<< orphan*/ mpfr_set_ld(int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/);
int /*<<< orphan*/ sinl(long double);
void getsin_ld(mpfr_t y, float phase) {
  mpfr_set_ld(y, sinl((long double)phase), MPFR_RNDN);
}


x86 assembly (clang, -O0):
<getsin_ld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
flds   -0x8(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <sinl@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
call   1030 <mpfr_set_ld@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsin_ld>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
movss  %xmm0,0x1c(%rsp)
flds   0x1c(%rsp)
fstpt  (%rsp)
call   1040 <sinl@plt>
mov    0x2ea8(%rip),%rcx
mov    (%rcx),%edx
mov    %ebx,%edi
mov    %eax,%esi
add    $0x20,%rsp
pop    %rbx
jmp    1030 <mpfr_set_ld@plt>

LLVM IR (-O0):
@MPFR_RNDN = global i32 0
define void @getsin_ld(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load i32, i32* %3
%6 = load float, float* %4
%7 = fpext float %6 to x86_fp80
%8 = call i32 @sinl(x86_fp80 %7)
%9 = load i32, i32* @MPFR_RNDN
%10 = call i32 @mpfr_set_ld(i32 %5, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@MPFR_RNDN = global i32 0
define void @getsin_ld(i32 %0, float %1) {
%3 = fpext float %1 to x86_fp80
%4 = tail call i32 @sinl(x86_fp80 %3)
%5 = load i32, i32* @MPFR_RNDN
%6 = tail call i32 @mpfr_set_ld(i32 %0, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
char *get_locale_charset();
char *ndb_unix_getCodepage() { return get_locale_charset(); }


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

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

LLVM IR (-O0):
define i8* @ndb_unix_getCodepage() {
%1 = call i8* (...) @get_locale_charset()
ret i8* %1
}

LLVM IR (-O2):
define i8* @ndb_unix_getCodepage() {
%1 = tail call i8* (...) @get_locale_charset()
ret i8* %1
}
/* Variables and functions */
double arc_tang(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ cos(double);
int /*<<< orphan*/ sin(double);
double ang_equiv(double theta) { return (arc_tang(sin(theta), cos(theta))); }


x86 assembly (clang, -O0):
<ang_equiv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <sin@plt>
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <cos@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1030 <arc_tang@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ang_equiv>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <sin@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1050 <cos@plt>
mov    %ebx,%edi
mov    %eax,%esi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <arc_tang@plt>

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

LLVM IR (-O2):
define double @ang_equiv(double %0) {
%2 = tail call i32 @sin(double %0)
%3 = tail call i32 @cos(double %0)
%4 = tail call double @arc_tang(i32 %2, i32 %3)
ret double %4
}
int test_imm_31int16_mem(short *val) {
  return ((*val) & (0x31 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_31int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 49
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ tek_text();
void plD_tidy_tek(void) { tek_text(); }


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

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

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

LLVM IR (-O2):
define void @plD_tidy_tek() {
%1 = tail call i32 (...) @tek_text()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ baz(int /*<<< orphan*/);
void bar(void) { baz(0); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <baz@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @bar() {
%1 = call i32 @baz(i32 0)
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 @baz(i32 0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ hd44780_command(int);
void lcd_enable_cursor(uint8_t blink) {
  hd44780_command(
      (0x08 | ((1) ? 0x04 : 0) | ((1) ? 0x02 : 0) | ((blink) ? 1 : 0)));
}


x86 assembly (clang, -O0):
<lcd_enable_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %edi,%edi
mov    $0x1,%eax
cmp    $0x0,%rcx
cmovne %eax,%edi
or     $0xe,%edi
call   1030 <hd44780_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_enable_cursor>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
or     $0xe,%eax
mov    %eax,%edi
jmp    1030 <hd44780_command@plt>

LLVM IR (-O0):
define void @lcd_enable_cursor(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
%7 = or i32 14, %6
%8 = call i32 @hd44780_command(i32 %7)
ret void
}

LLVM IR (-O2):
define void @lcd_enable_cursor(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = zext i1 %2 to i32
%4 = or i32 %3, 14
%5 = tail call i32 @hd44780_command(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void net_buf_free(void *buf) { free(buf); }


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

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

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

LLVM IR (-O2):
define void @net_buf_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
unsigned char C_Utils_min_byte(const unsigned char item1,
                               const unsigned char item2) {
  return item1 > item2 ? item1 : item2;
}


x86 assembly (clang, -O0):
<C_Utils_min_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jle    112c <C_Utils_min_byte+0x2c>
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <C_Utils_min_byte+0x33>
movzbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_min_byte>:
mov    %esi,%eax
cmp    %al,%dil
cmova  %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @C_Utils_min_byte(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp sgt i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
br label %16
13: ; preds = %2
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @C_Utils_min_byte(i8 zeroext %0, i8 zeroext %1) {
%3 = icmp ugt i8 %0, %1
%4 = select i1 %3, i8 %0, i8 %1
ret i8 %4
}
int canStartVoiceFlowRequest(int node) { struct event *anEvent; }


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

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

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

LLVM IR (-O2):
%struct.event = type opaque
define i32 @canStartVoiceFlowRequest(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ error(int, char *);
int get_char();
get_data() {
  int val;
  if ((val = get_char()) == EOF || !(val & 0100))
    error(1, "missing data value");
  return (val & 077);
}


x86 assembly (clang, -O0):
<get_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_char@plt>
mov    %eax,-0x4(%rbp)
mov    0x2eaf(%rip),%rcx
cmp    (%rcx),%eax
je     1150 <get_data+0x30>
mov    -0x4(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
jne    1161 <get_data+0x41>
mov    $0x1,%edi
lea    0xea4(%rip),%rsi
call   1030 <error@plt>
mov    -0x4(%rbp),%eax
and    $0x3f,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_data>:
push   %rbx
xor    %eax,%eax
call   1040 <get_char@plt>
mov    %eax,%ebx
mov    0x2eb7(%rip),%rax
cmp    (%rax),%ebx
je     113c <get_data+0x1c>
mov    %ebx,%eax
and    $0x40,%eax
jne    114d <get_data+0x2d>
lea    0xebd(%rip),%rsi
mov    $0x1,%edi
call   1030 <error@plt>
and    $0x3f,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [19 x i8] c"missing data value\00"
define i32 @get_data() {
%1 = alloca i32
%2 = call i32 (...) @get_char()
store i32 %2, i32* %1
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %9, label %5
5: ; preds = %0
%6 = load i32, i32* %1
%7 = and i32 %6, 64
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %5, %0
%10 = call i32 @error(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %5
%12 = load i32, i32* %1
%13 = and i32 %12, 63
ret i32 %13
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [19 x i8] c"missing data value\00"
define i32 @get_data() {
%1 = tail call i32 (...) @get_char()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
%4 = and i32 %1, 64
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = tail call i32 @error(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %0, %7
%10 = and i32 %1, 63
ret i32 %10
}
/* Variables and functions */
scalar_t__ isspace(char const);
char *parse_next(const char *s) {
  while (isspace(*s))
    ++s;
  return (char *)s;
}


x86 assembly (clang, -O0):
<parse_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <parse_next+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <parse_next+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_next>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <parse_next+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @parse_next(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
float __ocl_mix_float(float x, float y, float a) { return x + (y - x) * a; }


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

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

LLVM IR (-O0):
define float @__ocl_mix_float(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* %5
%9 = load float, float* %4
%10 = fsub float %8, %9
%11 = load float, float* %6
%12 = call float @llvm.fmuladd.f32(float %10, float %11, float %7)
ret float %12
}

LLVM IR (-O2):
define float @__ocl_mix_float(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = tail call float @llvm.fmuladd.f32(float %4, float %2, float %0)
ret float %5
}
/* Variables and functions */
char *malloc(int);
char *memcpy(char *, char const *, int);
int strlen(char const *);
char *strduplicate(const char *s) {
  int len = strlen(s) + 1;
  char *p;
  if ((p = malloc(len * sizeof(char))) == NULL) {
    return NULL;
  }
  return memcpy(p, s, len);
}


x86 assembly (clang, -O0):
<strduplicate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1175 <strduplicate+0x45>
movq   $0x0,-0x8(%rbp)
jmp    1189 <strduplicate+0x59>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strduplicate>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
add    $0x1,%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     115f <strduplicate+0x2f>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <memcpy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @strduplicate(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 1
%12 = trunc i64 %11 to i32
%13 = call i8* @malloc(i32 %12)
store i8* %13, i8** %5
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %16
15: ; preds = %1
store i8* null, i8** %2
br label %21
16: ; preds = %1
%17 = load i8*, i8** %5
%18 = load i8*, i8** %3
%19 = load i32, i32* %4
%20 = call i8* @memcpy(i8* %17, i8* %18, i32 %19)
store i8* %20, i8** %2
br label %21
21: ; preds = %16, %15
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @strduplicate(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i8* @memcpy(i8* %4, i8* %0, i32 %3)
br label %8
8: ; preds = %1, %6
%9 = phi i8* [ %7, %6 ], [ null, %1 ]
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ ucontext_t;

/* Variables and functions */
int /*<<< orphan*/ getcontext(int /*<<< orphan*/ *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ setcontext(int /*<<< orphan*/ *);
int /*<<< orphan*/ sleep(int);
int main(int argc, const char *argv[]) {
  ucontext_t context;
  getcontext(&context);
  puts("hello coroutine");
  sleep(1);
  setcontext(&context);
  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)
lea    -0x14(%rbp),%rdi
call   1050 <getcontext@plt>
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
lea    -0x14(%rbp),%rdi
call   1040 <setcontext@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <getcontext@plt>
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    %rbx,%rdi
call   1040 <setcontext@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"hello coroutine\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
%7 = call i32 @getcontext(i32* %6)
%8 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @sleep(i32 1)
%10 = call i32 @setcontext(i32* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"hello coroutine\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @getcontext(i32* %3)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @sleep(i32 1)
%8 = call i32 @setcontext(i32* %3)
ret i32 0
}
int exact_square(number) {
  int square = 0;
  for (; square <= number; square++) {
    if (number == square * square)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     114b <exact_square+0x4b>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
jne    1138 <exact_square+0x38>
movl   $0x1,-0x4(%rbp)
jmp    1152 <exact_square+0x52>
jmp    113d <exact_square+0x3d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <exact_square+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
test   %edi,%edi
js     1120 <exact_square+0x20>
lea    0x1(%rdi),%eax
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %ecx,%edx
imul   %ecx,%edx
cmp    %edi,%edx
je     1123 <exact_square+0x23>
add    $0x1,%ecx
cmp    %ecx,%eax
jne    1110 <exact_square+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @exact_square(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %10, label %6
3: ; preds = %6
%4 = add nuw i32 %7, 1
%5 = icmp eq i32 %7, %0
br i1 %5, label %10, label %6
6: ; preds = %1, %3
%7 = phi i32 [ %4, %3 ], [ 0, %1 ]
%8 = mul nsw i32 %7, %7
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %6, %3, %1
%11 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 1, %6 ]
ret i32 %11
}
/* Type definitions */
struct link {
  int dummy;
};

/* Variables and functions */
struct link *link_serve_address(int /*<<< orphan*/, int);
struct link *link_serve(int port) {
  return link_serve_address(0, port);
}


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

x86 assembly (clang, -O2):
<link_serve>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <link_serve_address@plt>

LLVM IR (-O0):
%struct.link = type { i32 }
define %struct.link* @link_serve(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call %struct.link* @link_serve_address(i32 0, i32 %3)
ret %struct.link* %4
}

LLVM IR (-O2):
%struct.link = type { i32 }
define %struct.link* @link_serve(i32 %0) {
%2 = tail call %struct.link* @link_serve_address(i32 0, i32 %0)
ret %struct.link* %2
}
/* Variables and functions */
void *fopen(char *, char *);
void *tty_open(int argc, char **argv) { return fopen("/dev/tty", "r+"); }


x86 assembly (clang, -O0):
<tty_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1030 <fopen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_open>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rsi
jmp    1030 <fopen@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"/dev/tty\00"
@.str.1 = [3 x i8] c"r+\00"
define i8* @tty_open(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i8* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret i8* %5
}

LLVM IR (-O2):
@.str = [9 x i8] c"/dev/tty\00"
@.str.1 = [3 x i8] c"r+\00"
define noalias i8* @tty_open(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret i8* %3
}
int foo(int x) { return (x << 2) | 4; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
or     $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x0(,%rdi,4),%eax
or     $0x4,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 2
%5 = or i32 %4, 4
ret i32 %5
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = shl i32 %0, 2
%3 = or i32 %2, 4
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ handle_PIPE(int /*<<< orphan*/);
int gen_PIPE(void) {
  handle_PIPE(0);
  return 0;
}


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

x86 assembly (clang, -O2):
<gen_PIPE>:
push   %rax
xor    %edi,%edi
call   1030 <handle_PIPE@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gen_PIPE() {
%1 = call i32 @handle_PIPE(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_PIPE() {
%1 = tail call i32 @handle_PIPE(i32 0)
ret i32 0
}