xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpngt_sd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmpngt_sd(__m128d A, __m128d B) { return _mm_cmpngt_sd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_cmpngt_sd>:
jmp    1030 <_mm_cmpngt_sd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpngt_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpngt_sd(i32 %0, i32 %1)
ret i32 %3
}
unsigned int ld2u(long double d) { return (unsigned)d; }


x86 assembly (clang, -O0):
<ld2u>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fnstcw -0x1a(%rbp)
movzwl -0x1a(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x1c(%rbp)
fldcw  -0x1c(%rbp)
fistpll -0x18(%rbp)
fldcw  -0x1a(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld2u>:
fldt   0x8(%rsp)
fnstcw -0xc(%rsp)
movzwl -0xc(%rsp),%eax
or     $0xc00,%eax
mov    %ax,-0xa(%rsp)
fldcw  -0xa(%rsp)
fistpll -0x8(%rsp)
fldcw  -0xc(%rsp)
mov    -0x8(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @ld2u(x86_fp80 %0) {
%2 = fptoui x86_fp80 %0 to i32
ret i32 %2
}
void __of_update_property_sysfs(struct device_node *np,
                                struct property *newprop,
                                struct property *oldprop) {}


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

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

LLVM IR (-O0):
%struct.device_node = type opaque
%struct.property = type opaque
define void @__of_update_property_sysfs(%struct.device_node* %0, %struct.property* %1, %struct.property* %2) {
%4 = alloca %struct.device_node*
%5 = alloca %struct.property*
%6 = alloca %struct.property*
store %struct.device_node* %0, %struct.device_node** %4
store %struct.property* %1, %struct.property** %5
store %struct.property* %2, %struct.property** %6
ret void
}

LLVM IR (-O2):
%struct.device_node = type opaque
%struct.property = type opaque
define void @__of_update_property_sysfs(%struct.device_node* nocapture %0, %struct.property* nocapture %1, %struct.property* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char const);
void puts(const char *s) {
  while (*s != '\0') {
    putchar(*s);
    s++;
  }
}


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

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @puts(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 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i32 @putchar(i8 signext %10)
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @putchar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XGetInputFocus() {
  printf("XGetInputFocus called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"XGetInputFocus called\0A\00"
define i32 @XGetInputFocus() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"XGetInputFocus called\00"
define i32 @XGetInputFocus() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct DynArr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ log10(double);
int /*<<< orphan*/ popDynArr(struct DynArr *);
int /*<<< orphan*/ pushDynArr(struct DynArr *, int /*<<< orphan*/);
double topDynArr(struct DynArr *);
void base_10_log(struct DynArr *stack) {
  double i = topDynArr(stack);
  popDynArr(stack);
  pushDynArr(stack, log10(i));
}


x86 assembly (clang, -O0):
<base_10_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <popDynArr@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <log10@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1060 <pushDynArr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base_10_log>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <topDynArr@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <popDynArr@plt>
movsd  0x8(%rsp),%xmm0
call   1050 <log10@plt>
mov    %rbx,%rdi
mov    %eax,%esi
add    $0x10,%rsp
pop    %rbx
jmp    1060 <pushDynArr@plt>

LLVM IR (-O0):
%struct.DynArr = type { i32 }
define void @base_10_log(%struct.DynArr* %0) {
%2 = alloca %struct.DynArr*
%3 = alloca double
store %struct.DynArr* %0, %struct.DynArr** %2
%4 = load %struct.DynArr*, %struct.DynArr** %2
%5 = call double @topDynArr(%struct.DynArr* %4)
store double %5, double* %3
%6 = load %struct.DynArr*, %struct.DynArr** %2
%7 = call i32 @popDynArr(%struct.DynArr* %6)
%8 = load %struct.DynArr*, %struct.DynArr** %2
%9 = load double, double* %3
%10 = call i32 @log10(double %9)
%11 = call i32 @pushDynArr(%struct.DynArr* %8, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.DynArr = type { i32 }
define void @base_10_log(%struct.DynArr* %0) {
%2 = tail call double @topDynArr(%struct.DynArr* %0)
%3 = tail call i32 @popDynArr(%struct.DynArr* %0)
%4 = tail call i32 @log10(double %2)
%5 = tail call i32 @pushDynArr(%struct.DynArr* %0, i32 %4)
ret void
}
int test_imm_6Bint64_lowword_mem(long long *val) {
  return ((*val) & (0x6B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Bint64_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, 107
%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_6Bint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 107
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a = 3;
  int b = 2;
  printf("a=%d\n", a);
  printf("b=%d\n", b);
  return 0;
}


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

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

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

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


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<bar>:
push   %rax
movl   $0x0,(%rdi)
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @bar(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
store i32 1, i32* %3
%4 = load i32*, i32** %2
store i32 0, i32* %4
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @bar(i32* nocapture writeonly %0) {
store i32 0, i32* %0
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ LCD_Out(int, int, char);
int /*<<< orphan*/ limpamlc();
int /*<<< orphan*/ mostrapenter(char);
int /*<<< orphan*/ sprintf(char, char *);
void fraseseis(char plinha, char penter) {
  limpamlc();
  sprintf(plinha, "6: Soda");
  LCD_Out(1, 5, plinha);
  mostrapenter(penter);
}


x86 assembly (clang, -O0):
<fraseseis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1030 <limpamlc@plt>
lea    0xe9e(%rip),%rsi
movsbl -0x1(%rbp),%edi
call   1050 <sprintf@plt>
mov    $0x1,%edi
mov    $0x5,%esi
movsbl -0x1(%rbp),%edx
call   1040 <LCD_Out@plt>
movsbl -0x2(%rbp),%edi
call   1060 <mostrapenter@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fraseseis>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <limpamlc@plt>
lea    0xeab(%rip),%rsi
mov    %ebp,%edi
call   1050 <sprintf@plt>
mov    $0x1,%edi
mov    $0x5,%esi
mov    %ebp,%edx
call   1040 <LCD_Out@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <mostrapenter@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"6: Soda\00"
define void @fraseseis(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call i32 (...) @limpamlc()
%6 = load i8, i8* %3
%7 = call i32 @sprintf(i8 signext %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = load i8, i8* %3
%9 = call i32 @LCD_Out(i32 1, i32 5, i8 signext %8)
%10 = load i8, i8* %4
%11 = call i32 @mostrapenter(i8 signext %10)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"6: Soda\00"
define void @fraseseis(i8 signext %0, i8 signext %1) {
%3 = tail call i32 (...) @limpamlc()
%4 = tail call i32 @sprintf(i8 signext %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @LCD_Out(i32 1, i32 5, i8 signext %0)
%6 = tail call i32 @mostrapenter(i8 signext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
scalar_t__ malloc(int);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  char *outstring;
  outstring = (char *)malloc(2);
  outstring[0] = '\n';
  outstring[1] = (char)0;
  while (1) {
    fputs(outstring, stdout);
  }
}


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)
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0xa,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x18(%rbp),%rdi
mov    0x2e82(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
jmp    1153 <main+0x33>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movw   $0xa,(%rax)
mov    0x2ea3(%rip),%r14
nopl   (%rax)
mov    (%r14),%esi
mov    %rbx,%rdi
call   1030 <fputs@plt>
jmp    1140 <main+0x20>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i64 @malloc(i32 2)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 10, i8* %10
%11 = load i8*, i8** %6
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8 0, i8* %12
br label %13
13: ; preds = %2, %13
%14 = load i8*, i8** %6
%15 = load i32, i32* @stdout
%16 = call i32 @fputs(i8* %14, i32 %15)
br label %13
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 2)
%4 = inttoptr i64 %3 to i8*
store i8 10, i8* %4
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8 0, i8* %5
br label %6
6: ; preds = %6, %2
%7 = load i32, i32* @stdout
%8 = tail call i32 @fputs(i8* %4, i32 %7)
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ calc();
int main() {
  calc();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @calc()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void ft_putstr(char const *s) {
  if (s != NULL)
    write(1, s, ft_strlen(s));
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1158 <ft_putstr+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
test   %rdi,%rdi
je     113e <ft_putstr+0x1e>
push   %rbx
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @ft_strlen(i8* %0)
%5 = tail call i32 @write(i32 1, i8* %0, i32 %4)
br label %6
6: ; preds = %3, %1
ret void
}
hyspopn(telno, flds, dev) char *telno, *flds[];
struct Devices *dev;
{
  return hysopn(telno, flds, dev, 0);
}


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

x86 assembly (clang, -O2):
<hyspopn>:
xor    %ecx,%ecx
xor    %eax,%eax
jmp    1030 <hysopn@plt>

LLVM IR (-O0):
%struct.Devices = type opaque
define i32 @hyspopn(i8* %0, i8** %1, %struct.Devices* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca %struct.Devices*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store %struct.Devices* %2, %struct.Devices** %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load %struct.Devices*, %struct.Devices** %6
%10 = call i32 (i8*, i8**, %struct.Devices*, i32, ...) bitcast (i32 (...)* @hysopn to i32 (i8*, i8**, %struct.Devices*, i32, ...)*)(i8* %7, i8** %8, %struct.Devices* %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.Devices = type opaque
define i32 @hyspopn(i8* %0, i8** %1, %struct.Devices* %2) {
%4 = tail call i32 (i8*, i8**, %struct.Devices*, i32, ...) bitcast (i32 (...)* @hysopn to i32 (i8*, i8**, %struct.Devices*, i32, ...)*)(i8* %0, i8** %1, %struct.Devices* %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void sigintr_handler(int num) { exit(1); }


x86 assembly (clang, -O0):
<sigintr_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sigintr_handler>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sigintr_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @sigintr_handler(i32 %0) {
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
bool string_contains_char(char str[], char c) {
  for (int i = 0; str[i] != '\0'; ++i) {
    if (str[i] == c) {
      return true;
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<string_contains_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1161 <string_contains_char+0x61>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    114e <string_contains_char+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1168 <string_contains_char+0x68>
jmp    1153 <string_contains_char+0x53>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <string_contains_char+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_contains_char>:
movzbl (%rdi),%ecx
test   %cl,%cl
je     1110 <string_contains_char+0x10>
add    $0x1,%rdi
cmp    %sil,%cl
jne    1100 <string_contains_char>
xor    %eax,%eax
test   %cl,%cl
setne  %al
ret

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

LLVM IR (-O2):
define i32 @string_contains_char(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %10, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = icmp eq i8 %6, %1
%9 = or i1 %7, %8
%10 = add nuw i64 %4, 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = xor i1 %7, true
%13 = zext i1 %12 to i32
ret i32 %13
}
block_assemble(instr, nr, first, Last) char **instr;
int nr, first, Last;
{
  int i;
  for (i = 0; i < nr; i++)
    assemble(instr[i]);
}


x86 assembly (clang, -O0):
<block_assemble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1159 <block_assemble+0x49>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   1030 <assemble@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112c <block_assemble+0x1c>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @block_assemble(i8** nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %15
6: ; preds = %4
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 (i8*, ...) bitcast (i32 (...)* @assemble to i32 (i8*, ...)*)(i8* %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %4
ret i32 undef
}
void report_Disconnect_Req(void) {}


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

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

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

LLVM IR (-O2):
define void @report_Disconnect_Req() {
ret void
}
/* Variables and functions */
float expf(float);
float powf(float, float);
float gauss(float n, float N, float o) {
  return expf(-1.0f / 2.0f *
              powf((n - (N - 1.0f) / 2.0f) / (o * (N - 1.0f) / 2.0f), 2.0f));
}


x86 assembly (clang, -O0):
<gauss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xebf(%rip),%xmm2
subss  %xmm2,%xmm1
movss  0xeaf(%rip),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
movss  0xe99(%rip),%xmm3
subss  %xmm3,%xmm2
mulss  %xmm2,%xmm1
movss  0xe85(%rip),%xmm2
divss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  0xe75(%rip),%xmm1
call   1030 <powf@plt>
movaps %xmm0,%xmm1
movss  0xe61(%rip),%xmm0
mulss  %xmm1,%xmm0
call   1040 <expf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gauss>:
addss  0xee8(%rip),%xmm1
movss  0xee4(%rip),%xmm3
movaps %xmm1,%xmm4
mulss  %xmm3,%xmm4
mulss  %xmm2,%xmm1
mulss  0xed5(%rip),%xmm1
addss  %xmm4,%xmm0
divss  %xmm1,%xmm0
mulss  %xmm0,%xmm0
mulss  %xmm3,%xmm0
jmp    1030 <expf@plt>

LLVM IR (-O0):
define float @gauss(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 = fsub float %8, 1.000000e+00
%10 = fdiv float %9, 2.000000e+00
%11 = fsub float %7, %10
%12 = load float, float* %6
%13 = load float, float* %5
%14 = fsub float %13, 1.000000e+00
%15 = fmul float %12, %14
%16 = fdiv float %15, 2.000000e+00
%17 = fdiv float %11, %16
%18 = call float @powf(float %17, float 2.000000e+00)
%19 = fmul float -5.000000e-01, %18
%20 = call float @expf(float %19)
ret float %20
}

LLVM IR (-O2):
define float @gauss(float %0, float %1, float %2) {
%4 = fadd float %1, -1.000000e+00
%5 = fmul float %4, 5.000000e-01
%6 = fsub float %0, %5
%7 = fmul float %4, %2
%8 = fmul float %7, 5.000000e-01
%9 = fdiv float %6, %8
%10 = fmul float %9, %9
%11 = fmul float %10, -5.000000e-01
%12 = tail call float @expf(float %11)
ret float %12
}
/* Type definitions */
struct pbc_env {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pbc_delete(struct pbc_env *);
struct pbc_env *pbc_new();
int /*<<< orphan*/ test_des(struct pbc_env *, char *);
int main(int argc, char *argv[]) {
  struct pbc_env *env = pbc_new();
  test_des(env, argv[1]);
  pbc_delete(env);
  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)
mov    $0x0,%al
call   1040 <pbc_new@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1050 <test_des@plt>
mov    -0x18(%rbp),%rdi
call   1030 <pbc_delete@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
xor    %eax,%eax
call   1040 <pbc_new@plt>
mov    %rax,%rbx
mov    0x8(%r14),%rsi
mov    %rax,%rdi
call   1050 <test_des@plt>
mov    %rbx,%rdi
call   1030 <pbc_delete@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.pbc_env = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.pbc_env*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call %struct.pbc_env* (...) @pbc_new()
store %struct.pbc_env* %7, %struct.pbc_env** %6
%8 = load %struct.pbc_env*, %struct.pbc_env** %6
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @test_des(%struct.pbc_env* %8, i8* %11)
%13 = load %struct.pbc_env*, %struct.pbc_env** %6
%14 = call i32 @pbc_delete(%struct.pbc_env* %13)
ret i32 0
}

LLVM IR (-O2):
%struct.pbc_env = type { i32 }
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call %struct.pbc_env* (...) @pbc_new()
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @test_des(%struct.pbc_env* %3, i8* %5)
%7 = tail call i32 @pbc_delete(%struct.pbc_env* %3)
ret i32 0
}
/* Variables and functions */
char *str_malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *add_slash_to(char *str) {
  char *new_str = str_malloc(strlen(str) + 2);
  strcpy(new_str, str);
  strcat(new_str, "/");
  return new_str;
}


x86 assembly (clang, -O0):
<add_slash_to>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x2,%rdi
call   1050 <str_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
lea    0xe83(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_slash_to>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x2(%rax),%rdi
call   1050 <str_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
lea    0xe96(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define i8* @add_slash_to(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 2
%7 = call i8* @str_malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
%12 = call i32 @strcat(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i8* @add_slash_to(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 2
%4 = tail call i8* @str_malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
%6 = tail call i32 @strcat(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}
int xmlIsBlank(unsigned int ch) {
  return ((((ch) < 0x100)
               ? ((((ch)) == 0x20) || ((0x9 <= ((ch))) && (((ch)) <= 0xa)) ||
                  (((ch)) == 0xd))
               : 0));
}


x86 assembly (clang, -O0):
<xmlIsBlank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jae    115a <xmlIsBlank+0x5a>
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114a <xmlIsBlank+0x4a>
mov    $0x9,%eax
cmp    -0x4(%rbp),%eax
ja     1140 <xmlIsBlank+0x40>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jbe    114a <xmlIsBlank+0x4a>
cmpl   $0xd,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
jmp    1164 <xmlIsBlank+0x64>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1164 <xmlIsBlank+0x64>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlIsBlank>:
xor    %eax,%eax
cmp    $0xff,%edi
ja     1126 <xmlIsBlank+0x26>
cmp    $0x20,%edi
sete   %al
lea    -0x9(%rdi),%ecx
cmp    $0x2,%ecx
setb   %cl
cmp    $0xd,%edi
sete   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @xmlIsBlank(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 256
br i1 %4, label %5, label %20
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 32
br i1 %7, label %17, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp ule i32 9, %9
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp ule i32 %12, 10
br i1 %13, label %17, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 13
br label %17
17: ; preds = %14, %11, %5
%18 = phi i1 [ true, %11 ], [ true, %5 ], [ %16, %14 ]
%19 = zext i1 %18 to i32
br label %21
20: ; preds = %1
br label %21
21: ; preds = %20, %17
%22 = phi i32 [ %19, %17 ], [ 0, %20 ]
ret i32 %22
}

LLVM IR (-O2):
define i32 @xmlIsBlank(i32 %0) {
%2 = icmp ult i32 %0, 256
br i1 %2, label %3, label %11
3: ; preds = %1
%4 = icmp eq i32 %0, 32
%5 = add nsw i32 %0, -9
%6 = icmp ult i32 %5, 2
%7 = or i1 %4, %6
%8 = icmp eq i32 %0, 13
%9 = or i1 %8, %7
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %3
%12 = phi i32 [ %10, %3 ], [ 0, %1 ]
ret i32 %12
}
int main() {
  char a[] = {1, 2, 5, 3};
  void (*foo)(void) = a;
  foo();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xef2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
call   *-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   2000 <_fini+0xef4>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [4 x i8] c"\01\02\05\03"
define i32 @main() {
%1 = alloca [4 x i8]
%2 = alloca void ()*
%3 = bitcast [4 x i8]* %1 to i8*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%5 = bitcast i8* %4 to void ()*
store void ()* %5, void ()** %2
%6 = load void ()*, void ()** %2
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [4 x i8] c"\01\02\05\03"
define i32 @main() {
tail call void bitcast ([4 x i8]* @__const.main.a to void ()*)()
ret i32 0
}
int console_record_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @console_record_init() {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int foo(int *);
uint32_t bar() {
  uint32_t val = 1;
  return foo(&val) + val;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <foo@plt>
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <foo@plt>
add    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bar() {
%1 = alloca i32
store i32 1, i32* %1
%2 = call i32 @foo(i32* %1)
%3 = load i32, i32* %1
%4 = add nsw i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @bar() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = call i32 @foo(i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void test4(int a, int b, int c, int d, long long value, int after) {
  if (a != 1 || b != 2 || c != 3 || d != 4 || value != 0x123456789abcdefLL ||
      after != 0x55)
    abort();
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1172 <test4+0x62>
cmpl   $0x2,-0x8(%rbp)
jne    1172 <test4+0x62>
cmpl   $0x3,-0xc(%rbp)
jne    1172 <test4+0x62>
cmpl   $0x4,-0x10(%rbp)
jne    1172 <test4+0x62>
movabs $0x123456789abcdef,%rax
45 23 01
cmp    %rax,-0x18(%rbp)
jne    1172 <test4+0x62>
cmpl   $0x55,-0x1c(%rbp)
je     1179 <test4+0x69>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
cmp    $0x1,%edi
jne    113a <test4+0x2a>
cmp    $0x2,%esi
jne    113a <test4+0x2a>
cmp    $0x3,%edx
jne    113a <test4+0x2a>
cmp    $0x4,%ecx
jne    113a <test4+0x2a>
movabs $0x123456789abcdef,%rax
45 23 01
cmp    %rax,%r8
jne    113a <test4+0x2a>
cmp    $0x55,%r9d
jne    113a <test4+0x2a>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @test4(i32 %0, i32 %1, i32 %2, i32 %3, i64 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i64
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i64 %4, i64* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = icmp ne i32 %13, 1
br i1 %14, label %30, label %15
15: ; preds = %6
%16 = load i32, i32* %8
%17 = icmp ne i32 %16, 2
br i1 %17, label %30, label %18
18: ; preds = %15
%19 = load i32, i32* %9
%20 = icmp ne i32 %19, 3
br i1 %20, label %30, label %21
21: ; preds = %18
%22 = load i32, i32* %10
%23 = icmp ne i32 %22, 4
br i1 %23, label %30, label %24
24: ; preds = %21
%25 = load i64, i64* %11
%26 = icmp ne i64 %25, 81985529216486895
br i1 %26, label %30, label %27
27: ; preds = %24
%28 = load i32, i32* %12
%29 = icmp ne i32 %28, 85
br i1 %29, label %30, label %32
30: ; preds = %27, %24, %21, %18, %15, %6
%31 = call i32 (...) @abort()
unreachable
32: ; preds = %27
ret void
}

LLVM IR (-O2):
define void @test4(i32 %0, i32 %1, i32 %2, i32 %3, i64 %4, i32 %5) {
%7 = icmp ne i32 %0, 1
%8 = icmp ne i32 %1, 2
%9 = or i1 %7, %8
%10 = icmp ne i32 %2, 3
%11 = or i1 %9, %10
%12 = icmp ne i32 %3, 4
%13 = or i1 %11, %12
%14 = icmp ne i64 %4, 81985529216486895
%15 = or i1 %13, %14
%16 = icmp ne i32 %5, 85
%17 = or i1 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %6
%19 = tail call i32 (...) @abort()
unreachable
20: ; preds = %6
ret void
}
/* Variables and functions */
scalar_t__ EINVAL;
scalar_t__ ERANGE;
scalar_t__ errno;
int strtol(char *, int /*<<< orphan*/ *, int);
int getPosFromCommand(char *command) {
  int toRet;
  toRet = strtol(command + 4, NULL, 10);
  if (errno == EINVAL || errno == ERANGE) {
    toRet = -1;
  }
  return toRet;
}


x86 assembly (clang, -O0):
<getPosFromCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e9c(%rip),%rax
mov    (%rax),%rax
mov    0x2e8a(%rip),%rcx
cmp    (%rcx),%rax
je     1169 <getPosFromCommand+0x59>
mov    0x2e82(%rip),%rax
mov    (%rax),%rax
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%rax
jne    1170 <getPosFromCommand+0x60>
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPosFromCommand>:
push   %rax
add    $0x4,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    0x2eb0(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2eb6(%rip),%rdx
cmp    (%rdx),%rcx
mov    0x2e94(%rip),%rdx
mov    $0xffffffff,%esi
cmove  %esi,%eax
cmp    (%rdx),%rcx
cmove  %esi,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i64 0
@EINVAL = global i64 0
@ERANGE = global i64 0
define i32 @getPosFromCommand(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 4
%6 = call i32 @strtol(i8* %5, i32* null, i32 10)
store i32 %6, i32* %3
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINVAL
%9 = icmp eq i64 %7, %8
br i1 %9, label %14, label %10
10: ; preds = %1
%11 = load i64, i64* @errno
%12 = load i64, i64* @ERANGE
%13 = icmp eq i64 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10, %1
store i32 -1, i32* %3
br label %15
15: ; preds = %14, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@errno = global i64 0
@EINVAL = global i64 0
@ERANGE = global i64 0
define i32 @getPosFromCommand(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = tail call i32 @strtol(i8* nocapture %2, i32* null, i32 10)
%4 = load i64, i64* @errno
%5 = load i64, i64* @EINVAL
%6 = icmp eq i64 %4, %5
%7 = load i64, i64* @ERANGE
%8 = icmp eq i64 %4, %7
%9 = select i1 %6, i1 true, i1 %8
%10 = select i1 %9, i32 -1, i32 %3
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_cond_wait(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
int thread_syn_wait(pthread_mutex_t *mutex, pthread_cond_t *cond, int *flag) {
  pthread_mutex_lock(mutex);
  while (!*flag) {
    pthread_cond_wait(cond, mutex);
  }
  pthread_mutex_unlock(mutex);
  return 0;
}


x86 assembly (clang, -O0):
<thread_syn_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <pthread_mutex_lock@plt>
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1166 <thread_syn_wait+0x36>
jmp    1178 <thread_syn_wait+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <pthread_cond_wait@plt>
jmp    114d <thread_syn_wait+0x1d>
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_syn_wait>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1050 <pthread_mutex_lock@plt>
cmpl   $0x0,(%r14)
jne    1161 <thread_syn_wait+0x31>
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <pthread_cond_wait@plt>
cmpl   $0x0,(%r14)
je     1150 <thread_syn_wait+0x20>
mov    %rbx,%rdi
call   1040 <pthread_mutex_unlock@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @thread_syn_wait(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = call i32 @pthread_mutex_lock(i32* %7)
br label %9
9: ; preds = %14, %3
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = load i32*, i32** %5
%16 = load i32*, i32** %4
%17 = call i32 @pthread_cond_wait(i32* %15, i32* %16)
br label %9
18: ; preds = %9
%19 = load i32*, i32** %4
%20 = call i32 @pthread_mutex_unlock(i32* %19)
ret i32 0
}

LLVM IR (-O2):
define i32 @thread_syn_wait(i32* %0, i32* %1, i32* nocapture %2) {
%4 = tail call i32 @pthread_mutex_lock(i32* %0)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %3, %7
%8 = tail call i32 @pthread_cond_wait(i32* %1, i32* %0)
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 0
br i1 %10, label %7, label %11
11: ; preds = %7, %3
%12 = tail call i32 @pthread_mutex_unlock(i32* %0)
ret i32 0
}
void gtk_widget_child_focus() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_child_focus() {
ret void
}
void reloadSecondHalf() {}


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

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

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

LLVM IR (-O2):
define void @reloadSecondHalf() {
ret void
}
double EOS_P(double rho, double temperature) {
  return rho * 287.0 * temperature;
}


x86 assembly (clang, -O0):
<EOS_P>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<EOS_P>:
mulsd  0xef8(%rip),%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @EOS_P(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fmul double %5, 2.870000e+02
%7 = load double, double* %4
%8 = fmul double %6, %7
ret double %8
}

LLVM IR (-O2):
define double @EOS_P(double %0, double %1) {
%3 = fmul double %0, 2.870000e+02
%4 = fmul double %3, %1
ret double %4
}
void swap(int a, int b) {
  int tmp = a;
  a = b;
  b = tmp;
}


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

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

LLVM IR (-O0):
define void @swap(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
store i32 %6, i32* %5
%7 = load i32, i32* %4
store i32 %7, i32* %3
%8 = load i32, i32* %5
store i32 %8, i32* %4
ret void
}

LLVM IR (-O2):
define void @swap(i32 %0, i32 %1) {
ret void
}
long __syscall2(long __n, long __a1, long __a2) {
  unsigned long __ret;
  __asm__ __volatile__("syscall"
                       : "=a"(__ret)
                       : "a"(__n), "D"(__a1), "S"(__a2)
                       : "rcx", "r11", "memory");
  return __ret;
}


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

x86 assembly (clang, -O2):
<__syscall2>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
syscall
ret

LLVM IR (-O0):
define i64 @__syscall2(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %8, i64 %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
ret i64 %12
}

LLVM IR (-O2):
define i64 @__syscall2(i64 %0, i64 %1, i64 %2) {
%4 = tail call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2)
ret i64 %4
}