xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void Base85_FormatarTexto(uint32_t result, uint8_t *coded) {
  coded[0] = result >> 24;
  coded[1] = (result >> 16) & 0xFF;
  coded[2] = (result >> 8) & 0xFF;
  coded[3] = result & 0xFF;
}


x86 assembly (clang, -O0):
<Base85_FormatarTexto>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Base85_FormatarTexto>:
mov    %edi,%eax
mov    %edi,%ecx
movzbl %ah,%edx
movzbl %al,%edi
sar    $0x18,%eax
mov    %eax,(%rsi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x4(%rsi)
mov    %edx,0x8(%rsi)
mov    %edi,0xc(%rsi)
ret

LLVM IR (-O0):
define void @Base85_FormatarTexto(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 = ashr i32 %5, 24
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %3
%10 = ashr i32 %9, 16
%11 = and i32 %10, 255
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %11, i32* %13
%14 = load i32, i32* %3
%15 = ashr i32 %14, 8
%16 = and i32 %15, 255
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 2
store i32 %16, i32* %18
%19 = load i32, i32* %3
%20 = and i32 %19, 255
%21 = load i32*, i32** %4
%22 = getelementptr inbounds i32, i32* %21, i64 3
store i32 %20, i32* %22
ret void
}

LLVM IR (-O2):
define void @Base85_FormatarTexto(i32 %0, i32* nocapture writeonly %1) {
%3 = ashr i32 %0, 24
store i32 %3, i32* %1
%4 = lshr i32 %0, 16
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %5, i32* %6
%7 = lshr i32 %0, 8
%8 = and i32 %7, 255
%9 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %8, i32* %9
%10 = and i32 %0, 255
%11 = getelementptr inbounds i32, i32* %1, i64 3
store i32 %10, i32* %11
ret void
}
short int cast_long_short_fast(long int x) { return (short int)x; }


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

x86 assembly (clang, -O2):
<cast_long_short_fast>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define signext i16 @cast_long_short_fast(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @cast_long_short_fast(i64 %0) {
%2 = trunc i64 %0 to i16
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int hello() {
  printf("hello world\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
double GeogREarth(const double *r) {
  static double rearth = 6366707.019;
  if (r) {
    rearth = *r;
  }
  return rearth;
}


x86 assembly (clang, -O0):
<GeogREarth>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1123 <GeogREarth+0x23>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x2efd(%rip)
movsd  0x2ef5(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<GeogREarth>:
test   %rdi,%rdi
je     1112 <GeogREarth+0x12>
movsd  (%rdi),%xmm0
movsd  %xmm0,0x2f0f(%rip)
ret
movsd  0x2f06(%rip),%xmm0
ret

LLVM IR (-O0):
@GeogREarth.rearth = internal global double 0x4158497CC1374BC7
define double @GeogREarth(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = icmp ne double* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double*, double** %2
%7 = load double, double* %6
store double %7, double* @GeogREarth.rearth
br label %8
8: ; preds = %5, %1
%9 = load double, double* @GeogREarth.rearth
ret double %9
}

LLVM IR (-O2):
@GeogREarth.rearth = internal unnamed_addr global double 0x4158497CC1374BC7
define double @GeogREarth(double* %0) {
%2 = icmp eq double* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = load double, double* @GeogREarth.rearth
br label %7
5: ; preds = %1
%6 = load double, double* %0
store double %6, double* @GeogREarth.rearth
br label %7
7: ; preds = %3, %5
%8 = phi double [ %4, %3 ], [ %6, %5 ]
ret double %8
}
int test_imm_95uint8_mem(unsigned char *val) {
  return ((*val) & (0x95 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_95uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 149
%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_95uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -107
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int sys_unlink(int fd, const char *path) {}


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

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

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

LLVM IR (-O2):
define i32 @sys_unlink(i32 %0, i8* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ exit2(int);
int /*<<< orphan*/ exit3(int);
int main(void) {
  volatile int i = 3;
  switch (i) {
  case 1:
    exit(11);
  case 2:
    exit2(12);
  case 3:
    exit3(13);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     117c <main+0x4c>
jmp    115a <main+0x2a>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1186 <main+0x56>
jmp    116b <main+0x3b>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1190 <main+0x60>
jmp    119a <main+0x6a>
mov    $0xb,%edi
call   1050 <exit@plt>
mov    $0xc,%edi
call   1030 <exit2@plt>
mov    $0xd,%edi
call   1040 <exit3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x3,0x4(%rsp)
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
je     1156 <main+0x26>
cmp    $0x3,%eax
je     1160 <main+0x30>
cmp    $0x1,%eax
jne    116a <main+0x3a>
mov    $0xb,%edi
call   1050 <exit@plt>
mov    $0xc,%edi
call   1030 <exit2@plt>
mov    $0xd,%edi
call   1040 <exit3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store volatile i32 3, i32* %2
%3 = load volatile i32, i32* %2
switch i32 %3, label %10 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
]
4: ; preds = %0
%5 = call i32 @exit(i32 11)
unreachable
6: ; preds = %0
%7 = call i32 @exit2(i32 12)
br label %8
8: ; preds = %0, %6
%9 = call i32 @exit3(i32 13)
br label %10
10: ; preds = %8, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 3, i32* %1
%3 = load volatile i32, i32* %1
switch i32 %3, label %10 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
]
4: ; preds = %0
%5 = tail call i32 @exit(i32 11)
unreachable
6: ; preds = %0
%7 = tail call i32 @exit2(i32 12)
br label %8
8: ; preds = %0, %6
%9 = tail call i32 @exit3(i32 13)
br label %10
10: ; preds = %8, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
void main(void) {
  printf("A");
  putchar('B');
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
jmp    113a <main+0x1a>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1130 <main+0x20>

LLVM IR (-O0):
@.str = [2 x i8] c"A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @putchar(i8 signext 66)
br label %3
3: ; preds = %3, %0
br label %3
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 65)
%2 = tail call i32 @putchar(i8 signext 66)
br label %3
3: ; preds = %3, %0
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int rundung(double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double input = 0;
  printf("Geben Sie eine reele Zahl ein\n");
  scanf("%lf", &input);
  printf("Die nchste natuerliche Zahl ist %d\n", rundung(input));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
call   1030 <rundung@plt>
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xea4(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
movsd  (%rsp),%xmm0
call   1040 <rundung@plt>
lea    0xe8f(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Geben Sie eine reele Zahl ein\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [38 x i8] c"Die n\C2\8Achste natuerliche Zahl ist %d\0A\00"
define i32 @main() {
%1 = alloca double
store double 0.000000e+00, double* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = call i32 @rundung(double %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [38 x i8] c"Die n\C2\8Achste natuerliche Zahl ist %d\0A\00"
@str = [30 x i8] c"Geben Sie eine reele Zahl ein\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = call i32 @rundung(double %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
void RTAvloIOPortDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvloIOPortDestroy() {
ret void
}
/* Variables and functions */
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int);
int digit_to_int(char d) {
  char str[2];
  str[0] = d;
  str[1] = '\0';
  return (int)strtol(str, NULL, 10);
}


x86 assembly (clang, -O0):
<digit_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
movb   $0x0,-0x2(%rbp)
lea    -0x3(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit_to_int>:
push   %rax
mov    %dil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x6(%rsp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @digit_to_int(i8 signext %0) {
%2 = alloca i8
%3 = alloca [2 x i8]
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %4, i8* %5
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %6
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%8 = call i64 @strtol(i8* %7, i32* null, i32 10)
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @digit_to_int(i8 signext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 %0, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 0, i8* %4
%5 = call i64 @strtol(i8* nocapture %3, i32* null, i32 10)
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Type definitions */
struct tgdb {
  int dummy;
};

/* Variables and functions */
char *tgdb_err_msg(struct tgdb *tgdb) { return NULL; }


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

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

LLVM IR (-O0):
%struct.tgdb = type { i32 }
define i8* @tgdb_err_msg(%struct.tgdb* %0) {
%2 = alloca %struct.tgdb*
store %struct.tgdb* %0, %struct.tgdb** %2
ret i8* null
}

LLVM IR (-O2):
%struct.tgdb = type { i32 }
define noalias i8* @tgdb_err_msg(%struct.tgdb* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const, int const);
void main() {
  const int Max = 5;
  int const i = Max;
  int j = 5;
  printf("%d %d", Max, i);
}


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x5,%esi
mov    $0x5,%edx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5, i32 5)
ret void
}
float round_float_uint(float a) { return (float)(unsigned int)a; }


x86 assembly (clang, -O0):
<round_float_uint>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%rax
mov    %eax,%eax
cvtsi2ss %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_float_uint>:
cvttss2si %xmm0,%rax
mov    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
ret

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

LLVM IR (-O2):
define float @round_float_uint(float %0) {
%2 = fptoui float %0 to i32
%3 = uitofp i32 %2 to float
ret float %3
}
char int_to_rfm_m$input$output_complete(char arg_0x82b5070) {
  char result;
  result = counter$output$output_complete(arg_0x82b5070);
  return result;
}


x86 assembly (clang, -O0):
<int_to_rfm_m$input$output_complete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
mov    $0x0,%al
call   1030 <counter$output$output_complete@plt>
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_rfm_m$input$output_complete>:
push   %rax
xor    %eax,%eax
call   1030 <counter$output$output_complete@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @"int_to_rfm_m$input$output_complete"(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = call i32 (i32, ...) bitcast (i32 (...)* @"counter$output$output_complete" to i32 (i32, ...)*)(i32 %5)
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i8, i8* %3
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @"int_to_rfm_m$input$output_complete"(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @"counter$output$output_complete" to i32 (i32, ...)*)(i32 %2)
%4 = trunc i32 %3 to i8
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
scalar_t__ update_crc32(unsigned long, char *, int /*<<< orphan*/);
int hashaddr_crc32(char *key) {
  return (int)update_crc32(0UL, key, strlen(key));
}


x86 assembly (clang, -O0):
<hashaddr_crc32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
xor    %eax,%eax
mov    %eax,%edi
call   1040 <update_crc32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashaddr_crc32>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <update_crc32@plt>

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

LLVM IR (-O2):
define i32 @hashaddr_crc32(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i64 @update_crc32(i64 0, i8* %0, i32 %2)
%4 = trunc i64 %3 to i32
ret i32 %4
}
int test_imm_49uint16_mem(unsigned short *val) {
  return ((*val) & (-0x49 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_49uint16_mem>:
movzwl (%rdi),%eax
test   $0xffb7,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_49uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -73
%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_49uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -73
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double calcWave(double temp) {
  double wave;
  wave = 2.898E-3 / (temp + 273.15);
  return wave;
}


x86 assembly (clang, -O0):
<calcWave>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
movsd  0xee2(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcWave>:
addsd  0xef8(%rip),%xmm0
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calcWave(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fadd double %4, 2.731500e+02
%6 = fdiv double 2.898000e-03, %5
store double %6, double* %3
%7 = load double, double* %3
ret double %7
}

LLVM IR (-O2):
define double @calcWave(double %0) {
%2 = fadd double %0, 2.731500e+02
%3 = fdiv double 2.898000e-03, %2
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ net_send(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, char *);
void irc_join_pass(char *channel, char *pass) {
  char msg[(512 - 3)];
  snprintf(msg, (512 - 3), "%s %s %s", "JOIN", channel, pass);
  net_send(msg);
}


x86 assembly (clang, -O0):
<irc_join_pass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    $0x1fd,%esi
lea    0xeb2(%rip),%rdx
lea    0xeb4(%rip),%rcx
call   1030 <snprintf@plt>
lea    -0x210(%rbp),%rdi
call   1040 <net_send@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_join_pass>:
push   %rbx
sub    $0x200,%rsp
mov    %rsi,%r9
mov    %rdi,%r8
lea    0xecb(%rip),%rdx
lea    0xecd(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1fd,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <net_send@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%s %s %s\00"
@.str.1 = [5 x i8] c"JOIN\00"
define void @irc_join_pass(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [509 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %6, i32 509, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%11 = call i32 @net_send(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s %s %s\00"
@.str.1 = [5 x i8] c"JOIN\00"
define void @irc_join_pass(i8* %0, i8* %1) {
%3 = alloca [509 x i8]
%4 = getelementptr inbounds [509 x i8], [509 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 509, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @net_send(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int sayi;
  printf("sayi giriniz: ");
  scanf("%d", &sayi);
  sayi++;
  printf("sayi - %d", sayi);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
add    $0x1,%esi
mov    %esi,0x4(%rsp)
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"sayi giriniz: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"sayi - %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int baz(int);
int main(void) { return baz(2); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x2,%edi
jmp    1030 <baz@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @baz(i32 2)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ gwxflush();
void gwxdisplaybuffer() { gwxflush(); }


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

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

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

LLVM IR (-O2):
define void @gwxdisplaybuffer() {
%1 = tail call i32 (...) @gwxflush()
ret void
}
int gcd(int a, int b) {
  int y = 0;
  int x = 0;
  if (a > b) {
    x = a;
    y = b;
  } else {
    x = b;
    y = a;
  }
  while (x % y != 0) {
    int temp = x;
    x = y;
    y = temp % x;
  }
  return y;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1135 <gcd+0x35>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <gcd+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <gcd+0x46>
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     1171 <gcd+0x71>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %edx,-0xc(%rbp)
jmp    1146 <gcd+0x46>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%edx
cmp    %esi,%edi
mov    %esi,%eax
cmovg  %edi,%eax
cmovg  %esi,%edx
nopl   0x0(%rax)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = select i1 %3, i32 %1, i32 %0
br label %6
6: ; preds = %6, %2
%7 = phi i32 [ %4, %2 ], [ %8, %6 ]
%8 = phi i32 [ %5, %2 ], [ %9, %6 ]
%9 = srem i32 %7, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned char);
void fprint_orl_Rn(FILE *stream, unsigned char n) {
  fprintf(stream, "ORL   A, R%X                     ", n);
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"ORL A, R%X \00"
define void @fprint_orl_Rn(i32* %0, i8 zeroext %1) {
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
%5 = load i32*, i32** %3
%6 = load i8, i8* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"ORL A, R%X \00"
define void @fprint_orl_Rn(i32* nocapture %0, i8 zeroext %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int gvalue_hashInt(int);
uint32_t gvalue_hashLong(uint64_t i) {
  return gvalue_hashInt(((uint32_t)i) ^ ((uint32_t)(i >> 32)));
}


x86 assembly (clang, -O0):
<gvalue_hashLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
xor    %eax,%edi
call   1030 <gvalue_hashInt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gvalue_hashLong>:
jmp    1030 <gvalue_hashInt@plt>

LLVM IR (-O0):
define i32 @gvalue_hashLong(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 32
%6 = xor i32 %3, %5
%7 = call i32 @gvalue_hashInt(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @gvalue_hashLong(i32 %0) {
%2 = tail call i32 @gvalue_hashInt(i32 poison)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void hellofunc(void) { printf("%s\n", "hello,world"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [12 x i8] c"hello,world\00"
define void @hellofunc() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [12 x i8] c"hello,world\00"
define void @hellofunc() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void nodbg() {}


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

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

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

LLVM IR (-O2):
define void @nodbg() {
ret void
}
/* Variables and functions */
scalar_t__ ftk_dialog_get_title_height();
int ftk_popup_menu_calc_height(int has_title, int visible_items) {
  int height = visible_items * 40;
  height += 2 * 2;
  if (has_title) {
    height += ftk_dialog_get_title_height();
  }
  return height;
}


x86 assembly (clang, -O0):
<ftk_popup_menu_calc_height>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x28,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114c <ftk_popup_menu_calc_height+0x3c>
mov    $0x0,%al
call   1030 <ftk_dialog_get_title_height@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftk_popup_menu_calc_height>:
push   %rbx
shl    $0x3,%esi
lea    (%rsi,%rsi,4),%ebx
or     $0x4,%ebx
test   %edi,%edi
je     1127 <ftk_popup_menu_calc_height+0x17>
xor    %eax,%eax
call   1030 <ftk_dialog_get_title_height@plt>
add    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ftk_popup_menu_calc_height(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* %4
%7 = mul nsw i32 %6, 40
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = add nsw i32 %8, 4
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = call i64 (...) @ftk_dialog_get_title_height()
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = add nsw i64 %15, %13
%17 = trunc i64 %16 to i32
store i32 %17, i32* %5
br label %18
18: ; preds = %12, %2
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @ftk_popup_menu_calc_height(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, 40
%4 = or i32 %3, 4
%5 = icmp eq i32 %0, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i64 (...) @ftk_dialog_get_title_height()
%8 = trunc i64 %7 to i32
%9 = add i32 %4, %8
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ %9, %6 ], [ %4, %2 ]
ret i32 %11
}
int getaddrinfo(const char *node, const char *service,
                const struct addrinfo *hints, struct addrinfo **res) {
  return (-1);
}


x86 assembly (clang, -O0):
<getaddrinfo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.addrinfo = type opaque
define i32 @getaddrinfo(i8* %0, i8* %1, %struct.addrinfo* %2, %struct.addrinfo** %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.addrinfo*
%8 = alloca %struct.addrinfo**
store i8* %0, i8** %5
store i8* %1, i8** %6
store %struct.addrinfo* %2, %struct.addrinfo** %7
store %struct.addrinfo** %3, %struct.addrinfo*** %8
ret i32 -1
}

LLVM IR (-O2):
%struct.addrinfo = type opaque
define i32 @getaddrinfo(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.addrinfo* nocapture readnone %2, %struct.addrinfo** nocapture readnone %3) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ A;

/* Variables and functions */
int /*<<< orphan*/ insertion_sort(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printArray(int *, int);
int main() {
  int A[] = {1, 2, 5, 2, 16, 626, 263, 6};
  printArray(A, sizeof(A) / sizeof(A[0]));
  insertion_sort(A, 0, sizeof(A) / sizeof(A[0]) - 1);
  printArray(A, 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1030 <printArray@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x7,%edx
call   1040 <insertion_sort@plt>
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1030 <printArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printArray@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x7,%edx
call   1040 <insertion_sort@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printArray@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.A = [8 x i32] [i32 1, i32 2, i32 5, i32 2, i32 16, i32 626, i32 263, i32 6]
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
store i32 0, i32* %1
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call i32 @printArray(i32* %4, i32 8)
%6 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%7 = call i32 @insertion_sort(i32* %6, i32 0, i32 7)
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%9 = call i32 @printArray(i32* %8, i32 8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [8 x i32] [i32 1, i32 2, i32 5, i32 2, i32 16, i32 626, i32 263, i32 6]
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @printArray(i32* %3, i32 8)
%5 = call i32 @insertion_sort(i32* %3, i32 0, i32 7)
%6 = call i32 @printArray(i32* %3, i32 8)
ret i32 0
}
OP(dd, c9) {
  illegal_1();
  op_c9();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_c9@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_c9@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_c9()
ret i32 undef
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ printf(char *, char);
int main() {
  char a = ' ';
  while ((a = getchar()) != EOF)
    printf("%c", a);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x20,-0x5(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2ea1(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1167 <main+0x47>
lea    0xea7(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
jmp    1133 <main+0x13>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%al
je     1157 <main+0x37>
lea    0xec2(%rip),%rbx
xchg   %ax,%ax
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%al
jne    1140 <main+0x20>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i8 0
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 32, i8* %2
br label %3
3: ; preds = %9, %0
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = sext i8 %4 to i32
%6 = load i8, i8* @EOF
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %5, %7
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8, i8* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %10)
br label %3
12: ; preds = %3
ret i32 1
}

LLVM IR (-O2):
@EOF = global i8 0
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i8 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%7 = tail call signext i8 (...) @getchar()
%8 = load i8, i8* @EOF
%9 = icmp eq i8 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 1
}
/* Variables and functions */
float pow(float, double);
float Rec1886_OETF(float value) {
  return (value > 0.0) ? pow(value, 1.0 / 2.4) : 0.0;
}


x86 assembly (clang, -O0):
<Rec1886_OETF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1153 <Rec1886_OETF+0x43>
movss  -0x4(%rbp),%xmm0
movsd  0xec0(%rip),%xmm1
call   1030 <pow@plt>
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1160 <Rec1886_OETF+0x50>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1160 <Rec1886_OETF+0x50>
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rec1886_OETF>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1125 <Rec1886_OETF+0x15>
movsd  0xee0(%rip),%xmm1
jmp    1030 <pow@plt>
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @Rec1886_OETF(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load float, float* %2
%8 = call float @pow(float %7, double 0x3FDAAAAAAAAAAAAB)
%9 = fpext float %8 to double
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %6
%12 = phi double [ %9, %6 ], [ 0.000000e+00, %10 ]
%13 = fptrunc double %12 to float
ret float %13
}

LLVM IR (-O2):
define float @Rec1886_OETF(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call float @pow(float %0, double 0x3FDAAAAAAAAAAAAB)
br label %5
5: ; preds = %1, %3
%6 = phi float [ %4, %3 ], [ 0.000000e+00, %1 ]
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ qbyte(char);
int /*<<< orphan*/ qstr(char *);
void printd(char *s) {
  qstr(s);
  qbyte('\n');
}


x86 assembly (clang, -O0):
<printd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <qstr@plt>
mov    $0xa,%edi
call   1030 <qbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printd>:
push   %rax
call   1040 <qstr@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <qbyte@plt>

LLVM IR (-O0):
define void @printd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @qstr(i8* %3)
%5 = call i32 @qbyte(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @printd(i8* %0) {
%2 = tail call i32 @qstr(i8* %0)
%3 = tail call i32 @qbyte(i8 signext 10)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint64_t detexPack64G16(uint32_t g16) {
  return g16 << 16;
}


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

x86 assembly (clang, -O2):
<detexPack64G16>:
mov    %edi,%eax
shl    $0x10,%eax
ret

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

LLVM IR (-O2):
define i32 @detexPack64G16(i32 %0) {
%2 = shl i32 %0, 16
ret i32 %2
}
double pp_sqrt(double n) {}


x86 assembly (clang, -O0):
<pp_sqrt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @pp_sqrt(double %0) {
ret double undef
}
void RTDbgLineAlloc(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgLineAlloc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void signal_catchfunc(int signal) { printf("!! signal caught !!\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"!! signal caught !!\0A\00"
define void @signal_catchfunc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"!! signal caught !!\00"
define void @signal_catchfunc(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
char itoa(num)
int num;
{
  char buf[20];
  sprintf(buf, "%d", num);
  return buf[0];
}


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
movsbl -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
sub    $0x18,%rsp
mov    %edi,%edx
lea    0xee3(%rip),%rsi
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    (%rsp),%al
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define signext i8 @itoa(i32 %0) {
%2 = alloca i32
%3 = alloca [20 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = load i8, i8* %7
ret i8 %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define signext i8 @itoa(i32 %0) {
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, i8*, ...) @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = load i8, i8* %3
ret i8 %5
}
void foo_2_2_2_2_2_2_1_1_1() {}


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

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

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

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