xunge/DecIR huggingface dataset:
int cmp_lt_uint(const void *p, const void *q) {
  const unsigned int a = *(const unsigned int *)p;
  const unsigned int b = *(const unsigned int *)q;
  do {
    if (a > b)
      return +1;
    if (b > a)
      return -1;
    return 0;
  } while (0);
}


x86 assembly (clang, -O0):
<cmp_lt_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jbe    1136 <cmp_lt_uint+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1155 <cmp_lt_uint+0x55>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jbe    114e <cmp_lt_uint+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <cmp_lt_uint+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_lt_uint>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
cmp    %ecx,%eax
sbb    %edx,%edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovbe %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_lt_uint(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp ugt i32 %4, %6
%8 = icmp ugt i32 %6, %4
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
void _Read_uleb(void) {}


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

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

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

LLVM IR (-O2):
define void @_Read_uleb() {
ret void
}
void free_2d_float(float **p) {
  free(p[0]);
  free(p);
}


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

x86 assembly (clang, -O2):
<free_2d_float>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_2d_float(float** %0) {
%2 = alloca float**
store float** %0, float*** %2
%3 = load float**, float*** %2
%4 = getelementptr inbounds float*, float** %3, i64 0
%5 = load float*, float** %4
%6 = bitcast float* %5 to i8*
%7 = load float**, float*** %2
%8 = bitcast float** %7 to i8*
ret void
}

LLVM IR (-O2):
define void @free_2d_float(float** nocapture %0) {
%2 = bitcast float** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast float** %0 to i8*
tail call void @free(i8* %4)
ret void
}
int test_0x1000011() { return 0x1000011; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x1000011,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x1000011,%eax
ret

LLVM IR (-O0):
define i32 @test_0x1000011() {
ret i32 16777233
}

LLVM IR (-O2):
define i32 @test_0x1000011() {
ret i32 16777233
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *execname) {
  fprintf(stderr, "%s: Use --help for help\n", execname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"%s: Use --help for help\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"%s: Use --help for help\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct timeval {
  unsigned long tv_sec;
  unsigned long long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long long benchmark_us(unsigned long long start) {
  struct timeval tm_current;
  gettimeofday(&tm_current, NULL);
  return 1000000UL * tm_current.tv_sec + tm_current.tv_usec - start;
}


x86 assembly (clang, -O0):
<benchmark_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x18(%rbp),%rax
add    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<benchmark_us>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,(%rsp),%rcx
mov    0x8(%rsp),%rax
sub    %rbx,%rax
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @benchmark_us(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timeval
store i64 %0, i64* %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%6 = load i64, i64* %5
%7 = mul i64 1000000, %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%9 = load i64, i64* %8
%10 = add i64 %7, %9
%11 = load i64, i64* %2
%12 = sub i64 %10, %11
ret i64 %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @benchmark_us(i64 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = mul i64 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%9 = load i64, i64* %8
%10 = sub i64 %9, %0
%11 = add i64 %10, %7
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rabin_karp(char *, char *);
int main(int argc, char *argv[]) {
  int res;
  res = rabin_karp("stupid_spring_string", "string");
  printf("Res=%d\n", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1030 <rabin_karp@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1030 <rabin_karp@plt>
lea    0xeda(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"stupid_spring_string\00"
@.str.1 = [7 x i8] c"string\00"
@.str.2 = [8 x i8] c"Res=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @rabin_karp(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_help() {
  fprintf(stderr,
          "Usage: readenergy [-t PERIOD] -o OUTFILE\n\n"
          "Read Juno energy counters every PERIOD milliseconds, writing them\n"
          "to OUTFILE in CSV format until SIGTERM is received.\n\n"
          "Parameters:\n"
          "	PERIOD is the counter poll period in milliseconds.\n"
          "	       (Defaults to 100 milliseconds.)\n"
          "	OUTFILE is the output file path\n");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [299 x i8] c"Usage: readenergy [-t PERIOD] -o OUTFILE\0A\0ARead Juno energy counters every PERIOD milliseconds, writing them\0Ato OUTFILE in CSV format until SIGTERM is received.\0A\0AParameters:\0A\09PERIOD is the counter poll period in milliseconds.\0A\09 (Defaults to 100 milliseconds.)\0A\09OUTFILE is the output file path\0A\00"
define void @print_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([299 x i8], [299 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [299 x i8] c"Usage: readenergy [-t PERIOD] -o OUTFILE\0A\0ARead Juno energy counters every PERIOD milliseconds, writing them\0Ato OUTFILE in CSV format until SIGTERM is received.\0A\0AParameters:\0A\09PERIOD is the counter poll period in milliseconds.\0A\09 (Defaults to 100 milliseconds.)\0A\09OUTFILE is the output file path\0A\00"
define void @print_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([299 x i8], [299 x i8]* @.str, i64 0, i64 0))
ret void
}
int mswin_majorver() { return (5); }


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

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

LLVM IR (-O0):
define i32 @mswin_majorver() {
ret i32 5
}

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

/* Variables and functions */
unsigned char *haval160_file(unsigned char *, int /*<<< orphan*/ *);
unsigned char *hash_file_haval160(unsigned char *out, FILE *fp) {
  return haval160_file(out, fp);
}


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

x86 assembly (clang, -O2):
<hash_file_haval160>:
jmp    1030 <haval160_file@plt>

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

LLVM IR (-O2):
define i8* @hash_file_haval160(i8* %0, i32* %1) {
%3 = tail call i8* @haval160_file(i8* %0, i32* %1)
ret i8* %3
}
float tm_i2c_Data2Core(unsigned int ans) {
  float t = ans;
  return t / 1023.0 * 3.3;
}


x86 assembly (clang, -O0):
<tm_i2c_Data2Core>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee3(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xecf(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tm_i2c_Data2Core>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xeed(%rip),%xmm0
mulsd  0xeed(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @tm_i2c_Data2Core(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = uitofp i32 %4 to float
store float %5, float* %3
%6 = load float, float* %3
%7 = fpext float %6 to double
%8 = fdiv double %7, 1.023000e+03
%9 = fmul double %8, 3.300000e+00
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @tm_i2c_Data2Core(i32 %0) {
%2 = uitofp i32 %0 to float
%3 = fpext float %2 to double
%4 = fdiv double %3, 1.023000e+03
%5 = fmul double %4, 3.300000e+00
%6 = fptrunc double %5 to float
ret float %6
}
int p1strlen(char *s) {
  char *p = s;
  while (*p != '\0')
    p++;
  return (p - s);
}


x86 assembly (clang, -O0):
<p1strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1131 <p1strlen+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <p1strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<p1strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <p1strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @p1strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
int H264_Decode_Close() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @H264_Decode_Close() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ WriteString(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int strlen(char *);
void getstring(char prompt[], char string[]) {
  WriteString(prompt);
  if (fgets(string, 256, stdin) == NULL)
    exit(0);
  string[strlen(string) - 1] = '\0';
}


x86 assembly (clang, -O0):
<getstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <WriteString@plt>
mov    -0x10(%rbp),%rdi
mov    0x2e84(%rip),%rax
mov    (%rax),%edx
mov    $0x100,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
jne    1181 <getstring+0x41>
xor    %edi,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getstring>:
push   %rbx
mov    %rsi,%rbx
call   1030 <WriteString@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1050 <fgets@plt>
test   %rax,%rax
je     1175 <getstring+0x35>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stdin = global i32 0
define void @getstring(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @WriteString(i8* %5)
%7 = load i8*, i8** %4
%8 = load i32, i32* @stdin
%9 = call i32* @fgets(i8* %7, i32 256, i32 %8)
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = load i8*, i8** %4
%16 = call i32 @strlen(i8* %15)
%17 = sub nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %14, i64 %18
store i8 0, i8* %19
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @getstring(i8* %0, i8* %1) {
%3 = tail call i32 @WriteString(i8* %0)
%4 = load i32, i32* @stdin
%5 = tail call i32* @fgets(i8* %1, i32 256, i32 %4)
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %2
%10 = tail call i32 @strlen(i8* %1)
%11 = add nsw i32 %10, -1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %1, i64 %12
store i8 0, i8* %13
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *malloc_and_null_check(size_t size) {
  void *tmp = malloc(size);
  if (!tmp) {
    ;
  }
  return tmp;
}


x86 assembly (clang, -O0):
<malloc_and_null_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1139 <malloc_and_null_check+0x29>
jmp    1139 <malloc_and_null_check+0x29>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_and_null_check>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @malloc_and_null_check(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int bar();
int __attribute__((no, noclone)) foo() { return bar(); }


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = call i32 (...) @bar()
ret i32 %1
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @bar()
ret i32 %1
}
/* Variables and functions */
int number_occurrences_char(char, char *);
int timlib_delimiter_count(char *source, char delimiter) {
  return number_occurrences_char(delimiter, source);
}


x86 assembly (clang, -O0):
<timlib_delimiter_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1030 <number_occurrences_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timlib_delimiter_count>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %rax,%rsi
jmp    1030 <number_occurrences_char@plt>

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

LLVM IR (-O2):
define i32 @timlib_delimiter_count(i8* %0, i8 signext %1) {
%3 = tail call i32 @number_occurrences_char(i8 signext %1, i8* %0)
ret i32 %3
}
void EchoP$Leds$led0On(void) { LedsP$Leds$led0On(); }


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

x86 assembly (clang, -O2):
<EchoP$Leds$led0On>:
xor    %eax,%eax
jmp    1030 <LedsP$Leds$led0On@plt>

LLVM IR (-O0):
define void @"EchoP$Leds$led0On"() {
%1 = call i32 (...) @"LedsP$Leds$led0On"()
ret void
}

LLVM IR (-O2):
define void @"EchoP$Leds$led0On"() {
%1 = tail call i32 (...) @"LedsP$Leds$led0On"()
ret void
}
void rx_free_unfaniverse(struct rx_unfaniverse *it) {}


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

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

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

LLVM IR (-O2):
%struct.rx_unfaniverse = type opaque
define void @rx_free_unfaniverse(%struct.rx_unfaniverse* nocapture %0) {
ret void
}
void gtk_image_get_stock() {}


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

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

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

LLVM IR (-O2):
define void @gtk_image_get_stock() {
ret void
}
int valid_monthday(int d) { return (d >= 1 && d <= 31) ? 1 : 0; }


x86 assembly (clang, -O0):
<valid_monthday>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <valid_monthday+0x20>
cmpl   $0x1f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_monthday>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x1f,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @valid_monthday(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 31
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int compare(const void *a, const void *b) { return (*(int *)a - *(int *)b); }


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
unsigned xrop3_143_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & S;
  stk2 = ~stk2;
  stk1 = T & stk2;
  stk1 = ~stk1;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_143_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_143_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
not    %ecx
or     %ecx,%edi
and    %eax,%edi
not    %eax
and    %esi,%eax
or     %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_143_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %7
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = xor i32 %30, -1
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = load i32, i32* %8
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = or i32 %34, %38
%40 = load i32, i32* %7
%41 = load i32, i32* %6
%42 = xor i32 %41, -1
%43 = and i32 %40, %42
%44 = load i32, i32* %5
%45 = and i32 %43, %44
%46 = or i32 %39, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_143_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, -1
%8 = or i32 %7, %3
%9 = and i32 %8, %4
%10 = xor i32 %4, -1
%11 = and i32 %10, %5
%12 = or i32 %11, %7
%13 = or i32 %12, %9
ret i32 %13
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int lfs_npw2(int);
uint32_t lfs_ctz(uint32_t a) { return lfs_npw2((a & -a) + 1) - 1; }


x86 assembly (clang, -O0):
<lfs_ctz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
sub    -0x4(%rbp),%eax
and    %eax,%edi
add    $0x1,%edi
call   1030 <lfs_npw2@plt>
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lfs_ctz>:
push   %rax
mov    %edi,%eax
neg    %eax
and    %eax,%edi
add    $0x1,%edi
call   1030 <lfs_npw2@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lfs_ctz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 0, %4
%6 = and i32 %3, %5
%7 = add nsw i32 %6, 1
%8 = call i32 @lfs_npw2(i32 %7)
%9 = sub nsw i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @lfs_ctz(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = and i32 %2, %0
%4 = add nsw i32 %3, 1
%5 = tail call i32 @lfs_npw2(i32 %4)
%6 = add nsw i32 %5, -1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void test17_head() {
  do {
    printf("test17");
    puts("");
  } while (0);
}


x86 assembly (clang, -O0):
<test17_head>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test17_head+0x9>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test17_head>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"test17\00"
@.str.1 = [1 x i8] zeroinitializer
define void @test17_head() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"test17\00"
define void @test17_head() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
void *memchr(char *, char, int);
int main(int argc, char **buffer) {
  char buf[10] = "01234A678";
  void *ptr;
  if ((ptr = memchr(buf, 'A', 10)) == NULL)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x1a(%rbp)
mov    0xed0(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    -0x1a(%rbp),%rdi
mov    $0x41,%esi
mov    $0xa,%edx
call   1030 <memchr@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1169 <main+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1170 <main+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x3736413433323130,%rax
41 36 37
mov    %rax,0x8(%rsp)
movw   $0x38,0x10(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x41,%esi
mov    $0xa,%edx
call   1030 <memchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.buf = [10 x i8] c"01234A678\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i8]
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [10 x i8]* %6 to i8*
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%10 = call i8* @memchr(i8* %9, i8 signext 65, i32 10)
store i8* %10, i8** %7
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@__const.main.buf = [10 x i8] c"01234A678\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i8* @memchr(i8* %4, i8 signext 65, i32 10)
%6 = icmp eq i8* %5, null
%7 = zext i1 %6 to i32
ret i32 %7
}
void gpio_keypad_active(void) {}


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

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

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

LLVM IR (-O2):
define void @gpio_keypad_active() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_perror(char *);
void my_throttled_perror(char *err_msg) {
  static int uds_throttle_count = 0;
  if ((uds_throttle_count++ % 250) == 0)
    my_perror(err_msg);
}


x86 assembly (clang, -O0):
<my_throttled_perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2f0a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2eff(%rip)
mov    $0xfa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1147 <my_throttled_perror+0x37>
mov    -0x8(%rbp),%rdi
call   1030 <my_perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_throttled_perror>:
mov    0x2f16(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f0d(%rip)
imul   $0x26e978d5,%eax,%eax
add    $0x10624dc,%eax
ror    %eax
cmp    $0x10624dc,%eax
jbe    1134 <my_throttled_perror+0x24>
ret
jmp    1030 <my_perror@plt>

LLVM IR (-O0):
@my_throttled_perror.uds_throttle_count = internal global i32 0
define void @my_throttled_perror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @my_throttled_perror.uds_throttle_count
%4 = add nsw i32 %3, 1
store i32 %4, i32* @my_throttled_perror.uds_throttle_count
%5 = srem i32 %3, 250
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @my_perror(i8* %8)
br label %10
10: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@my_throttled_perror.uds_throttle_count = internal unnamed_addr global i32 0
define void @my_throttled_perror(i8* %0) {
%2 = load i32, i32* @my_throttled_perror.uds_throttle_count
%3 = add nsw i32 %2, 1
store i32 %3, i32* @my_throttled_perror.uds_throttle_count
%4 = srem i32 %2, 250
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @my_perror(i8* %0)
br label %8
8: ; preds = %6, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void _write_int(FILE *f, int i) {
  fprintf(f, "%c", i & 0xff);
  fprintf(f, "%c", (i >> 8) & 0xff);
  fprintf(f, "%c", (i >> 16) & 0xff);
  fprintf(f, "%c", (i >> 24) & 0xff);
}


x86 assembly (clang, -O0):
<_write_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
and    $0xff,%edx
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sar    $0x8,%edx
and    $0xff,%edx
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sar    $0x10,%edx
and    $0xff,%edx
lea    0xe95(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sar    $0x18,%edx
and    $0xff,%edx
lea    0xe79(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write_int>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
movzbl %bl,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
movzbl %bh,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
shr    $0x18,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @_write_int(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 = and i32 %6, 255
%8 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = ashr i32 %10, 8
%12 = and i32 %11, 255
%13 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32*, i32** %3
%15 = load i32, i32* %4
%16 = ashr i32 %15, 16
%17 = and i32 %16, 255
%18 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = load i32*, i32** %3
%20 = load i32, i32* %4
%21 = ashr i32 %20, 24
%22 = and i32 %21, 255
%23 = call i32 @fprintf(i32* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %22)
ret void
}

LLVM IR (-O2):
define void @_write_int(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i32 @fputc(i32 %3, i32* %0)
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = tail call i32 @fputc(i32 %6, i32* %0)
%8 = lshr i32 %1, 16
%9 = and i32 %8, 255
%10 = tail call i32 @fputc(i32 %9, i32* %0)
%11 = lshr i32 %1, 24
%12 = tail call i32 @fputc(i32 %11, i32* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ y;
};
typedef TYPE_1__ XConfigureRequestEvent;

/* Variables and functions */
int get_XConfigureRequestEvent_y(void *_p) {
  return (int)((XConfigureRequestEvent *)_p)->y;
}


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

x86 assembly (clang, -O2):
<get_XConfigureRequestEvent_y>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XConfigureRequestEvent_y(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XConfigureRequestEvent_y(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int is_shell_var(char c) {
  int state = 34;
  switch (c) {
  case '?':
    break;
  case '$':
    break;
  case '=':
    break;
  default:
    state = 0;
  }
  return state;
}


x86 assembly (clang, -O0):
<is_shell_var>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x22,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x24,%eax
je     114d <is_shell_var+0x4d>
jmp    1126 <is_shell_var+0x26>
mov    -0xc(%rbp),%eax
sub    $0x3d,%eax
je     1152 <is_shell_var+0x52>
jmp    1137 <is_shell_var+0x37>
mov    -0xc(%rbp),%eax
sub    $0x3f,%eax
jne    1157 <is_shell_var+0x57>
jmp    1148 <is_shell_var+0x48>
jmp    115e <is_shell_var+0x5e>
jmp    115e <is_shell_var+0x5e>
jmp    115e <is_shell_var+0x5e>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_shell_var>:
cmp    $0x3f,%edi
ja     111d <is_shell_var+0x1d>
mov    $0x22,%eax
mov    %edi,%ecx
movabs $0xa000001000000000,%rdx
bt     %rcx,%rdx
jae    111d <is_shell_var+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_shell_var(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 34, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 63, label %6
i32 36, label %7
i32 61, label %8
]
6: ; preds = %1
br label %10
7: ; preds = %1
br label %10
8: ; preds = %1
br label %10
9: ; preds = %1
store i32 0, i32* %3
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_shell_var(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 63, label %4
i32 36, label %4
i32 61, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %3, %1, %1, %1
%5 = phi i32 [ 0, %3 ], [ 34, %1 ], [ 34, %1 ], [ 34, %1 ]
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ notimplemented(char *);
void __svgalib_driver32p_putboxmask(int x, int y, int w, int h, void *b) {
  {
    notimplemented("32-bit paged putboxmask");
    return;
  };
}


x86 assembly (clang, -O0):
<__svgalib_driver32p_putboxmask>:
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)
lea    0xed1(%rip),%rdi
call   1030 <notimplemented@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"32-bit paged putboxmask\00"
define void @__svgalib_driver32p_putboxmask(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = call i32 @notimplemented(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"32-bit paged putboxmask\00"
define void @__svgalib_driver32p_putboxmask(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4) {
%6 = tail call i32 @notimplemented(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int LOG_INFO;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stderr;
void log_output(int priority, char *message) {
  if (priority != LOG_INFO)
    fprintf(stderr, "%s\n", message);
  else
    printf("%s", message);
}


x86 assembly (clang, -O0):
<log_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e9f(%rip),%rcx
cmp    (%rcx),%eax
je     115f <log_output+0x3f>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeab(%rip),%rsi
call   1040 <fprintf@plt>
jmp    116f <log_output+0x4f>
mov    -0x10(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_output>:
mov    %rsi,%rdx
mov    0x2eae(%rip),%rax
cmp    %edi,(%rax)
jne    113d <log_output+0x1d>
lea    0xecf(%rip),%rdi
mov    %rdx,%rsi
jmp    1030 <printf@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@LOG_INFO = global i32 0
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @log_output(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @LOG_INFO
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %4
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %15
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %12, %8
ret void
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @log_output(i32 %0, i8* %1) {
%3 = load i32, i32* @LOG_INFO
%4 = icmp eq i32 %3, %0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %10
8: ; preds = %2
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %10
10: ; preds = %8, %5
ret void
}
int byte_col_gbk2(int byte) {
  if (byte >= 0x40 && byte < 0x7f)
    return byte - 0x40;
  else if (byte >= 0x80 && byte < 0xa1)
    return byte - 0x41;
  else
    return -1;
}


x86 assembly (clang, -O0):
<byte_col_gbk2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x40,-0x8(%rbp)
jl     1129 <byte_col_gbk2+0x29>
cmpl   $0x7f,-0x8(%rbp)
jge    1129 <byte_col_gbk2+0x29>
mov    -0x8(%rbp),%eax
sub    $0x40,%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <byte_col_gbk2+0x58>
cmpl   $0x80,-0x8(%rbp)
jl     1151 <byte_col_gbk2+0x51>
cmpl   $0xa1,-0x8(%rbp)
jge    1151 <byte_col_gbk2+0x51>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <byte_col_gbk2+0x58>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_col_gbk2>:
lea    -0x80(%rdi),%eax
lea    -0x41(%rdi),%ecx
cmp    $0x21,%eax
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
lea    -0x40(%rdi),%ecx
cmp    $0x3f,%ecx
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @byte_col_gbk2(i32 %0) {
%2 = add i32 %0, -64
%3 = icmp ult i32 %2, 63
%4 = add i32 %0, -128
%5 = icmp ult i32 %4, 33
%6 = add nsw i32 %0, -65
%7 = select i1 %5, i32 %6, i32 -1
%8 = select i1 %3, i32 %2, i32 %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_srai_epi32(int /*<<< orphan*/, int);
__m128i test_mm_srai_epi32_1(__m128i A) { return _mm_srai_epi32(A, -1); }


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

x86 assembly (clang, -O2):
<test_mm_srai_epi32_1>:
mov    $0xffffffff,%esi
jmp    1030 <_mm_srai_epi32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_srai_epi32_1(i32 %0) {
%2 = tail call i32 @_mm_srai_epi32(i32 %0, i32 -1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ pollen_hardware_Led_off__E();
void pollen_hardware_Led_targetInit__I() { pollen_hardware_Led_off__E(); }


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

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

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

LLVM IR (-O2):
define void @pollen_hardware_Led_targetInit__I() {
%1 = tail call i32 (...) @pollen_hardware_Led_off__E()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HelloTypeReleaseObject(void *);
void HelloTypeFree(void *value) { HelloTypeReleaseObject(value); }


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

x86 assembly (clang, -O2):
<HelloTypeFree>:
jmp    1030 <HelloTypeReleaseObject@plt>

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

LLVM IR (-O2):
define void @HelloTypeFree(i8* %0) {
%2 = tail call i32 @HelloTypeReleaseObject(i8* %0)
ret void
}