xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int sscanf(char const *, char *, int *);
int /*<<< orphan*/ stderr;
int GetHex(const char *str) {
  int result, value;
  result = sscanf(str, "%x", &value);
  if (result == 1)
    return value;
  else {
    fprintf(stderr, "Some error occurred when parsing options.\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<GetHex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <sscanf@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1166 <GetHex+0x36>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
lea    0xe8d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<GetHex>:
push   %rax
lea    0xec8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    114d <GetHex+0x1d>
mov    0x4(%rsp),%eax
pop    %rcx
ret
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    0xea6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%x\00"
@stderr = global i32 0
@.str.1 = [43 x i8] c"Some error occurred when parsing options.\0A\00"
define i32 @GetHex(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
ret i32 %10
11: ; preds = %1
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
@stderr = global i32 0
@.str.1 = [43 x i8] c"Some error occurred when parsing options.\0A\00"
define i32 @GetHex(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %2
ret i32 %7
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
}
void exceptionHandler(int num, void *addr) {
  extern unsigned char exceptionTable[];
  int index = 6 * (num - 2);
  *((unsigned char **)(&(exceptionTable[index]) + 2)) = (unsigned char *)addr;
}


x86 assembly (clang, -O0):
<exceptionHandler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
imul   $0x6,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdx
movslq -0x14(%rbp),%rcx
mov    0x2ec2(%rip),%rax
mov    %rdx,0x2(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<exceptionHandler>:
lea    (%rdi,%rdi,2),%eax
add    %eax,%eax
add    $0xfffffff4,%eax
cltq
mov    0x2ed7(%rip),%rcx
mov    %rsi,0x2(%rcx,%rax,1)
ret

LLVM IR (-O0):
@exceptionTable = external global [0 x i8]
define void @exceptionHandler(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %6, 2
%8 = mul nsw i32 6, %7
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [0 x i8], [0 x i8]* @exceptionTable, i64 0, i64 %11
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = bitcast i8* %13 to i8**
store i8* %9, i8** %14
ret void
}

LLVM IR (-O2):
@exceptionTable = external global [0 x i8]
define void @exceptionHandler(i32 %0, i8* %1) {
%3 = mul i32 %0, 6
%4 = add i32 %3, -12
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [0 x i8], [0 x i8]* @exceptionTable, i64 0, i64 %5
%7 = getelementptr inbounds i8, i8* %6, i64 2
%8 = bitcast i8* %7 to i8**
store i8* %1, i8** %8
ret void
}
void _Locale_codecvt_destroy(struct _Locale_codecvt *lcodecvt
                             __attribute__((__unused__))) {}


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

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

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

LLVM IR (-O2):
%struct._Locale_codecvt = type opaque
define void @_Locale_codecvt_destroy(%struct._Locale_codecvt* nocapture %0) {
ret void
}
void miniggsn_delete_pdp_ctx(struct sgsn_pdp_ctx *pctx) {}


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

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

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

LLVM IR (-O2):
%struct.sgsn_pdp_ctx = type opaque
define void @miniggsn_delete_pdp_ctx(%struct.sgsn_pdp_ctx* nocapture %0) {
ret void
}
void set_PDSGridType(unsigned char *pds, int n) { pds[6] = n; }


x86 assembly (clang, -O0):
<set_PDSGridType>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x6(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_PDSGridType>:
mov    %sil,0x6(%rdi)
ret

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

LLVM IR (-O2):
define void @set_PDSGridType(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %3, i8* %4
ret void
}
char *yr_strdup(const char *str) {
  void *result = strdup(str);
  return result;
}


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

x86 assembly (clang, -O2):
<yr_strdup>:
jmp    1030 <strdup@plt>

LLVM IR (-O0):
define i8* @yr_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @yr_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Variables and functions */
double const sqrt(double);
__attribute__((visibility("default"))) const double xsqrt(double d) {
  return sqrt(d);
}


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

x86 assembly (clang, -O2):
<xsqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <xsqrt+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @xsqrt(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
off_t fxt_block_align(int fd) {
  off_t start;
  if ((start = lseek(fd, 0, SEEK_CUR)) < 0) {
    perror("lseek getting current position");
    exit(EXIT_FAILURE);
  }
  return start;
}


x86 assembly (clang, -O0):
<fxt_block_align>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1174 <fxt_block_align+0x44>
lea    0xe9f(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fxt_block_align>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
test   %eax,%eax
js     1147 <fxt_block_align+0x17>
pop    %rcx
ret
lea    0xeb2(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SEEK_CUR = global i32 0
@.str = [31 x i8] c"lseek getting current position\00"
@EXIT_FAILURE = global i32 0
define i32 @fxt_block_align(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @SEEK_CUR
%6 = call i32 @lseek(i32 %4, i32 0, i32 %5)
store i32 %6, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
@.str = [31 x i8] c"lseek getting current position\00"
@EXIT_FAILURE = global i32 0
define i32 @fxt_block_align(i32 %0) {
%2 = load i32, i32* @SEEK_CUR
%3 = tail call i32 @lseek(i32 %0, i32 0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i32 %3
}
unsigned xrop3_120_1_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;
  stk1 = T ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_120_1_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    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_120_1_1>:
mov    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_120_1_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* %7
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = xor i32 %29, -1
%31 = and i32 %28, %30
%32 = load i32, i32* %7
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = and i32 %35, %36
%38 = or i32 %34, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %7
%41 = and i32 %39, %40
%42 = or i32 %38, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @xrop3_120_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}
int is_letter(char c) {
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}


x86 assembly (clang, -O0):
<is_letter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <is_letter+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <is_letter+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <is_letter+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_letter>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_letter(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_letter(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned xrop3_48_1_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 = ~S;
  stk1 = T & stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_48_1_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    -0xc(%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
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_48_1_1>:
mov    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_48_1_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* %6
%23 = xor i32 %22, -1
store i32 %23, i32* %9
%24 = load i32, i32* %7
%25 = load i32, i32* %9
%26 = and i32 %24, %25
store i32 %26, i32* %8
%27 = load i32, i32* %8
%28 = load i32, i32* %6
%29 = xor i32 %28, -1
%30 = and i32 %27, %29
%31 = load i32, i32* %7
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = and i32 %34, %35
%37 = or i32 %33, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %7
%40 = and i32 %38, %39
%41 = or i32 %37, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @xrop3_48_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}
void drm_mem_init(void) {}


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

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

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

LLVM IR (-O2):
define void @drm_mem_init() {
ret void
}
unsigned int strv_length(char *const *l) {
  unsigned int n = 0;
  if (!l)
    return 0;
  for (; *l; l++)
    n++;
  return n;
}


x86 assembly (clang, -O0):
<strv_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1126 <strv_length+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1159 <strv_length+0x59>
jmp    112b <strv_length+0x2b>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1153 <strv_length+0x53>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    112b <strv_length+0x2b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strv_length>:
xor    %eax,%eax
test   %rdi,%rdi
je     111c <strv_length+0x1c>
cmpq   $0x0,(%rdi)
je     111c <strv_length+0x1c>
xor    %eax,%eax
nop
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <strv_length+0x10>
ret

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

LLVM IR (-O2):
define i32 @strv_length(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8** [ %10, %6 ], [ %0, %3 ]
%9 = add i32 %7, 1
%10 = getelementptr inbounds i8*, i8** %8, i64 1
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %9, %6 ]
ret i32 %14
}
/* Variables and functions */
int strcmp(char *, char *);
int string_cmp(const void *a, const void *b) {
  return strcmp(*(char **)a, *(char **)b);
}


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

x86 assembly (clang, -O2):
<string_cmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @string_cmp(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 i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @string_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
void OBJ_NAME_remove(void) {}


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

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

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

LLVM IR (-O2):
define void @OBJ_NAME_remove() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ flag_either_pass(char *, char *);
void stop() {
  flag_either_pass("", "line too long");
  exit(0);
}


x86 assembly (clang, -O0):
<stop>:
push   %rbp
mov    %rsp,%rbp
lea    0xee2(%rip),%rdi
lea    0xece(%rip),%rsi
call   1030 <flag_either_pass@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<stop>:
push   %rax
lea    0xee5(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1030 <flag_either_pass@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [14 x i8] c"line too long\00"
define void @stop() {
%1 = call i32 @flag_either_pass(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [14 x i8] c"line too long\00"
define void @stop() {
%1 = tail call i32 @flag_either_pass(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void mex_lirc_init(void) {}


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

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

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

LLVM IR (-O2):
define void @mex_lirc_init() {
ret void
}
/* Type definitions */
struct mm_array {
  int dummy;
};

/* Variables and functions */
int mm_array_push_back2(struct mm_array *, void *, int);
int mm_array_push_back(struct mm_array *mar, void *element) {
  return mm_array_push_back2(mar, element, 1);
}


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

x86 assembly (clang, -O2):
<mm_array_push_back>:
mov    $0x1,%edx
jmp    1030 <mm_array_push_back2@plt>

LLVM IR (-O0):
%struct.mm_array = type { i32 }
define i32 @mm_array_push_back(%struct.mm_array* %0, i8* %1) {
%3 = alloca %struct.mm_array*
%4 = alloca i8*
store %struct.mm_array* %0, %struct.mm_array** %3
store i8* %1, i8** %4
%5 = load %struct.mm_array*, %struct.mm_array** %3
%6 = load i8*, i8** %4
%7 = call i32 @mm_array_push_back2(%struct.mm_array* %5, i8* %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
%struct.mm_array = type { i32 }
define i32 @mm_array_push_back(%struct.mm_array* %0, i8* %1) {
%3 = tail call i32 @mm_array_push_back2(%struct.mm_array* %0, i8* %1, i32 1)
ret i32 %3
}
/* Variables and functions */
char getchar();
void br() {
  while (getchar() != '\n')
    ;
}


x86 assembly (clang, -O0):
<br>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <br+0x9>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1131 <br+0x21>
jmp    1119 <br+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<br>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <br+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @br() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @br() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ liftAtTarget(int);
void liftWaitTarget(int threshold) {
  while (!liftAtTarget(threshold))
    delay(10);
}


x86 assembly (clang, -O0):
<liftWaitTarget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <liftAtTarget@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1148 <liftWaitTarget+0x28>
jmp    1157 <liftWaitTarget+0x37>
mov    $0xa,%edi
call   1030 <delay@plt>
jmp    112b <liftWaitTarget+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<liftWaitTarget>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1040 <liftAtTarget@plt>
test   %eax,%eax
jne    1147 <liftWaitTarget+0x27>
mov    $0xa,%edi
call   1030 <delay@plt>
mov    %ebx,%edi
jmp    1130 <liftWaitTarget+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @liftWaitTarget(i32 %0) {
%2 = tail call i32 @liftAtTarget(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1, %4
%5 = tail call i32 @delay(i32 10)
%6 = tail call i32 @liftAtTarget(i32 %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int *p;
  p = (int *)malloc(sizeof(int));
  scanf("%d", p);
  printf("%d", *p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xeb8(%rip),%r14
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <scanf@plt>
mov    (%rbx),%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int *xmalloc(int);
int *int_new(int value) {
  int *self = xmalloc(sizeof(int));
  *self = value;
  return self;
}


x86 assembly (clang, -O0):
<int_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_new>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <xmalloc@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @int_new(i32 %0) {
%2 = tail call i32* @xmalloc(i32 4)
store i32 %0, i32* %2
ret i32* %2
}
int getBit(const unsigned short *bitStr, const int bitPos) {
  return !!(bitStr[bitPos >> 4] & (0x8000 >> (bitPos & 15)));
}


x86 assembly (clang, -O0):
<getBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x4,%ecx
movslq %ecx,%rcx
movzwl (%rax,%rcx,2),%eax
mov    -0xc(%rbp),%ecx
and    $0xf,%ecx
mov    $0x8000,%edx
sar    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBit>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x4,%eax
cltq
movzwl (%rdi,%rax,2),%eax
and    $0xf,%cl
shl    %cl,%eax
movzwl %ax,%eax
shr    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @getBit(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
store i16* %0, i16** %3
store i32 %1, i32* %4
%5 = load i16*, i16** %3
%6 = load i32, i32* %4
%7 = ashr i32 %6, 4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i16, i16* %5, i64 %8
%10 = load i16, i16* %9
%11 = zext i16 %10 to i32
%12 = load i32, i32* %4
%13 = and i32 %12, 15
%14 = ashr i32 32768, %13
%15 = and i32 %11, %14
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @getBit(i16* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 4
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i16, i16* %0, i64 %4
%6 = load i16, i16* %5
%7 = zext i16 %6 to i32
%8 = and i32 %1, 15
%9 = lshr i32 32768, %8
%10 = and i32 %9, %7
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
int aster(int red, int green, int blue) {
  int bright = (3 * red + 5 * green + 2 * blue) / 10;
  red = 255 * red / bright;
  green = 255 * green / bright;
  blue = 255 * (blue - 127) / bright;
  return red + green + blue;
}


x86 assembly (clang, -O0):
<aster>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x3,-0x4(%rbp),%eax
imul   $0x5,-0x8(%rbp),%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
imul   $0xff,-0x4(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x4(%rbp)
imul   $0xff,-0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x7f,%eax
imul   $0xff,%eax,%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aster>:
mov    %edx,%r8d
lea    (%rdi,%rdi,2),%eax
lea    (%rsi,%rsi,4),%ecx
add    %eax,%ecx
lea    (%rcx,%r8,2),%eax
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x22,%rcx
add    %eax,%ecx
mov    %edi,%eax
shl    $0x8,%eax
sub    %edi,%eax
cltd
idiv   %ecx
mov    %eax,%edi
mov    %esi,%eax
shl    $0x8,%eax
sub    %esi,%eax
cltd
idiv   %ecx
mov    %eax,%esi
mov    %r8d,%eax
shl    $0x8,%eax
sub    %r8d,%eax
add    $0xffff817f,%eax
cltd
idiv   %ecx
add    %edi,%esi
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @aster(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = mul nsw i32 3, %8
%10 = load i32, i32* %5
%11 = mul nsw i32 5, %10
%12 = add nsw i32 %9, %11
%13 = load i32, i32* %6
%14 = mul nsw i32 2, %13
%15 = add nsw i32 %12, %14
%16 = sdiv i32 %15, 10
store i32 %16, i32* %7
%17 = load i32, i32* %4
%18 = mul nsw i32 255, %17
%19 = load i32, i32* %7
%20 = sdiv i32 %18, %19
store i32 %20, i32* %4
%21 = load i32, i32* %5
%22 = mul nsw i32 255, %21
%23 = load i32, i32* %7
%24 = sdiv i32 %22, %23
store i32 %24, i32* %5
%25 = load i32, i32* %6
%26 = sub nsw i32 %25, 127
%27 = mul nsw i32 255, %26
%28 = load i32, i32* %7
%29 = sdiv i32 %27, %28
store i32 %29, i32* %6
%30 = load i32, i32* %4
%31 = load i32, i32* %5
%32 = add nsw i32 %30, %31
%33 = load i32, i32* %6
%34 = add nsw i32 %32, %33
ret i32 %34
}

LLVM IR (-O2):
define i32 @aster(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 3
%5 = mul nsw i32 %1, 5
%6 = add nsw i32 %5, %4
%7 = shl nsw i32 %2, 1
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %8, 10
%10 = mul nsw i32 %0, 255
%11 = sdiv i32 %10, %9
%12 = mul nsw i32 %1, 255
%13 = sdiv i32 %12, %9
%14 = mul i32 %2, 255
%15 = add i32 %14, -32385
%16 = sdiv i32 %15, %9
%17 = add nsw i32 %13, %11
%18 = add nsw i32 %17, %16
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int square_digits(int);
int main(void) {
  int sum = 0;
  int i;
  for (i = 2; i < 354295; ++i) {
    if (i == square_digits(i))
      sum += i;
  }
  printf("%d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x567f7,-0xc(%rbp)
jge    1181 <main+0x61>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <square_digits@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jne    116e <main+0x4e>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1173 <main+0x53>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
mov    $0x2,%ebp
jmp    113d <main+0x1d>
nopl   0x0(%rax)
add    %ecx,%ebx
add    $0x1,%ebp
cmp    $0x567f7,%ebp
je     114e <main+0x2e>
mov    %ebp,%edi
call   1040 <square_digits@plt>
mov    %ebp,%ecx
cmp    %eax,%ebp
je     1130 <main+0x10>
xor    %ecx,%ecx
jmp    1130 <main+0x10>
lea    0xeab(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 2, %0 ], [ %8, %1 ]
%3 = phi i32 [ 0, %0 ], [ %7, %1 ]
%4 = tail call i32 @square_digits(i32 %2)
%5 = icmp eq i32 %2, %4
%6 = select i1 %5, i32 %2, i32 0
%7 = add nuw nsw i32 %6, %3
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 354295
br i1 %9, label %10, label %1
10: ; preds = %1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
R0RX1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if (r0 <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<R0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x28(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
ja     1138 <R0RX1+0x38>
movl   $0x1,-0x4(%rbp)
jmp    113f <R0RX1+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<R0RX1>:
movslq %ecx,%rcx
xor    %eax,%eax
cmp    %edi,(%r9,%rcx,4)
setae  %al
ret

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

LLVM IR (-O2):
define i32 @R0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = icmp uge i32 %9, %0
%11 = zext i1 %10 to i32
ret i32 %11
}
int cairo_code_draw_infamousLogoTrans_get_height() { return 133; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_infamousLogoTrans_get_height() {
ret i32 133
}

LLVM IR (-O2):
define i32 @cairo_code_draw_infamousLogoTrans_get_height() {
ret i32 133
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t dv_int32_t(int32_t a, int32_t b) { return a / b; }


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

x86 assembly (clang, -O2):
<dv_int32_t>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @dv_int32_t(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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @dv_int32_t(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void AVRCP_ResponseSink_RenderingControl_GetMute(struct UPnPService *Service,
                                                 int ErrorCode, void *User,
                                                 int CurrentMute) {
  printf(
      "AVRCP_ Invoke Response: RenderingControl/GetMute[ErrorCode:%d](%d)\r\n",
      ErrorCode, CurrentMute);
}


x86 assembly (clang, -O0):
<AVRCP_ResponseSink_RenderingControl_GetMute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [69 x i8] c"AVRCP_ Invoke Response: RenderingControl/GetMute[ErrorCode:%d](%d)\0D\0A\00"
define void @AVRCP_ResponseSink_RenderingControl_GetMute(%struct.UPnPService* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.UPnPService*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct.UPnPService* %0, %struct.UPnPService** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %8
%11 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [69 x i8] c"AVRCP_ Invoke Response: RenderingControl/GetMute[ErrorCode:%d](%d)\0D\0A\00"
define void @AVRCP_ResponseSink_RenderingControl_GetMute(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %3)
ret void
}
char *langRomTypeMegaSCSI256() { return "256kB MEGA-SCSI"; }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"256kB MEGA-SCSI\00"
define i8* @langRomTypeMegaSCSI256() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [16 x i8] c"256kB MEGA-SCSI\00"
define i8* @langRomTypeMegaSCSI256() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ readPWM(int);
void PWM_ISR_7() { readPWM(7); }


x86 assembly (clang, -O0):
<PWM_ISR_7>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
call   1030 <readPWM@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWM_ISR_7>:
mov    $0x7,%edi
jmp    1030 <readPWM@plt>

LLVM IR (-O0):
define void @PWM_ISR_7() {
%1 = call i32 @readPWM(i32 7)
ret void
}

LLVM IR (-O2):
define void @PWM_ISR_7() {
%1 = tail call i32 @readPWM(i32 7)
ret void
}
void db_open(void) {}


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

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

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

LLVM IR (-O2):
define void @db_open() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct entrustash_h256 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sha3_256(int /*<<< orphan*/ *, int,
                            int /*<<< orphan*/ const *, size_t const);
void SHA3_256(struct entrustash_h256 const *ret, uint8_t const *data,
              size_t const size) {
  sha3_256((uint8_t *)ret, 32, data, size);
}


x86 assembly (clang, -O0):
<SHA3_256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x20,%esi
call   1030 <sha3_256@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA3_256>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x20,%esi
jmp    1030 <sha3_256@plt>

LLVM IR (-O0):
%struct.entrustash_h256 = type { i32 }
define void @SHA3_256(%struct.entrustash_h256* %0, i32* %1, i64 %2) {
%4 = alloca %struct.entrustash_h256*
%5 = alloca i32*
%6 = alloca i64
store %struct.entrustash_h256* %0, %struct.entrustash_h256** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load %struct.entrustash_h256*, %struct.entrustash_h256** %4
%8 = bitcast %struct.entrustash_h256* %7 to i32*
%9 = load i32*, i32** %5
%10 = load i64, i64* %6
%11 = call i32 @sha3_256(i32* %8, i32 32, i32* %9, i64 %10)
ret void
}

LLVM IR (-O2):
%struct.entrustash_h256 = type { i32 }
define void @SHA3_256(%struct.entrustash_h256* %0, i32* %1, i64 %2) {
%4 = getelementptr %struct.entrustash_h256, %struct.entrustash_h256* %0, i64 0, i32 0
%5 = tail call i32 @sha3_256(i32* %4, i32 32, i32* %1, i64 %2)
ret void
}
void __attribute__((visibility("internal"))) lib2_internal(void) {}


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

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

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

LLVM IR (-O2):
define hidden void @lib2_internal() {
ret void
}
void gdk_draw_rgb_image() {}


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

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

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

LLVM IR (-O2):
define void @gdk_draw_rgb_image() {
ret void
}
int main() {
  int z;
  { int x; }
  { int y; }
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int eql(char *s1, char *s2) { return s1 && s2 && !strcmp(s1, s2); }


x86 assembly (clang, -O0):
<eql>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1158 <eql+0x48>
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1158 <eql+0x48>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eql>:
xor    %eax,%eax
test   %rdi,%rdi
je     112f <eql+0x1f>
test   %rsi,%rsi
je     112f <eql+0x1f>
push   %rax
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @eql(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i32 @strcmp(i8* %11, i8* %12)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
br label %16
16: ; preds = %10, %7, %2
%17 = phi i1 [ false, %7 ], [ false, %2 ], [ %15, %10 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @eql(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i32 @strcmp(i8* %0, i8* %1)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ 0, %2 ], [ %9, %6 ]
ret i32 %11
}
XSetSubwindowMode() {}


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

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

LLVM IR (-O0):
define i32 @XSetSubwindowMode() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XSetSubwindowMode() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ bad(char *);
int /*<<< orphan*/ want(int);
need(int type) {
  if (!want(type))
    bad("SYNTAX ERROR");
}


x86 assembly (clang, -O0):
<need>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <want@plt>
cmp    $0x0,%eax
jne    1148 <need+0x28>
lea    0xebd(%rip),%rdi
call   1030 <bad@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<need>:
push   %rax
call   1040 <want@plt>
test   %eax,%eax
je     112c <need+0xc>
pop    %rcx
ret
lea    0xecd(%rip),%rdi
call   1030 <bad@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"SYNTAX ERROR\00"
define i32 @need(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @want(i32 %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @bad(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [13 x i8] c"SYNTAX ERROR\00"
define i32 @need(i32 %0) {
%2 = tail call i32 @want(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @bad(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 undef
}