xunge/DecIR huggingface dataset:
int update_bit(int num, int i, int v) {
  if (v)
    num |= (1 << i);
  else
    num &= ~(1 << i);
  return num;
}


x86 assembly (clang, -O0):
<update_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     112c <update_bit+0x2c>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113f <update_bit+0x3f>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_bit>:
mov    %edi,%eax
bts    %esi,%eax
btr    %esi,%edi
test   %edx,%edx
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @update_bit(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = shl nuw i32 1, %1
%6 = or i32 %5, %0
%7 = xor i32 %5, -1
%8 = and i32 %7, %0
%9 = select i1 %4, i32 %8, i32 %6
ret i32 %9
}
/* Variables and functions */
int detectPresence(char *);
scalar_t__ graphicMode();
int kdialogPresent() {
  static int lKdialogPresent = -1;
  if (lKdialogPresent < 0) {
    lKdialogPresent = detectPresence("kdialog");
  }
  return lKdialogPresent && graphicMode();
}


x86 assembly (clang, -O0):
<kdialogPresent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f01(%rip)
jge    1147 <kdialogPresent+0x27>
lea    0xec4(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2ee9(%rip)
xor    %eax,%eax
cmpl   $0x0,0x2ee0(%rip)
mov    %al,-0x1(%rbp)
je     116a <kdialogPresent+0x4a>
mov    $0x0,%al
call   1030 <graphicMode@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kdialogPresent>:
push   %rax
mov    0x2f09(%rip),%eax
test   %eax,%eax
js     1143 <kdialogPresent+0x23>
test   %eax,%eax
je     1159 <kdialogPresent+0x39>
xor    %eax,%eax
call   1030 <graphicMode@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2edb(%rip)
test   %eax,%eax
jne    112f <kdialogPresent+0xf>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@kdialogPresent.lKdialogPresent = internal global i32 -1
@.str = [8 x i8] c"kdialog\00"
define i32 @kdialogPresent() {
%1 = load i32, i32* @kdialogPresent.lKdialogPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @detectPresence(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @kdialogPresent.lKdialogPresent
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @kdialogPresent.lKdialogPresent
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@kdialogPresent.lKdialogPresent = internal unnamed_addr global i32 -1
@.str = [8 x i8] c"kdialog\00"
define i32 @kdialogPresent() {
%1 = load i32, i32* @kdialogPresent.lKdialogPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @detectPresence(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @kdialogPresent.lKdialogPresent
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = tail call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ 0, %5 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ cli_conn_server(int, char *, unsigned short);
int init_sock(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int cli_init(char *ip, unsigned short port) {
  int fd;
  printf("Client init\n");
  fd = init_sock(SOCK_STREAM);
  cli_conn_server(fd, ip, port);
  return fd;
}


x86 assembly (clang, -O0):
<cli_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1030 <init_sock@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rsi
movzwl -0xa(%rbp),%edx
call   1050 <cli_conn_server@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_init>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1030 <init_sock@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1050 <cli_conn_server@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Client init\0A\00"
@SOCK_STREAM = global i32 0
define i32 @cli_init(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i32
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @SOCK_STREAM
%8 = call i32 @init_sock(i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i8*, i8** %3
%11 = load i16, i16* %4
%12 = call i32 @cli_conn_server(i32 %9, i8* %10, i16 zeroext %11)
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
@SOCK_STREAM = global i32 0
@str = [12 x i8] c"Client init\00"
define i32 @cli_init(i8* %0, i16 zeroext %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @SOCK_STREAM
%5 = tail call i32 @init_sock(i32 %4)
%6 = tail call i32 @cli_conn_server(i32 %5, i8* %0, i16 zeroext %1)
ret i32 %5
}
void bla_free(struct bat_priv *bat_priv) {}


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

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

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

LLVM IR (-O2):
%struct.bat_priv = type opaque
define void @bla_free(%struct.bat_priv* nocapture %0) {
ret void
}
void CFGMR3QueryU32Def(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3QueryU32Def() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void uv25() {
  printf("\nLowering CPU VDD Voltage by 25mV\n");
  char buf[256];
  sprintf(
      buf, "/system/bin/sh -c %s",
      "'echo -25000 > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels'");
  system(buf);
}


x86 assembly (clang, -O0):
<uv25>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    -0x100(%rbp),%rdi
lea    0xece(%rip),%rsi
lea    0xedc(%rip),%rdx
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uv25>:
push   %rbx
sub    $0x100,%rsp
lea    0xf1b(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"\0ALowering CPU VDD Voltage by 25mV\0A\00"
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [69 x i8] c"'echo -25000 > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels'\00"
define void @uv25() {
%1 = alloca [256 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0))
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = call i32 @system(i8* %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [69 x i8] c"'echo -25000 > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels'\00"
@str = [34 x i8] c"\0ALowering CPU VDD Voltage by 25mV\00"
define void @uv25() {
%1 = alloca [256 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @system(i8* %3)
ret void
}
int abs(int i) { return i >= 0 ? i : -i; }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111c <abs+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int a = 1, b = 1;
  int a_post, pre_b;
  a_post = a++;
  pre_b = ++b;
  printf("a  a_post  b  pre_b\n");
  printf("%ld %5ld %5d %5d\n", a, a_post, b, pre_b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x14(%rbp)
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x2,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"a a_post b pre_b\0A\00"
@.str.1 = [18 x i8] c"%ld %5ld %5d %5d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 1, i32* %3
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
store i32 %6, i32* %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
store i32 %9, i32* %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %2
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12, i32 %13, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"%ld %5ld %5d %5d\0A\00"
@str = [20 x i8] c"a a_post b pre_b\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 1, i32 2, i32 2)
ret i32 0
}
void X509_alias_get0(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_alias_get0() {
ret void
}
int do_509() { return 509; }


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

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

LLVM IR (-O0):
define i32 @do_509() {
ret i32 509
}

LLVM IR (-O2):
define i32 @do_509() {
ret i32 509
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ replace(char *, int);
int main() {
  char s[25] = "you are a loser.";
  replace(s, 16);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec9(%rip),%al
mov    %al,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x10,%esi
call   1040 <replace@plt>
lea    -0x20(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xedd(%rip),%xmm0
movups %xmm0,0x9(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1040 <replace@plt>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [25 x i8] c"you are a loser.\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = bitcast [25 x i8]* %1 to i8*
%3 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%4 = call i32 @replace(i8* %3, i32 16)
%5 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [25 x i8] c"you are a loser.\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%3 = call i32 @replace(i8* %2, i32 16)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage_error(char **argv) {
  fprintf(stderr, "usage: %s {export|unexport} <gpio>\n", argv[0]);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"usage: %s {export|unexport} <gpio>\0A\00"
define void @usage_error(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"usage: %s {export|unexport} <gpio>\0A\00"
define void @usage_error(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ glWindowPos4f(int const, int const, int /*<<< orphan*/, int);
void glWindowPos2iv(const int v[2]) { glWindowPos4f(v[0], v[1], 0, 1); }


x86 assembly (clang, -O0):
<glWindowPos2iv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <glWindowPos4f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glWindowPos2iv>:
mov    (%rdi),%eax
mov    0x4(%rdi),%esi
mov    %eax,%edi
xor    %edx,%edx
mov    $0x1,%ecx
jmp    1030 <glWindowPos4f@plt>

LLVM IR (-O0):
define void @glWindowPos2iv(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = call i32 @glWindowPos4f(i32 %5, i32 %8, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @glWindowPos2iv(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = tail call i32 @glWindowPos4f(i32 %2, i32 %4, i32 0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, char *);
int /*<<< orphan*/ pthread_self();
void *thread_func(void *param) {
  printf("thread id: %lu\tparam: %s\n", pthread_self(), (char *)param);
}


x86 assembly (clang, -O0):
<thread_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_func>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"thread id: %lu\09param: %s\0A\00"
define i8* @thread_func(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @pthread_self()
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %5)
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
@.str = [26 x i8] c"thread id: %lu\09param: %s\0A\00"
define noalias i8* @thread_func(i8* %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %0)
ret i8* undef
}
void fc75(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      goto a;
      0;
    };
    typedef int(*e)[n];
    0;
  };
a : {
  typedef int(*f)[n];
  {
    typedef int(*g)[n];
    0;
  };
  {
    typedef int(*h)[n];
    0;
  };
  ;
  typedef int(*i)[n];
  0;
};
  ;
  typedef int(*j)[n];
  0;
}


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

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

LLVM IR (-O0):
define void @fc75(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
br label %12
9: ; No predecessors!
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc75(i32 %0) {
ret void
}
double mapd(double val, double min1, double max1, double min2, double max2) {
  return (val - min1) / (max1 - min1) * (max2 - min2) + min2;
}


x86 assembly (clang, -O0):
<mapd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapd>:
subsd  %xmm1,%xmm0
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
subsd  %xmm3,%xmm4
mulsd  %xmm4,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @mapd(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fsub double %11, %12
%14 = load double, double* %8
%15 = load double, double* %7
%16 = fsub double %14, %15
%17 = fdiv double %13, %16
%18 = load double, double* %10
%19 = load double, double* %9
%20 = fsub double %18, %19
%21 = load double, double* %9
%22 = call double @llvm.fmuladd.f64(double %17, double %20, double %21)
ret double %22
}

LLVM IR (-O2):
define double @mapd(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %0, %1
%7 = fsub double %2, %1
%8 = fdiv double %6, %7
%9 = fsub double %4, %3
%10 = tail call double @llvm.fmuladd.f64(double %8, double %9, double %3)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x67() {
  Assert_real((isodigit(103) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              520, ("isodigit should be 0 for g"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x67>:
push   %rbp
mov    %rsp,%rbp
mov    $0x67,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x208,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x67>:
push   %rax
mov    $0x67,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x208,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for g\00"
define void @t_isodigit_0x67() {
%1 = call i64 @isodigit(i32 103)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 520, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for g\00"
define void @t_isodigit_0x67() {
%1 = tail call i64 @isodigit(i32 103)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 520, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
float sqrt(int);
float etr_high_side(float side) {
  float square_root_3 = sqrt(3);
  float high = side * square_root_3 / 2;
  return high;
}


x86 assembly (clang, -O0):
<etr_high_side>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x3,%edi
call   1030 <sqrt@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xec2(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<etr_high_side>:
push   %rax
movss  %xmm0,0x4(%rsp)
mov    $0x3,%edi
call   1030 <sqrt@plt>
mulss  0x4(%rsp),%xmm0
mulss  0xed1(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @etr_high_side(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
%5 = call float @sqrt(i32 3)
store float %5, float* %3
%6 = load float, float* %2
%7 = load float, float* %3
%8 = fmul float %6, %7
%9 = fdiv float %8, 2.000000e+00
store float %9, float* %4
%10 = load float, float* %4
ret float %10
}

LLVM IR (-O2):
define float @etr_high_side(float %0) {
%2 = tail call float @sqrt(i32 3)
%3 = fmul float %2, %0
%4 = fmul float %3, 5.000000e-01
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ start_recording();
void sigusr1(int num) { start_recording(); }


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

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

LLVM IR (-O0):
define void @sigusr1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @start_recording()
ret void
}

LLVM IR (-O2):
define void @sigusr1(i32 %0) {
%2 = tail call i32 (...) @start_recording()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ wiznetRegWriteByte(int /*<<< orphan*/, int,
                                      int /*<<< orphan*/);
void wiznetSetSocketTypeOfService(uint8_t socket, uint8_t tos) {
  wiznetRegWriteByte(socket, (0x0000 + 0x0015), tos);
}


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

x86 assembly (clang, -O2):
<wiznetSetSocketTypeOfService>:
mov    %esi,%edx
mov    $0x15,%esi
jmp    1030 <wiznetRegWriteByte@plt>

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

LLVM IR (-O2):
define void @wiznetSetSocketTypeOfService(i32 %0, i32 %1) {
%3 = tail call i32 @wiznetRegWriteByte(i32 %0, i32 21, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abandon_ship();
int /*<<< orphan*/ printf(char *);
void outmem() {
  printf("FSH data buffer full. Increase BUFSZ parameter in INDEX.FSH\n");
  abandon_ship();
}


x86 assembly (clang, -O0):
<outmem>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <abandon_ship@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<outmem>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <abandon_ship@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"FSH data buffer full. Increase BUFSZ parameter in INDEX.FSH\0A\00"
define void @outmem() {
%1 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @abandon_ship()
ret void
}

LLVM IR (-O2):
@str = [60 x i8] c"FSH data buffer full. Increase BUFSZ parameter in INDEX.FSH\00"
define void @outmem() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @abandon_ship()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(int);
int main() {
  int a = 4, b = 36, c;
  c = a << b;
  print("c  64");
  printid(c);
  c = a >> b;
  print("c  0");
  printid(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x24,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
lea    0xeb1(%rip),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%edi
call   1040 <printid@plt>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x10(%rbp)
lea    0xe98(%rip),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%edi
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <print@plt>
call   1040 <printid@plt>
lea    0xecd(%rip),%rdi
call   1030 <print@plt>
call   1040 <printid@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"c 64\00"
@.str.1 = [5 x i8] c"c 0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %2
store i32 36, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = shl i32 %5, %6
store i32 %7, i32* %4
%8 = call i32 @print(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = call i32 @printid(i32 %9)
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = ashr i32 %11, %12
store i32 %13, i32* %4
%14 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%15 = load i32, i32* %4
%16 = call i32 @printid(i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"c 64\00"
@.str.1 = [5 x i8] c"c 0\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printid(i32 poison)
%3 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printid(i32 poison)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct multiply_resource_id_pool {
  int dummy;
};
struct multiple_ir {
  int dummy;
};
struct multiple_error {
  int dummy;
};

/* Variables and functions */
int multiply_resource_get_bool(struct multiple_error *, struct multiple_ir *,
                               struct multiply_resource_id_pool *,
                               int /*<<< orphan*/ *, int);
int multiply_resource_get_true(struct multiple_error *err,
                               struct multiple_ir *ir,
                               struct multiply_resource_id_pool *res_id,
                               uint32_t *id_out) {
  return multiply_resource_get_bool(err, ir, res_id, id_out, 1);
}


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

x86 assembly (clang, -O2):
<multiply_resource_get_true>:
mov    $0x1,%r8d
jmp    1030 <multiply_resource_get_bool@plt>

LLVM IR (-O0):
%struct.multiple_error = type { i32 }
%struct.multiple_ir = type { i32 }
%struct.multiply_resource_id_pool = type { i32 }
define i32 @multiply_resource_get_true(%struct.multiple_error* %0, %struct.multiple_ir* %1, %struct.multiply_resource_id_pool* %2, i32* %3) {
%5 = alloca %struct.multiple_error*
%6 = alloca %struct.multiple_ir*
%7 = alloca %struct.multiply_resource_id_pool*
%8 = alloca i32*
store %struct.multiple_error* %0, %struct.multiple_error** %5
store %struct.multiple_ir* %1, %struct.multiple_ir** %6
store %struct.multiply_resource_id_pool* %2, %struct.multiply_resource_id_pool** %7
store i32* %3, i32** %8
%9 = load %struct.multiple_error*, %struct.multiple_error** %5
%10 = load %struct.multiple_ir*, %struct.multiple_ir** %6
%11 = load %struct.multiply_resource_id_pool*, %struct.multiply_resource_id_pool** %7
%12 = load i32*, i32** %8
%13 = call i32 @multiply_resource_get_bool(%struct.multiple_error* %9, %struct.multiple_ir* %10, %struct.multiply_resource_id_pool* %11, i32* %12, i32 1)
ret i32 %13
}

LLVM IR (-O2):
%struct.multiple_error = type { i32 }
%struct.multiple_ir = type { i32 }
%struct.multiply_resource_id_pool = type { i32 }
define i32 @multiply_resource_get_true(%struct.multiple_error* %0, %struct.multiple_ir* %1, %struct.multiply_resource_id_pool* %2, i32* %3) {
%5 = tail call i32 @multiply_resource_get_bool(%struct.multiple_error* %0, %struct.multiple_ir* %1, %struct.multiply_resource_id_pool* %2, i32* %3, i32 1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ initComms(char *, int);
int init(unsigned char devid, unsigned char opmode) { initComms("COM7", 300); }


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x12c,%esi
call   1030 <initComms@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
lea    0xee9(%rip),%rdi
mov    $0x12c,%esi
jmp    1030 <initComms@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"COM7\00"
define i32 @init(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
%6 = call i32 @initComms(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 300)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@.str = [5 x i8] c"COM7\00"
define i32 @init(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @initComms(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 300)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main(void) {
  setlocale(LC_ALL, "");
  printf("%'d\n", 1234567);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1040 <setlocale@plt>
lea    0xeb5(%rip),%rdi
mov    $0x12d687,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xed3(%rip),%rsi
call   1040 <setlocale@plt>
lea    0xec3(%rip),%rdi
mov    $0x12d687,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"%'d\0A\00"
define i32 @main() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 1234567)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void terminate_master() { exit(EXIT_SUCCESS); }


x86 assembly (clang, -O0):
<terminate_master>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<terminate_master>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @terminate_master() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = call i32 @exit(i32 %1)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @terminate_master() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
int primalityTest(long long n) {
  printf("ss %lli", n);
  return 0;
}


x86 assembly (clang, -O0):
<primalityTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primalityTest>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"ss %lli\00"
define i32 @primalityTest(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"ss %lli\00"
define i32 @primalityTest(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i32 0
}
/* Variables and functions */
scalar_t__ _U_Qfcmp(long double, long double, int);
int _U_Qfne(long double a, long double b) { return (_U_Qfcmp(a, b, 4) == 0); }


x86 assembly (clang, -O0):
<_U_Qfne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
mov    $0x4,%edi
call   1030 <_U_Qfcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_U_Qfne>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fldt   0x40(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
mov    $0x4,%edi
call   1030 <_U_Qfcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @_U_Qfne(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call i64 @_U_Qfcmp(x86_fp80 %5, x86_fp80 %6, i32 4)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @_U_Qfne(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call i64 @_U_Qfcmp(x86_fp80 %0, x86_fp80 %1, i32 4)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int gcd_couple(int a, int b) {
  if (b == 0)
    return 1;
  if (a % b == 0)
    return b;
  else
    return gcd_couple(b, a % b);
}


x86 assembly (clang, -O0):
<gcd_couple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1134 <gcd_couple+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1163 <gcd_couple+0x53>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    114f <gcd_couple+0x3f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <gcd_couple+0x53>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd_couple@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd_couple>:
mov    %esi,%edx
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
test   %edx,%edx
je     1122 <gcd_couple+0x22>
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd_couple+0x10>
mov    %ecx,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd_couple(i32 %0, i32 %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i32 [ %0, %2 ], [ %5, %7 ]
%5 = phi i32 [ %1, %2 ], [ %8, %7 ]
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = srem i32 %4, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %7, %3
%11 = phi i32 [ 1, %3 ], [ %5, %7 ]
ret i32 %11
}
char dj_set_num_sfx_channels(char num_channels) { return num_channels; }


x86 assembly (clang, -O0):
<dj_set_num_sfx_channels>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @dj_set_num_sfx_channels(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @dj_set_num_sfx_channels(i8 returned signext %0) {
ret i8 %0
}
void *test_anti_range_126(int n) {
  extern void *alloc_anti_range_126(int) __attribute__((alloc_size(1)));
  if ((-0x7fffffff - 1) + 2 <= n && n <= 1)
    n = (-0x7fffffff - 1) + 2 - 1;
  return alloc_anti_range_126(n);
}


x86 assembly (clang, -O0):
<test_anti_range_126>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x80000002,%eax
cmp    -0x4(%rbp),%eax
jg     113a <test_anti_range_126+0x2a>
cmpl   $0x1,-0x4(%rbp)
jg     113a <test_anti_range_126+0x2a>
movl   $0x80000001,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_126@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_126>:
mov    %edi,%eax
add    $0x7ffffffe,%eax
mov    $0x80000001,%eax
cmovns %eax,%edi
jmp    1030 <alloc_anti_range_126@plt>

LLVM IR (-O0):
define i8* @test_anti_range_126(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 -2147483646, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 -2147483647, i32* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i32, i32* %2
%11 = call i8* @alloc_anti_range_126(i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_126(i32 %0) {
%2 = add i32 %0, 2147483646
%3 = icmp sgt i32 %2, -1
%4 = select i1 %3, i32 -2147483647, i32 %0
%5 = tail call i8* @alloc_anti_range_126(i32 %4)
ret i8* %5
}
unsigned getval_142() { return 2425387259U; }


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

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

LLVM IR (-O0):
define i32 @getval_142() {
ret i32 -1869580037
}

LLVM IR (-O2):
define i32 @getval_142() {
ret i32 -1869580037
}
/* Variables and functions */
int /*<<< orphan*/ __on_cpu(int, void (*)(void *), void *, int);
void on_cpu(int cpu, void (*function)(void *data), void *data) {
  __on_cpu(cpu, function, data, 1);
}


x86 assembly (clang, -O0):
<on_cpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <__on_cpu@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_cpu>:
mov    $0x1,%ecx
jmp    1030 <__on_cpu@plt>

LLVM IR (-O0):
define void @on_cpu(i32 %0, void (i8*)* %1, i8* %2) {
%4 = alloca i32
%5 = alloca void (i8*)*
%6 = alloca i8*
store i32 %0, i32* %4
store void (i8*)* %1, void (i8*)** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load void (i8*)*, void (i8*)** %5
%9 = load i8*, i8** %6
%10 = call i32 @__on_cpu(i32 %7, void (i8*)* %8, i8* %9, i32 1)
ret void
}

LLVM IR (-O2):
define void @on_cpu(i32 %0, void (i8*)* %1, i8* %2) {
%4 = tail call i32 @__on_cpu(i32 %0, void (i8*)* %1, i8* %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void _reset(void) {
  fprintf(stdout, "\x1B"
                  "c");
}


x86 assembly (clang, -O0):
<_reset>:
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):
<_reset>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"\1Bc\00"
define void @_reset() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"\1Bc\00"
define void @_reset() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UARTConsoleInit();
int uart_init() {
  UARTConsoleInit();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @uart_init() {
%1 = call i32 (...) @UARTConsoleInit()
ret i32 0
}

LLVM IR (-O2):
define i32 @uart_init() {
%1 = tail call i32 (...) @UARTConsoleInit()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "%s\n%s\n",
                "usage: date [-jnu] [-d dst] [-r seconds] [-t west] "
                "[-v[+|-]val[ymwdHMS]] ... ",
                "            "
                "[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"%s\0A%s\0A\00"
@.str.1 = [78 x i8] c"usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... \00"
@.str.2 = [66 x i8] c" [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s\0A%s\0A\00"
@.str.1 = [78 x i8] c"usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... \00"
@.str.2 = [66 x i8] c" [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}